Class: PaypalServerSdk::ApplePayPaymentObject
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::ApplePayPaymentObject
- Defined in:
- lib/paypal_server_sdk/models/apple_pay_payment_object.rb
Overview
Information needed to pay using ApplePay.
Instance Attribute Summary collapse
-
#attributes ⇒ ApplePayAttributesResponse
Additional attributes associated with the use of Apple Pay.
-
#card ⇒ ApplePayCardResponse
The Card from Apple Pay Wallet used to fund the payment.
-
#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. -
#id ⇒ String
ApplePay transaction identifier, this will be the unique identifier for this transaction provided by Apple.
-
#name ⇒ String
The full name representation like Mr J Smith.
-
#phone_number ⇒ PhoneNumber
The phone number in its canonical international [E.164 numbering plan format](www.itu.int/rec/T-REC-E.164/en).
-
#token ⇒ String
Encrypted ApplePay token, containing card information.
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(id: SKIP, token: SKIP, name: SKIP, email_address: SKIP, phone_number: SKIP, card: SKIP, attributes: SKIP) ⇒ ApplePayPaymentObject
constructor
A new instance of ApplePayPaymentObject.
Methods inherited from BaseModel
Constructor Details
#initialize(id: SKIP, token: SKIP, name: SKIP, email_address: SKIP, phone_number: SKIP, card: SKIP, attributes: SKIP) ⇒ ApplePayPaymentObject
Returns a new instance of ApplePayPaymentObject.
80 81 82 83 84 85 86 87 88 89 |
# File 'lib/paypal_server_sdk/models/apple_pay_payment_object.rb', line 80 def initialize(id: SKIP, token: SKIP, name: SKIP, email_address: SKIP, phone_number: SKIP, card: SKIP, attributes: SKIP) @id = id unless id == SKIP @token = token unless token == SKIP @name = name unless name == SKIP @email_address = email_address unless email_address == SKIP @phone_number = phone_number unless phone_number == SKIP @card = card unless card == SKIP @attributes = attributes unless attributes == SKIP end |
Instance Attribute Details
#attributes ⇒ ApplePayAttributesResponse
Additional attributes associated with the use of Apple Pay.
47 48 49 |
# File 'lib/paypal_server_sdk/models/apple_pay_payment_object.rb', line 47 def attributes @attributes end |
#card ⇒ ApplePayCardResponse
The Card from Apple Pay Wallet used to fund the payment.
43 44 45 |
# File 'lib/paypal_server_sdk/models/apple_pay_payment_object.rb', line 43 def card @card 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>
34 35 36 |
# File 'lib/paypal_server_sdk/models/apple_pay_payment_object.rb', line 34 def email_address @email_address end |
#id ⇒ String
ApplePay transaction identifier, this will be the unique identifier for this transaction provided by Apple. The pattern is defined by an external party and supports Unicode.
16 17 18 |
# File 'lib/paypal_server_sdk/models/apple_pay_payment_object.rb', line 16 def id @id end |
#name ⇒ String
The full name representation like Mr J Smith.
26 27 28 |
# File 'lib/paypal_server_sdk/models/apple_pay_payment_object.rb', line 26 def name @name end |
#phone_number ⇒ PhoneNumber
The phone number in its canonical international [E.164 numbering plan format](www.itu.int/rec/T-REC-E.164/en).
39 40 41 |
# File 'lib/paypal_server_sdk/models/apple_pay_payment_object.rb', line 39 def phone_number @phone_number end |
#token ⇒ String
Encrypted ApplePay token, containing card information. This token would be base64encoded. The pattern is defined by an external party and supports Unicode.
22 23 24 |
# File 'lib/paypal_server_sdk/models/apple_pay_payment_object.rb', line 22 def token @token end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/paypal_server_sdk/models/apple_pay_payment_object.rb', line 92 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : SKIP token = hash.key?('token') ? hash['token'] : SKIP name = hash.key?('name') ? hash['name'] : SKIP email_address = hash.key?('email_address') ? hash['email_address'] : SKIP phone_number = PhoneNumber.from_hash(hash['phone_number']) if hash['phone_number'] card = ApplePayCardResponse.from_hash(hash['card']) if hash['card'] attributes = ApplePayAttributesResponse.from_hash(hash['attributes']) if hash['attributes'] # Create object from extracted values. ApplePayPaymentObject.new(id: id, token: token, name: name, email_address: email_address, phone_number: phone_number, card: card, attributes: attributes) end |
.names ⇒ Object
A mapping from model property names to API property names.
50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/paypal_server_sdk/models/apple_pay_payment_object.rb', line 50 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['token'] = 'token' @_hash['name'] = 'name' @_hash['email_address'] = 'email_address' @_hash['phone_number'] = 'phone_number' @_hash['card'] = 'card' @_hash['attributes'] = 'attributes' @_hash end |
.nullables ⇒ Object
An array for nullable fields
76 77 78 |
# File 'lib/paypal_server_sdk/models/apple_pay_payment_object.rb', line 76 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/paypal_server_sdk/models/apple_pay_payment_object.rb', line 63 def self.optionals %w[ id token name email_address phone_number card attributes ] end |