Class: PaypalServerSdk::BinDetails

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/paypal_server_sdk/models/bin_details.rb

Overview

Bank Identification Number (BIN) details used to fund a payment.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(bin: SKIP, issuing_bank: SKIP, bin_country_code: SKIP, products: SKIP) ⇒ BinDetails

Returns a new instance of BinDetails.



62
63
64
65
66
67
68
# File 'lib/paypal_server_sdk/models/bin_details.rb', line 62

def initialize(bin: SKIP, issuing_bank: SKIP, bin_country_code: SKIP,
               products: SKIP)
  @bin = bin unless bin == SKIP
  @issuing_bank = issuing_bank unless issuing_bank == SKIP
  @bin_country_code = bin_country_code unless bin_country_code == SKIP
  @products = products unless products == SKIP
end

Instance Attribute Details

#binString

The Bank Identification Number (BIN) signifies the number that is being used to identify the granular level details (except the PII information) of the card.

Returns:

  • (String)


16
17
18
# File 'lib/paypal_server_sdk/models/bin_details.rb', line 16

def bin
  @bin
end

#bin_country_codeString

The [two-character ISO 3166-1 code](/api/rest/reference/country-codes/) that identifies the country or region.<blockquote><strong>Note:</strong> The country code for Great Britain is GB and not UK as used in the top-level domain names for that country. Use the ‘C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.</blockquote>

Returns:

  • (String)


29
30
31
# File 'lib/paypal_server_sdk/models/bin_details.rb', line 29

def bin_country_code
  @bin_country_code
end

#issuing_bankString

The issuer of the card instrument.

Returns:

  • (String)


20
21
22
# File 'lib/paypal_server_sdk/models/bin_details.rb', line 20

def issuing_bank
  @issuing_bank
end

#productsArray[String]

The type of card product assigned to the BIN by the issuer. These values are defined by the issuer and may change over time. Some examples include: PREPAID_GIFT, CONSUMER, CORPORATE.

Returns:

  • (Array[String])


35
36
37
# File 'lib/paypal_server_sdk/models/bin_details.rb', line 35

def products
  @products
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/paypal_server_sdk/models/bin_details.rb', line 71

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  bin = hash.key?('bin') ? hash['bin'] : SKIP
  issuing_bank = hash.key?('issuing_bank') ? hash['issuing_bank'] : SKIP
  bin_country_code =
    hash.key?('bin_country_code') ? hash['bin_country_code'] : SKIP
  products = hash.key?('products') ? hash['products'] : SKIP

  # Create object from extracted values.
  BinDetails.new(bin: bin,
                 issuing_bank: issuing_bank,
                 bin_country_code: bin_country_code,
                 products: products)
end

.namesObject

A mapping from model property names to API property names.



38
39
40
41
42
43
44
45
# File 'lib/paypal_server_sdk/models/bin_details.rb', line 38

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['bin'] = 'bin'
  @_hash['issuing_bank'] = 'issuing_bank'
  @_hash['bin_country_code'] = 'bin_country_code'
  @_hash['products'] = 'products'
  @_hash
end

.nullablesObject

An array for nullable fields



58
59
60
# File 'lib/paypal_server_sdk/models/bin_details.rb', line 58

def self.nullables
  []
end

.optionalsObject

An array for optional fields



48
49
50
51
52
53
54
55
# File 'lib/paypal_server_sdk/models/bin_details.rb', line 48

def self.optionals
  %w[
    bin
    issuing_bank
    bin_country_code
    products
  ]
end