Class: PaypalServerSdk::PaypalPaymentToken
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::PaypalPaymentToken
- Defined in:
- lib/paypal_server_sdk/models/paypal_payment_token.rb
Overview
PaypalPaymentToken Model.
Instance Attribute Summary collapse
-
#account_id ⇒ String
The account identifier for a PayPal account.
-
#address ⇒ Address
The portable international postal address.
-
#customer_type ⇒ String
The customer type associated with a digital wallet payment token.
-
#description ⇒ String
The description displayed to the consumer on the approval flow for a digital wallet, as well as on the merchant view of the payment token management experience.
-
#email_address ⇒ String
The internationalized email address.<blockquote><strong>Note:</strong> Up to 64 characters are allowed before and 255 characters are allowed after the
@
sign. -
#name ⇒ Name
The name of the party.
-
#payer_id ⇒ String
The account identifier for a PayPal account.
-
#permit_multiple_payment_tokens ⇒ TrueClass | FalseClass
Create multiple payment tokens for the same payer, merchant/platform combination.
-
#phone ⇒ PhoneWithType
The phone information.
-
#phone_number ⇒ Phone
The phone number, in its canonical international [E.164 numbering plan format](www.itu.int/rec/T-REC-E.164/en).
-
#shipping ⇒ VaultedDigitalWalletShippingDetails
The shipping details.
-
#usage_type ⇒ String
The usage type associated with a digital wallet payment token.
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(description: SKIP, shipping: SKIP, permit_multiple_payment_tokens: false, usage_type: SKIP, customer_type: SKIP, email_address: SKIP, payer_id: SKIP, name: SKIP, phone: SKIP, address: SKIP, account_id: SKIP, phone_number: SKIP) ⇒ PaypalPaymentToken
constructor
A new instance of PaypalPaymentToken.
Methods inherited from BaseModel
Constructor Details
#initialize(description: SKIP, shipping: SKIP, permit_multiple_payment_tokens: false, usage_type: SKIP, customer_type: SKIP, email_address: SKIP, payer_id: SKIP, name: SKIP, phone: SKIP, address: SKIP, account_id: SKIP, phone_number: SKIP) ⇒ PaypalPaymentToken
Returns a new instance of PaypalPaymentToken.
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/paypal_server_sdk/models/paypal_payment_token.rb', line 123 def initialize(description: SKIP, shipping: SKIP, permit_multiple_payment_tokens: false, usage_type: SKIP, customer_type: SKIP, email_address: SKIP, payer_id: SKIP, name: SKIP, phone: SKIP, address: SKIP, account_id: SKIP, phone_number: SKIP) @description = description unless description == SKIP @shipping = shipping unless shipping == SKIP unless permit_multiple_payment_tokens == SKIP @permit_multiple_payment_tokens = permit_multiple_payment_tokens end @usage_type = usage_type unless usage_type == SKIP @customer_type = customer_type unless customer_type == SKIP @email_address = email_address unless email_address == SKIP @payer_id = payer_id unless payer_id == SKIP @name = name unless name == SKIP @phone = phone unless phone == SKIP @address = address unless address == SKIP @account_id = account_id unless account_id == SKIP @phone_number = phone_number unless phone_number == SKIP end |
Instance Attribute Details
#account_id ⇒ String
The account identifier for a PayPal account.
74 75 76 |
# File 'lib/paypal_server_sdk/models/paypal_payment_token.rb', line 74 def account_id @account_id end |
#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).
70 71 72 |
# File 'lib/paypal_server_sdk/models/paypal_payment_token.rb', line 70 def address @address end |
#customer_type ⇒ String
The customer type associated with a digital wallet payment token. This is to indicate whether the customer acting on the merchant / platform is either a business or a consumer.
41 42 43 |
# File 'lib/paypal_server_sdk/models/paypal_payment_token.rb', line 41 def customer_type @customer_type end |
#description ⇒ String
The description displayed to the consumer on the approval flow for a digital wallet, as well as on the merchant view of the payment token management experience. exp: PayPal.com.
16 17 18 |
# File 'lib/paypal_server_sdk/models/paypal_payment_token.rb', line 16 def description @description end |
#email_address ⇒ String
The internationalized email address.<blockquote><strong>Note:</strong> Up to 64 characters are allowed before and 255 characters are allowed after the @
sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @
sign exists.</blockquote>
49 50 51 |
# File 'lib/paypal_server_sdk/models/paypal_payment_token.rb', line 49 def email_address @email_address end |
#name ⇒ Name
The name of the party.
57 58 59 |
# File 'lib/paypal_server_sdk/models/paypal_payment_token.rb', line 57 def name @name end |
#payer_id ⇒ String
The account identifier for a PayPal account.
53 54 55 |
# File 'lib/paypal_server_sdk/models/paypal_payment_token.rb', line 53 def payer_id @payer_id end |
#permit_multiple_payment_tokens ⇒ TrueClass | FalseClass
Create multiple payment tokens for the same payer, merchant/platform combination. Use this when the customer has not logged in at merchant/platform. The payment token thus generated, can then also be used to create the customer account at merchant/platform. Use this also when multiple payment tokens are required for the same payer, different customer at merchant/platform. This helps to identify customers distinctly even though they may share the same PayPal account. This only applies to PayPal payment source.
31 32 33 |
# File 'lib/paypal_server_sdk/models/paypal_payment_token.rb', line 31 def permit_multiple_payment_tokens @permit_multiple_payment_tokens end |
#phone ⇒ PhoneWithType
The phone information.
61 62 63 |
# File 'lib/paypal_server_sdk/models/paypal_payment_token.rb', line 61 def phone @phone end |
#phone_number ⇒ Phone
The phone number, in its canonical international [E.164 numbering plan format](www.itu.int/rec/T-REC-E.164/en).
79 80 81 |
# File 'lib/paypal_server_sdk/models/paypal_payment_token.rb', line 79 def phone_number @phone_number end |
#shipping ⇒ VaultedDigitalWalletShippingDetails
The shipping details.
20 21 22 |
# File 'lib/paypal_server_sdk/models/paypal_payment_token.rb', line 20 def shipping @shipping end |
#usage_type ⇒ String
The usage type associated with a digital wallet payment token.
35 36 37 |
# File 'lib/paypal_server_sdk/models/paypal_payment_token.rb', line 35 def usage_type @usage_type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 |
# File 'lib/paypal_server_sdk/models/paypal_payment_token.rb', line 146 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. description = hash.key?('description') ? hash['description'] : SKIP shipping = VaultedDigitalWalletShippingDetails.from_hash(hash['shipping']) if hash['shipping'] permit_multiple_payment_tokens = hash['permit_multiple_payment_tokens'] ||= false usage_type = hash.key?('usage_type') ? hash['usage_type'] : SKIP customer_type = hash.key?('customer_type') ? hash['customer_type'] : SKIP email_address = hash.key?('email_address') ? hash['email_address'] : SKIP payer_id = hash.key?('payer_id') ? hash['payer_id'] : SKIP name = Name.from_hash(hash['name']) if hash['name'] phone = PhoneWithType.from_hash(hash['phone']) if hash['phone'] address = Address.from_hash(hash['address']) if hash['address'] account_id = hash.key?('account_id') ? hash['account_id'] : SKIP phone_number = Phone.from_hash(hash['phone_number']) if hash['phone_number'] # Create object from extracted values. PaypalPaymentToken.new(description: description, shipping: shipping, permit_multiple_payment_tokens: permit_multiple_payment_tokens, usage_type: usage_type, customer_type: customer_type, email_address: email_address, payer_id: payer_id, name: name, phone: phone, address: address, account_id: account_id, phone_number: phone_number) end |
.names ⇒ Object
A mapping from model property names to API property names.
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/paypal_server_sdk/models/paypal_payment_token.rb', line 82 def self.names @_hash = {} if @_hash.nil? @_hash['description'] = 'description' @_hash['shipping'] = 'shipping' @_hash['permit_multiple_payment_tokens'] = 'permit_multiple_payment_tokens' @_hash['usage_type'] = 'usage_type' @_hash['customer_type'] = 'customer_type' @_hash['email_address'] = 'email_address' @_hash['payer_id'] = 'payer_id' @_hash['name'] = 'name' @_hash['phone'] = 'phone' @_hash['address'] = 'address' @_hash['account_id'] = 'account_id' @_hash['phone_number'] = 'phone_number' @_hash end |
.nullables ⇒ Object
An array for nullable fields
119 120 121 |
# File 'lib/paypal_server_sdk/models/paypal_payment_token.rb', line 119 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/paypal_server_sdk/models/paypal_payment_token.rb', line 101 def self.optionals %w[ description shipping permit_multiple_payment_tokens usage_type customer_type email_address payer_id name phone address account_id phone_number ] end |