Class: Ingenico::Connect::SDK::Domain::Token::TokenResponse
- Inherits:
-
Ingenico::Connect::SDK::DataObject
- Object
- Ingenico::Connect::SDK::DataObject
- Ingenico::Connect::SDK::Domain::Token::TokenResponse
- Defined in:
- lib/ingenico/connect/sdk/domain/token/token_response.rb
Overview
Class TokenResponse
Instance Attribute Summary collapse
- #card ⇒ Object
- #e_wallet ⇒ Object
-
#id ⇒ Object
String.
- #non_sepa_direct_debit ⇒ Object
-
#payment_product_id ⇒ Object
Integer.
- #sepa_direct_debit ⇒ Object
Instance Method Summary collapse
Methods inherited from Ingenico::Connect::SDK::DataObject
Instance Attribute Details
#card ⇒ Object
19 20 21 |
# File 'lib/ingenico/connect/sdk/domain/token/token_response.rb', line 19 def card @card end |
#e_wallet ⇒ Object
22 23 24 |
# File 'lib/ingenico/connect/sdk/domain/token/token_response.rb', line 22 def e_wallet @e_wallet end |
#id ⇒ Object
String
25 26 27 |
# File 'lib/ingenico/connect/sdk/domain/token/token_response.rb', line 25 def id @id end |
#non_sepa_direct_debit ⇒ Object
28 29 30 |
# File 'lib/ingenico/connect/sdk/domain/token/token_response.rb', line 28 def non_sepa_direct_debit @non_sepa_direct_debit end |
#payment_product_id ⇒ Object
Integer
31 32 33 |
# File 'lib/ingenico/connect/sdk/domain/token/token_response.rb', line 31 def payment_product_id @payment_product_id end |
#sepa_direct_debit ⇒ Object
34 35 36 |
# File 'lib/ingenico/connect/sdk/domain/token/token_response.rb', line 34 def sepa_direct_debit @sepa_direct_debit end |
Instance Method Details
#from_hash(hash) ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/ingenico/connect/sdk/domain/token/token_response.rb', line 47 def from_hash(hash) super if hash.has_key?('card') if !(hash['card'].is_a? Hash) raise TypeError, "value '%s' is not a Hash" % [hash['card']] end @card = Ingenico::Connect::SDK::Domain::Token::TokenCard.new_from_hash(hash['card']) end if hash.has_key?('eWallet') if !(hash['eWallet'].is_a? Hash) raise TypeError, "value '%s' is not a Hash" % [hash['eWallet']] end @e_wallet = Ingenico::Connect::SDK::Domain::Token::TokenEWallet.new_from_hash(hash['eWallet']) end if hash.has_key?('id') @id = hash['id'] end if hash.has_key?('nonSepaDirectDebit') if !(hash['nonSepaDirectDebit'].is_a? Hash) raise TypeError, "value '%s' is not a Hash" % [hash['nonSepaDirectDebit']] end @non_sepa_direct_debit = Ingenico::Connect::SDK::Domain::Token::TokenNonSepaDirectDebit.new_from_hash(hash['nonSepaDirectDebit']) end if hash.has_key?('paymentProductId') @payment_product_id = hash['paymentProductId'] end if hash.has_key?('sepaDirectDebit') if !(hash['sepaDirectDebit'].is_a? Hash) raise TypeError, "value '%s' is not a Hash" % [hash['sepaDirectDebit']] end @sepa_direct_debit = Ingenico::Connect::SDK::Domain::Token::TokenSepaDirectDebit.new_from_hash(hash['sepaDirectDebit']) end end |
#to_h ⇒ Object
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/ingenico/connect/sdk/domain/token/token_response.rb', line 36 def to_h hash = super add_to_hash(hash, 'card', @card) add_to_hash(hash, 'eWallet', @e_wallet) add_to_hash(hash, 'id', @id) add_to_hash(hash, 'nonSepaDirectDebit', @non_sepa_direct_debit) add_to_hash(hash, 'paymentProductId', @payment_product_id) add_to_hash(hash, 'sepaDirectDebit', @sepa_direct_debit) hash end |