Class: PaypalServerSdk::CardRequest
- Defined in:
- lib/paypal_server_sdk/models/card_request.rb
Overview
The payment card to use to fund a payment. Can be a credit or debit card. Note: Passing card number, cvv and expiry directly via the API requires PCI SAQ D compliance. *PayPal offers a mechanism by which you do not have to take on the PCI SAQ D burden by using hosted fields - refer to this Integration Guide*.
Instance Attribute Summary collapse
-
#attributes ⇒ CardAttributes
Additional attributes associated with the use of this card.
-
#billing_address ⇒ Address
The portable international postal address.
-
#experience_context ⇒ CardExperienceContext
Customizes the payer experience during the 3DS Approval for payment.
-
#expiry ⇒ String
The year and month, in ISO-8601 ‘YYYY-MM` date format.
-
#name ⇒ String
The card holder’s name as it appears on the card.
-
#network_token ⇒ NetworkToken
The Third Party Network token used to fund a payment.
-
#number ⇒ String
The primary account number (PAN) for the payment card.
-
#security_code ⇒ String
The three- or four-digit security code of the card.
-
#single_use_token ⇒ String
The PayPal-generated, short-lived, one-time-use token, used to communicate payment information to PayPal for transaction processing.
-
#stored_credential ⇒ CardStoredCredential
Provides additional details to process a payment using a ‘card` that has been stored or is intended to be stored (also referred to as stored_credential or card-on-file).
-
#vault_id ⇒ String
The PayPal-generated ID for the vaulted payment source.
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, number: SKIP, expiry: SKIP, security_code: SKIP, billing_address: SKIP, attributes: SKIP, vault_id: SKIP, single_use_token: SKIP, stored_credential: SKIP, network_token: SKIP, experience_context: SKIP) ⇒ CardRequest
constructor
A new instance of CardRequest.
-
#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(name: SKIP, number: SKIP, expiry: SKIP, security_code: SKIP, billing_address: SKIP, attributes: SKIP, vault_id: SKIP, single_use_token: SKIP, stored_credential: SKIP, network_token: SKIP, experience_context: SKIP) ⇒ CardRequest
Returns a new instance of CardRequest.
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/paypal_server_sdk/models/card_request.rb', line 119 def initialize(name: SKIP, number: SKIP, expiry: SKIP, security_code: SKIP, billing_address: SKIP, attributes: SKIP, vault_id: SKIP, single_use_token: SKIP, stored_credential: SKIP, network_token: SKIP, experience_context: SKIP) @name = name unless name == SKIP @number = number unless number == SKIP @expiry = expiry unless expiry == SKIP @security_code = security_code unless security_code == SKIP @billing_address = billing_address unless billing_address == SKIP @attributes = attributes unless attributes == SKIP @vault_id = vault_id unless vault_id == SKIP @single_use_token = single_use_token unless single_use_token == SKIP @stored_credential = stored_credential unless stored_credential == SKIP @network_token = network_token unless network_token == SKIP @experience_context = experience_context unless experience_context == SKIP end |
Instance Attribute Details
#attributes ⇒ CardAttributes
Additional attributes associated with the use of this card.
46 47 48 |
# File 'lib/paypal_server_sdk/models/card_request.rb', line 46 def attributes @attributes end |
#billing_address ⇒ Address
The portable international postal address. Maps to [AddressValidationMetadata](github.com/googlei18n/libaddressinput/ wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](www.w3.org/TR/html51/sec-forms.html#autofilling-form-co ntrols-the-autocomplete-attribute).
42 43 44 |
# File 'lib/paypal_server_sdk/models/card_request.rb', line 42 def billing_address @billing_address end |
#experience_context ⇒ CardExperienceContext
Customizes the payer experience during the 3DS Approval for payment.
78 79 80 |
# File 'lib/paypal_server_sdk/models/card_request.rb', line 78 def experience_context @experience_context 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).
27 28 29 |
# File 'lib/paypal_server_sdk/models/card_request.rb', line 27 def expiry @expiry end |
#name ⇒ String
The card holder’s name as it appears on the card.
18 19 20 |
# File 'lib/paypal_server_sdk/models/card_request.rb', line 18 def name @name end |
#network_token ⇒ NetworkToken
The Third Party Network token used to fund a payment.
74 75 76 |
# File 'lib/paypal_server_sdk/models/card_request.rb', line 74 def network_token @network_token end |
#number ⇒ String
The primary account number (PAN) for the payment card.
22 23 24 |
# File 'lib/paypal_server_sdk/models/card_request.rb', line 22 def number @number end |
#security_code ⇒ String
The three- or four-digit security code of the card. Also known as the CVV, CVC, CVN, CVE, or CID. This parameter cannot be present in the request when ‘payment_initiator=MERCHANT`.
33 34 35 |
# File 'lib/paypal_server_sdk/models/card_request.rb', line 33 def security_code @security_code end |
#single_use_token ⇒ String
The PayPal-generated, short-lived, one-time-use token, used to communicate payment information to PayPal for transaction processing.
57 58 59 |
# File 'lib/paypal_server_sdk/models/card_request.rb', line 57 def single_use_token @single_use_token end |
#stored_credential ⇒ CardStoredCredential
Provides additional details to process a payment using a ‘card` that has been stored or is intended to be stored (also referred to as stored_credential or card-on-file). Parameter compatibility: `payment_type=ONE_TIME` is compatible only with `payment_initiator=CUSTOMER`. `usage=FIRST` is compatible only with `payment_initiator=CUSTOMER`. `previous_transaction_reference` or `previous_network_transaction_reference` is compatible only with `payment_initiator=MERCHANT`. Only one of the parameters - `previous_transaction_reference` and `previous_network_transaction_reference` - can be present in the request.
70 71 72 |
# File 'lib/paypal_server_sdk/models/card_request.rb', line 70 def stored_credential @stored_credential end |
#vault_id ⇒ String
The PayPal-generated ID for the vaulted payment source. This ID should be stored on the merchant’s server so the saved payment source can be used for future transactions.
52 53 54 |
# File 'lib/paypal_server_sdk/models/card_request.rb', line 52 def vault_id @vault_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
# File 'lib/paypal_server_sdk/models/card_request.rb', line 137 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. name = hash.key?('name') ? hash['name'] : SKIP number = hash.key?('number') ? hash['number'] : SKIP expiry = hash.key?('expiry') ? hash['expiry'] : SKIP security_code = hash.key?('security_code') ? hash['security_code'] : SKIP billing_address = Address.from_hash(hash['billing_address']) if hash['billing_address'] attributes = CardAttributes.from_hash(hash['attributes']) if hash['attributes'] vault_id = hash.key?('vault_id') ? hash['vault_id'] : SKIP single_use_token = hash.key?('single_use_token') ? hash['single_use_token'] : SKIP stored_credential = CardStoredCredential.from_hash(hash['stored_credential']) if hash['stored_credential'] network_token = NetworkToken.from_hash(hash['network_token']) if hash['network_token'] experience_context = CardExperienceContext.from_hash(hash['experience_context']) if hash['experience_context'] # Create object from extracted values. CardRequest.new(name: name, number: number, expiry: expiry, security_code: security_code, billing_address: billing_address, attributes: attributes, vault_id: vault_id, single_use_token: single_use_token, stored_credential: stored_credential, network_token: network_token, experience_context: experience_context) end |
.names ⇒ Object
A mapping from model property names to API property names.
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/paypal_server_sdk/models/card_request.rb', line 81 def self.names @_hash = {} if @_hash.nil? @_hash['name'] = 'name' @_hash['number'] = 'number' @_hash['expiry'] = 'expiry' @_hash['security_code'] = 'security_code' @_hash['billing_address'] = 'billing_address' @_hash['attributes'] = 'attributes' @_hash['vault_id'] = 'vault_id' @_hash['single_use_token'] = 'single_use_token' @_hash['stored_credential'] = 'stored_credential' @_hash['network_token'] = 'network_token' @_hash['experience_context'] = 'experience_context' @_hash end |
.nullables ⇒ Object
An array for nullable fields
115 116 117 |
# File 'lib/paypal_server_sdk/models/card_request.rb', line 115 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/paypal_server_sdk/models/card_request.rb', line 98 def self.optionals %w[ name number expiry security_code billing_address attributes vault_id single_use_token stored_credential network_token experience_context ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
181 182 183 184 185 186 187 188 189 |
# File 'lib/paypal_server_sdk/models/card_request.rb', line 181 def inspect class_name = self.class.name.split('::').last "<#{class_name} name: #{@name.inspect}, number: #{@number.inspect}, expiry:"\ " #{@expiry.inspect}, security_code: #{@security_code.inspect}, billing_address:"\ " #{@billing_address.inspect}, attributes: #{@attributes.inspect}, vault_id:"\ " #{@vault_id.inspect}, single_use_token: #{@single_use_token.inspect}, stored_credential:"\ " #{@stored_credential.inspect}, network_token: #{@network_token.inspect},"\ " experience_context: #{@experience_context.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
171 172 173 174 175 176 177 178 |
# File 'lib/paypal_server_sdk/models/card_request.rb', line 171 def to_s class_name = self.class.name.split('::').last "<#{class_name} name: #{@name}, number: #{@number}, expiry: #{@expiry}, security_code:"\ " #{@security_code}, billing_address: #{@billing_address}, attributes: #{@attributes},"\ " vault_id: #{@vault_id}, single_use_token: #{@single_use_token}, stored_credential:"\ " #{@stored_credential}, network_token: #{@network_token}, experience_context:"\ " #{@experience_context}>" end |