Class: PaypalServerSdk::BinDetails
- 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
-
#bin ⇒ String
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.
-
#bin_country_code ⇒ String
The [two-character ISO 3166-1 code](/api/rest/reference/country-codes/) that identifies the country or region.
-
#issuing_bank ⇒ String
The issuer of the card instrument.
-
#products ⇒ Array[String]
The type of card product assigned to the BIN by the issuer.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(bin: SKIP, issuing_bank: SKIP, bin_country_code: SKIP, products: SKIP) ⇒ BinDetails
constructor
A new instance of BinDetails.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #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.
61 62 63 64 65 66 67 |
# File 'lib/paypal_server_sdk/models/bin_details.rb', line 61 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
#bin ⇒ String
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.
16 17 18 |
# File 'lib/paypal_server_sdk/models/bin_details.rb', line 16 def bin @bin end |
#bin_country_code ⇒ String
The [two-character ISO 3166-1 code](/api/rest/reference/country-codes/) that identifies the country or region. Note: 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.
28 29 30 |
# File 'lib/paypal_server_sdk/models/bin_details.rb', line 28 def bin_country_code @bin_country_code end |
#issuing_bank ⇒ String
The issuer of the card instrument.
20 21 22 |
# File 'lib/paypal_server_sdk/models/bin_details.rb', line 20 def issuing_bank @issuing_bank end |
#products ⇒ Array[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.
34 35 36 |
# File 'lib/paypal_server_sdk/models/bin_details.rb', line 34 def products @products end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/paypal_server_sdk/models/bin_details.rb', line 70 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 |
.names ⇒ Object
A mapping from model property names to API property names.
37 38 39 40 41 42 43 44 |
# File 'lib/paypal_server_sdk/models/bin_details.rb', line 37 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 |
.nullables ⇒ Object
An array for nullable fields
57 58 59 |
# File 'lib/paypal_server_sdk/models/bin_details.rb', line 57 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
47 48 49 50 51 52 53 54 |
# File 'lib/paypal_server_sdk/models/bin_details.rb', line 47 def self.optionals %w[ bin issuing_bank bin_country_code products ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
95 96 97 98 99 |
# File 'lib/paypal_server_sdk/models/bin_details.rb', line 95 def inspect class_name = self.class.name.split('::').last "<#{class_name} bin: #{@bin.inspect}, issuing_bank: #{@issuing_bank.inspect},"\ " bin_country_code: #{@bin_country_code.inspect}, products: #{@products.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
88 89 90 91 92 |
# File 'lib/paypal_server_sdk/models/bin_details.rb', line 88 def to_s class_name = self.class.name.split('::').last "<#{class_name} bin: #{@bin}, issuing_bank: #{@issuing_bank}, bin_country_code:"\ " #{@bin_country_code}, products: #{@products}>" end |