Class: PaypalServerSdk::SetupTokenRequestPaymentSource
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::SetupTokenRequestPaymentSource
- Defined in:
- lib/paypal_server_sdk/models/setup_token_request_payment_source.rb
Overview
The payment method to vault with the instrument details.
Instance Attribute Summary collapse
-
#card ⇒ SetupTokenRequestCard
A Resource representing a request to vault a Card.
-
#paypal ⇒ VaultPaypalWalletRequest
A resource representing a request to vault PayPal Wallet.
-
#token ⇒ VaultTokenRequest
The Tokenized Payment Source representing a Request to Vault a Token.
-
#venmo ⇒ VaultVenmoRequest
A resource representing a request to vault PayPal Wallet.
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, token: SKIP) ⇒ SetupTokenRequestPaymentSource
constructor
A new instance of SetupTokenRequestPaymentSource.
Methods inherited from BaseModel
Constructor Details
#initialize(card: SKIP, paypal: SKIP, venmo: SKIP, token: SKIP) ⇒ SetupTokenRequestPaymentSource
Returns a new instance of SetupTokenRequestPaymentSource.
53 54 55 56 57 58 |
# File 'lib/paypal_server_sdk/models/setup_token_request_payment_source.rb', line 53 def initialize(card: SKIP, paypal: SKIP, venmo: SKIP, token: SKIP) @card = card unless card == SKIP @paypal = paypal unless paypal == SKIP @venmo = venmo unless venmo == SKIP @token = token unless token == SKIP end |
Instance Attribute Details
#card ⇒ SetupTokenRequestCard
A Resource representing a request to vault a Card.
14 15 16 |
# File 'lib/paypal_server_sdk/models/setup_token_request_payment_source.rb', line 14 def card @card end |
#paypal ⇒ VaultPaypalWalletRequest
A resource representing a request to vault PayPal Wallet.
18 19 20 |
# File 'lib/paypal_server_sdk/models/setup_token_request_payment_source.rb', line 18 def paypal @paypal end |
#token ⇒ VaultTokenRequest
The Tokenized Payment Source representing a Request to Vault a Token.
26 27 28 |
# File 'lib/paypal_server_sdk/models/setup_token_request_payment_source.rb', line 26 def token @token end |
#venmo ⇒ VaultVenmoRequest
A resource representing a request to vault PayPal Wallet.
22 23 24 |
# File 'lib/paypal_server_sdk/models/setup_token_request_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.
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/paypal_server_sdk/models/setup_token_request_payment_source.rb', line 61 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. card = SetupTokenRequestCard.from_hash(hash['card']) if hash['card'] paypal = VaultPaypalWalletRequest.from_hash(hash['paypal']) if hash['paypal'] venmo = VaultVenmoRequest.from_hash(hash['venmo']) if hash['venmo'] token = VaultTokenRequest.from_hash(hash['token']) if hash['token'] # Create object from extracted values. SetupTokenRequestPaymentSource.new(card: card, paypal: paypal, venmo: venmo, token: token) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 34 35 36 |
# File 'lib/paypal_server_sdk/models/setup_token_request_payment_source.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['card'] = 'card' @_hash['paypal'] = 'paypal' @_hash['venmo'] = 'venmo' @_hash['token'] = 'token' @_hash end |
.nullables ⇒ Object
An array for nullable fields
49 50 51 |
# File 'lib/paypal_server_sdk/models/setup_token_request_payment_source.rb', line 49 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
39 40 41 42 43 44 45 46 |
# File 'lib/paypal_server_sdk/models/setup_token_request_payment_source.rb', line 39 def self.optionals %w[ card paypal venmo token ] end |