Class: PaypalServerSdk::CardResponseEntity
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::CardResponseEntity
- Defined in:
- lib/paypal_server_sdk/models/card_response_entity.rb
Overview
Full representation of a Card Payment Token.
Instance Attribute Summary collapse
-
#authentication_result ⇒ CardAuthenticationResponse
Results of Authentication such as 3D Secure.
-
#billing_address ⇒ AddressDetails
Address request details.
-
#bin_details ⇒ BinDetails
Bank Identification Number (BIN) details used to fund a payment.
-
#brand ⇒ CardBrand
The card network or brand.
-
#expiry ⇒ String
The year and month, in ISO-8601 ‘YYYY-MM` date format.
-
#last_digits ⇒ String
The last digits of the payment card.
-
#name ⇒ String
The card holder’s name as it appears on the card.
-
#network_transaction_reference ⇒ NetworkTransactionReferenceEntity
Previous network transaction reference including id in response.
-
#type ⇒ CardType
Type of card.
-
#verification ⇒ CardVerificationDetails
Card Verification details including the authorization details and 3D SECURE details.
-
#verification_status ⇒ String
Verification status of Card.
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(name: SKIP, last_digits: SKIP, brand: SKIP, expiry: SKIP, billing_address: SKIP, verification_status: SKIP, verification: SKIP, network_transaction_reference: SKIP, authentication_result: SKIP, bin_details: SKIP, type: SKIP) ⇒ CardResponseEntity
constructor
A new instance of CardResponseEntity.
Methods inherited from BaseModel
Constructor Details
#initialize(name: SKIP, last_digits: SKIP, brand: SKIP, expiry: SKIP, billing_address: SKIP, verification_status: SKIP, verification: SKIP, network_transaction_reference: SKIP, authentication_result: SKIP, bin_details: SKIP, type: SKIP) ⇒ CardResponseEntity
Returns a new instance of CardResponseEntity.
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/paypal_server_sdk/models/card_response_entity.rb', line 99 def initialize(name: SKIP, last_digits: SKIP, brand: SKIP, expiry: SKIP, billing_address: SKIP, verification_status: SKIP, verification: SKIP, network_transaction_reference: SKIP, authentication_result: SKIP, bin_details: SKIP, type: SKIP) @name = name unless name == SKIP @last_digits = last_digits unless last_digits == SKIP @brand = brand unless brand == SKIP @expiry = expiry unless expiry == SKIP @billing_address = billing_address unless billing_address == SKIP @verification_status = verification_status unless verification_status == SKIP @verification = verification unless verification == SKIP unless network_transaction_reference == SKIP @network_transaction_reference = network_transaction_reference end @authentication_result = authentication_result unless authentication_result == SKIP @bin_details = bin_details unless bin_details == SKIP @type = type unless type == SKIP end |
Instance Attribute Details
#authentication_result ⇒ CardAuthenticationResponse
Results of Authentication such as 3D Secure.
49 50 51 |
# File 'lib/paypal_server_sdk/models/card_response_entity.rb', line 49 def authentication_result @authentication_result end |
#billing_address ⇒ AddressDetails
Address request details.
32 33 34 |
# File 'lib/paypal_server_sdk/models/card_response_entity.rb', line 32 def billing_address @billing_address end |
#bin_details ⇒ BinDetails
Bank Identification Number (BIN) details used to fund a payment.
53 54 55 |
# File 'lib/paypal_server_sdk/models/card_response_entity.rb', line 53 def bin_details @bin_details end |
#brand ⇒ CardBrand
The card network or brand. Applies to credit, debit, gift, and payment cards.
23 24 25 |
# File 'lib/paypal_server_sdk/models/card_response_entity.rb', line 23 def brand @brand end |
#expiry ⇒ String
The year and month, in ISO-8601 ‘YYYY-MM` date format. See [Internet date and time format](tools.ietf.org/html/rfc3339#section-5.6).
28 29 30 |
# File 'lib/paypal_server_sdk/models/card_response_entity.rb', line 28 def expiry @expiry end |
#last_digits ⇒ String
The last digits of the payment card.
18 19 20 |
# File 'lib/paypal_server_sdk/models/card_response_entity.rb', line 18 def last_digits @last_digits end |
#name ⇒ String
The card holder’s name as it appears on the card.
14 15 16 |
# File 'lib/paypal_server_sdk/models/card_response_entity.rb', line 14 def name @name end |
#network_transaction_reference ⇒ NetworkTransactionReferenceEntity
Previous network transaction reference including id in response.
45 46 47 |
# File 'lib/paypal_server_sdk/models/card_response_entity.rb', line 45 def network_transaction_reference @network_transaction_reference end |
#type ⇒ CardType
Type of card. i.e Credit, Debit and so on.
57 58 59 |
# File 'lib/paypal_server_sdk/models/card_response_entity.rb', line 57 def type @type end |
#verification ⇒ CardVerificationDetails
Card Verification details including the authorization details and 3D SECURE details.
41 42 43 |
# File 'lib/paypal_server_sdk/models/card_response_entity.rb', line 41 def verification @verification end |
#verification_status ⇒ String
Verification status of Card.
36 37 38 |
# File 'lib/paypal_server_sdk/models/card_response_entity.rb', line 36 def verification_status @verification_status end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/paypal_server_sdk/models/card_response_entity.rb', line 120 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. name = hash.key?('name') ? hash['name'] : SKIP last_digits = hash.key?('last_digits') ? hash['last_digits'] : SKIP brand = hash.key?('brand') ? hash['brand'] : SKIP expiry = hash.key?('expiry') ? hash['expiry'] : SKIP billing_address = AddressDetails.from_hash(hash['billing_address']) if hash['billing_address'] verification_status = hash.key?('verification_status') ? hash['verification_status'] : SKIP verification = CardVerificationDetails.from_hash(hash['verification']) if hash['verification'] if hash['network_transaction_reference'] network_transaction_reference = NetworkTransactionReferenceEntity.from_hash(hash['network_transaction_reference']) end authentication_result = CardAuthenticationResponse.from_hash(hash['authentication_result']) if hash['authentication_result'] bin_details = BinDetails.from_hash(hash['bin_details']) if hash['bin_details'] type = hash.key?('type') ? hash['type'] : SKIP # Create object from extracted values. CardResponseEntity.new(name: name, last_digits: last_digits, brand: brand, expiry: expiry, billing_address: billing_address, verification_status: verification_status, verification: verification, network_transaction_reference: network_transaction_reference, authentication_result: authentication_result, bin_details: bin_details, type: type) end |
.names ⇒ Object
A mapping from model property names to API property names.
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/paypal_server_sdk/models/card_response_entity.rb', line 60 def self.names @_hash = {} if @_hash.nil? @_hash['name'] = 'name' @_hash['last_digits'] = 'last_digits' @_hash['brand'] = 'brand' @_hash['expiry'] = 'expiry' @_hash['billing_address'] = 'billing_address' @_hash['verification_status'] = 'verification_status' @_hash['verification'] = 'verification' @_hash['network_transaction_reference'] = 'network_transaction_reference' @_hash['authentication_result'] = 'authentication_result' @_hash['bin_details'] = 'bin_details' @_hash['type'] = 'type' @_hash end |
.nullables ⇒ Object
An array for nullable fields
95 96 97 |
# File 'lib/paypal_server_sdk/models/card_response_entity.rb', line 95 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/paypal_server_sdk/models/card_response_entity.rb', line 78 def self.optionals %w[ name last_digits brand expiry billing_address verification_status verification network_transaction_reference authentication_result bin_details type ] end |