Class: PaypalServerSdk::PaymentTokenResponsePaymentSource
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::PaymentTokenResponsePaymentSource
- Defined in:
- lib/paypal_server_sdk/models/payment_token_response_payment_source.rb
Overview
The vaulted payment method details.
Instance Attribute Summary collapse
-
#apple_pay ⇒ ApplePayPaymentToken
A resource representing a response for Apple Pay.
-
#bank ⇒ Hash
Full representation of a Bank Payment Token.
-
#card ⇒ CardPaymentToken
Full representation of a Card Payment Token including network token.
-
#paypal ⇒ PaypalPaymentToken
Full representation of a Card Payment Token including network token.
-
#venmo ⇒ VenmoPaymentToken
Full representation of a Card Payment Token including network 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(card: SKIP, paypal: SKIP, venmo: SKIP, apple_pay: SKIP, bank: SKIP) ⇒ PaymentTokenResponsePaymentSource
constructor
A new instance of PaymentTokenResponsePaymentSource.
Methods inherited from BaseModel
Constructor Details
#initialize(card: SKIP, paypal: SKIP, venmo: SKIP, apple_pay: SKIP, bank: SKIP) ⇒ PaymentTokenResponsePaymentSource
Returns a new instance of PaymentTokenResponsePaymentSource.
59 60 61 62 63 64 65 66 |
# File 'lib/paypal_server_sdk/models/payment_token_response_payment_source.rb', line 59 def initialize(card: SKIP, paypal: SKIP, venmo: SKIP, apple_pay: SKIP, bank: SKIP) @card = card unless card == SKIP @paypal = paypal unless paypal == SKIP @venmo = venmo unless venmo == SKIP @apple_pay = apple_pay unless apple_pay == SKIP @bank = bank unless bank == SKIP end |
Instance Attribute Details
#apple_pay ⇒ ApplePayPaymentToken
A resource representing a response for Apple Pay.
26 27 28 |
# File 'lib/paypal_server_sdk/models/payment_token_response_payment_source.rb', line 26 def apple_pay @apple_pay end |
#bank ⇒ Hash
Full representation of a Bank Payment Token.
30 31 32 |
# File 'lib/paypal_server_sdk/models/payment_token_response_payment_source.rb', line 30 def bank @bank end |
#card ⇒ CardPaymentToken
Full representation of a Card Payment Token including network token.
14 15 16 |
# File 'lib/paypal_server_sdk/models/payment_token_response_payment_source.rb', line 14 def card @card end |
#paypal ⇒ PaypalPaymentToken
Full representation of a Card Payment Token including network token.
18 19 20 |
# File 'lib/paypal_server_sdk/models/payment_token_response_payment_source.rb', line 18 def paypal @paypal end |
#venmo ⇒ VenmoPaymentToken
Full representation of a Card Payment Token including network token.
22 23 24 |
# File 'lib/paypal_server_sdk/models/payment_token_response_payment_source.rb', line 22 def venmo @venmo end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/paypal_server_sdk/models/payment_token_response_payment_source.rb', line 69 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. card = CardPaymentToken.from_hash(hash['card']) if hash['card'] paypal = PaypalPaymentToken.from_hash(hash['paypal']) if hash['paypal'] venmo = VenmoPaymentToken.from_hash(hash['venmo']) if hash['venmo'] apple_pay = ApplePayPaymentToken.from_hash(hash['apple_pay']) if hash['apple_pay'] bank = hash.key?('bank') ? hash['bank'] : SKIP # Create object from extracted values. PaymentTokenResponsePaymentSource.new(card: card, paypal: paypal, venmo: venmo, apple_pay: apple_pay, bank: bank) end |
.names ⇒ Object
A mapping from model property names to API property names.
33 34 35 36 37 38 39 40 41 |
# File 'lib/paypal_server_sdk/models/payment_token_response_payment_source.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['card'] = 'card' @_hash['paypal'] = 'paypal' @_hash['venmo'] = 'venmo' @_hash['apple_pay'] = 'apple_pay' @_hash['bank'] = 'bank' @_hash end |
.nullables ⇒ Object
An array for nullable fields
55 56 57 |
# File 'lib/paypal_server_sdk/models/payment_token_response_payment_source.rb', line 55 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
44 45 46 47 48 49 50 51 52 |
# File 'lib/paypal_server_sdk/models/payment_token_response_payment_source.rb', line 44 def self.optionals %w[ card paypal venmo apple_pay bank ] end |