Class: PaypalServerSdk::SetupTokenResponsePaymentSource
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::SetupTokenResponsePaymentSource
- Defined in:
- lib/paypal_server_sdk/models/setup_token_response_payment_source.rb
Overview
The setup payment method details.
Instance Attribute Summary collapse
-
#card ⇒ SetupTokenResponseCard
TODO: Write general description for this method.
-
#paypal ⇒ PaypalPaymentToken
TODO: Write general description for this method.
-
#venmo ⇒ VenmoPaymentToken
TODO: Write general description for this method.
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) ⇒ SetupTokenResponsePaymentSource
constructor
A new instance of SetupTokenResponsePaymentSource.
Methods inherited from BaseModel
Constructor Details
#initialize(card: SKIP, paypal: SKIP, venmo: SKIP) ⇒ SetupTokenResponsePaymentSource
Returns a new instance of SetupTokenResponsePaymentSource.
47 48 49 50 51 |
# File 'lib/paypal_server_sdk/models/setup_token_response_payment_source.rb', line 47 def initialize(card: SKIP, paypal: SKIP, venmo: SKIP) @card = card unless card == SKIP @paypal = paypal unless paypal == SKIP @venmo = venmo unless venmo == SKIP end |
Instance Attribute Details
#card ⇒ SetupTokenResponseCard
TODO: Write general description for this method
14 15 16 |
# File 'lib/paypal_server_sdk/models/setup_token_response_payment_source.rb', line 14 def card @card end |
#paypal ⇒ PaypalPaymentToken
TODO: Write general description for this method
18 19 20 |
# File 'lib/paypal_server_sdk/models/setup_token_response_payment_source.rb', line 18 def paypal @paypal end |
#venmo ⇒ VenmoPaymentToken
TODO: Write general description for this method
22 23 24 |
# File 'lib/paypal_server_sdk/models/setup_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.
54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/paypal_server_sdk/models/setup_token_response_payment_source.rb', line 54 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. card = SetupTokenResponseCard.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'] # Create object from extracted values. SetupTokenResponsePaymentSource.new(card: card, paypal: paypal, venmo: venmo) end |
.names ⇒ Object
A mapping from model property names to API property names.
25 26 27 28 29 30 31 |
# File 'lib/paypal_server_sdk/models/setup_token_response_payment_source.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['card'] = 'card' @_hash['paypal'] = 'paypal' @_hash['venmo'] = 'venmo' @_hash end |
.nullables ⇒ Object
An array for nullable fields
43 44 45 |
# File 'lib/paypal_server_sdk/models/setup_token_response_payment_source.rb', line 43 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
34 35 36 37 38 39 40 |
# File 'lib/paypal_server_sdk/models/setup_token_response_payment_source.rb', line 34 def self.optionals %w[ card paypal venmo ] end |