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
-
#apple_pay ⇒ VaultApplePayRequest
A resource representing a request to vault Apple Pay.
-
#bank ⇒ BankRequest
A Resource representing a request to vault a Bank used for ACH Debit.
-
#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 Venmo.
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, token: SKIP, bank: SKIP) ⇒ SetupTokenRequestPaymentSource
constructor
A new instance of SetupTokenRequestPaymentSource.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(card: SKIP, paypal: SKIP, venmo: SKIP, apple_pay: SKIP, token: SKIP, bank: SKIP) ⇒ SetupTokenRequestPaymentSource
Returns a new instance of SetupTokenRequestPaymentSource.
65 66 67 68 69 70 71 72 73 |
# File 'lib/paypal_server_sdk/models/setup_token_request_payment_source.rb', line 65 def initialize(card: SKIP, paypal: SKIP, venmo: SKIP, apple_pay: SKIP, token: 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 @token = token unless token == SKIP @bank = bank unless bank == SKIP end |
Instance Attribute Details
#apple_pay ⇒ VaultApplePayRequest
A resource representing a request to vault Apple Pay.
26 27 28 |
# File 'lib/paypal_server_sdk/models/setup_token_request_payment_source.rb', line 26 def apple_pay @apple_pay end |
#bank ⇒ BankRequest
A Resource representing a request to vault a Bank used for ACH Debit.
34 35 36 |
# File 'lib/paypal_server_sdk/models/setup_token_request_payment_source.rb', line 34 def bank @bank end |
#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.
30 31 32 |
# File 'lib/paypal_server_sdk/models/setup_token_request_payment_source.rb', line 30 def token @token end |
#venmo ⇒ VaultVenmoRequest
A resource representing a request to vault Venmo.
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.
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/paypal_server_sdk/models/setup_token_request_payment_source.rb', line 76 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'] apple_pay = VaultApplePayRequest.from_hash(hash['apple_pay']) if hash['apple_pay'] token = VaultTokenRequest.from_hash(hash['token']) if hash['token'] bank = BankRequest.from_hash(hash['bank']) if hash['bank'] # Create object from extracted values. SetupTokenRequestPaymentSource.new(card: card, paypal: paypal, venmo: venmo, apple_pay: apple_pay, token: token, bank: bank) end |
.names ⇒ Object
A mapping from model property names to API property names.
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/paypal_server_sdk/models/setup_token_request_payment_source.rb', line 37 def self.names @_hash = {} if @_hash.nil? @_hash['card'] = 'card' @_hash['paypal'] = 'paypal' @_hash['venmo'] = 'venmo' @_hash['apple_pay'] = 'apple_pay' @_hash['token'] = 'token' @_hash['bank'] = 'bank' @_hash end |
.nullables ⇒ Object
An array for nullable fields
61 62 63 |
# File 'lib/paypal_server_sdk/models/setup_token_request_payment_source.rb', line 61 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/paypal_server_sdk/models/setup_token_request_payment_source.rb', line 49 def self.optionals %w[ card paypal venmo apple_pay token bank ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
104 105 106 107 108 109 |
# File 'lib/paypal_server_sdk/models/setup_token_request_payment_source.rb', line 104 def inspect class_name = self.class.name.split('::').last "<#{class_name} card: #{@card.inspect}, paypal: #{@paypal.inspect}, venmo:"\ " #{@venmo.inspect}, apple_pay: #{@apple_pay.inspect}, token: #{@token.inspect}, bank:"\ " #{@bank.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
97 98 99 100 101 |
# File 'lib/paypal_server_sdk/models/setup_token_request_payment_source.rb', line 97 def to_s class_name = self.class.name.split('::').last "<#{class_name} card: #{@card}, paypal: #{@paypal}, venmo: #{@venmo}, apple_pay:"\ " #{@apple_pay}, token: #{@token}, bank: #{@bank}>" end |