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
Full representation of a PayPal Payment Token.
-
#venmo ⇒ VenmoPaymentToken
Full representation of a Venmo Payment 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) ⇒ SetupTokenResponsePaymentSource
constructor
A new instance of SetupTokenResponsePaymentSource.
-
#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) ⇒ 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
Full representation of a PayPal Payment Token.
18 19 20 |
# File 'lib/paypal_server_sdk/models/setup_token_response_payment_source.rb', line 18 def paypal @paypal end |
#venmo ⇒ VenmoPaymentToken
Full representation of a Venmo Payment Token.
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 |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
75 76 77 78 79 |
# File 'lib/paypal_server_sdk/models/setup_token_response_payment_source.rb', line 75 def inspect class_name = self.class.name.split('::').last "<#{class_name} card: #{@card.inspect}, paypal: #{@paypal.inspect}, venmo:"\ " #{@venmo.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
69 70 71 72 |
# File 'lib/paypal_server_sdk/models/setup_token_response_payment_source.rb', line 69 def to_s class_name = self.class.name.split('::').last "<#{class_name} card: #{@card}, paypal: #{@paypal}, venmo: #{@venmo}>" end |