Class: PaypalServerSdk::SetupTokenRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::SetupTokenRequest
- Defined in:
- lib/paypal_server_sdk/models/setup_token_request.rb
Overview
Setup Token Request where the ‘source` defines the type of instrument to be stored.
Instance Attribute Summary collapse
-
#customer ⇒ CustomerRequest
Customer in merchant’s or partner’s system of records.
-
#payment_source ⇒ SetupTokenRequestPaymentSource
The payment method to vault with the instrument details.
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(payment_source:, customer: SKIP) ⇒ SetupTokenRequest
constructor
A new instance of SetupTokenRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(payment_source:, customer: SKIP) ⇒ SetupTokenRequest
Returns a new instance of SetupTokenRequest.
41 42 43 44 |
# File 'lib/paypal_server_sdk/models/setup_token_request.rb', line 41 def initialize(payment_source:, customer: SKIP) @customer = customer unless customer == SKIP @payment_source = payment_source end |
Instance Attribute Details
#customer ⇒ CustomerRequest
Customer in merchant’s or partner’s system of records.
15 16 17 |
# File 'lib/paypal_server_sdk/models/setup_token_request.rb', line 15 def customer @customer end |
#payment_source ⇒ SetupTokenRequestPaymentSource
The payment method to vault with the instrument details.
19 20 21 |
# File 'lib/paypal_server_sdk/models/setup_token_request.rb', line 19 def payment_source @payment_source end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/paypal_server_sdk/models/setup_token_request.rb', line 47 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. payment_source = SetupTokenRequestPaymentSource.from_hash(hash['payment_source']) if hash['payment_source'] customer = CustomerRequest.from_hash(hash['customer']) if hash['customer'] # Create object from extracted values. SetupTokenRequest.new(payment_source: payment_source, customer: customer) end |
.names ⇒ Object
A mapping from model property names to API property names.
22 23 24 25 26 27 |
# File 'lib/paypal_server_sdk/models/setup_token_request.rb', line 22 def self.names @_hash = {} if @_hash.nil? @_hash['customer'] = 'customer' @_hash['payment_source'] = 'payment_source' @_hash end |
.nullables ⇒ Object
An array for nullable fields
37 38 39 |
# File 'lib/paypal_server_sdk/models/setup_token_request.rb', line 37 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
30 31 32 33 34 |
# File 'lib/paypal_server_sdk/models/setup_token_request.rb', line 30 def self.optionals %w[ customer ] end |