Class: OnlinePayments::SDK::Domain::TokenResponse
- Inherits:
-
DataObject
- Object
- DataObject
- OnlinePayments::SDK::Domain::TokenResponse
- Defined in:
- lib/onlinepayments/sdk/domain/token_response.rb
Instance Attribute Summary collapse
-
#card ⇒ OnlinePayments::SDK::Domain::TokenCard
The current value of card.
-
#crm_token ⇒ OnlinePayments::SDK::Domain::CrmToken
The current value of crm_token.
-
#e_wallet ⇒ OnlinePayments::SDK::Domain::TokenEWallet
The current value of e_wallet.
-
#external_token_linked ⇒ OnlinePayments::SDK::Domain::ExternalTokenLinked
The current value of external_token_linked.
-
#id ⇒ String
The current value of id.
-
#is_temporary ⇒ true/false
The current value of is_temporary.
-
#network_token_linked ⇒ OnlinePayments::SDK::Domain::NetworkTokenLinked
The current value of network_token_linked.
-
#payment_product_id ⇒ Integer
The current value of payment_product_id.
Instance Method Summary collapse
Methods inherited from DataObject
Instance Attribute Details
#card ⇒ OnlinePayments::SDK::Domain::TokenCard
Returns the current value of card.
22 23 24 |
# File 'lib/onlinepayments/sdk/domain/token_response.rb', line 22 def card @card end |
#crm_token ⇒ OnlinePayments::SDK::Domain::CrmToken
Returns the current value of crm_token.
22 23 24 |
# File 'lib/onlinepayments/sdk/domain/token_response.rb', line 22 def crm_token @crm_token end |
#e_wallet ⇒ OnlinePayments::SDK::Domain::TokenEWallet
Returns the current value of e_wallet.
22 23 24 |
# File 'lib/onlinepayments/sdk/domain/token_response.rb', line 22 def e_wallet @e_wallet end |
#external_token_linked ⇒ OnlinePayments::SDK::Domain::ExternalTokenLinked
Returns the current value of external_token_linked.
22 23 24 |
# File 'lib/onlinepayments/sdk/domain/token_response.rb', line 22 def external_token_linked @external_token_linked end |
#id ⇒ String
Returns the current value of id.
22 23 24 |
# File 'lib/onlinepayments/sdk/domain/token_response.rb', line 22 def id @id end |
#is_temporary ⇒ true/false
Returns the current value of is_temporary.
22 23 24 |
# File 'lib/onlinepayments/sdk/domain/token_response.rb', line 22 def is_temporary @is_temporary end |
#network_token_linked ⇒ OnlinePayments::SDK::Domain::NetworkTokenLinked
Returns the current value of network_token_linked.
22 23 24 |
# File 'lib/onlinepayments/sdk/domain/token_response.rb', line 22 def network_token_linked @network_token_linked end |
#payment_product_id ⇒ Integer
Returns the current value of payment_product_id.
22 23 24 |
# File 'lib/onlinepayments/sdk/domain/token_response.rb', line 22 def payment_product_id @payment_product_id end |
Instance Method Details
#from_hash(hash) ⇒ Object
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 80 81 82 83 84 85 |
# File 'lib/onlinepayments/sdk/domain/token_response.rb', line 54 def from_hash(hash) super if hash.has_key? 'card' raise TypeError, "value '%s' is not a Hash" % [hash['card']] unless hash['card'].is_a? Hash @card = OnlinePayments::SDK::Domain::TokenCard.new_from_hash(hash['card']) end if hash.has_key? 'crmToken' raise TypeError, "value '%s' is not a Hash" % [hash['crmToken']] unless hash['crmToken'].is_a? Hash @crm_token = OnlinePayments::SDK::Domain::CrmToken.new_from_hash(hash['crmToken']) end if hash.has_key? 'eWallet' raise TypeError, "value '%s' is not a Hash" % [hash['eWallet']] unless hash['eWallet'].is_a? Hash @e_wallet = OnlinePayments::SDK::Domain::TokenEWallet.new_from_hash(hash['eWallet']) end if hash.has_key? 'externalTokenLinked' raise TypeError, "value '%s' is not a Hash" % [hash['externalTokenLinked']] unless hash['externalTokenLinked'].is_a? Hash @external_token_linked = OnlinePayments::SDK::Domain::ExternalTokenLinked.new_from_hash(hash['externalTokenLinked']) end if hash.has_key? 'id' @id = hash['id'] end if hash.has_key? 'isTemporary' @is_temporary = hash['isTemporary'] end if hash.has_key? 'networkTokenLinked' raise TypeError, "value '%s' is not a Hash" % [hash['networkTokenLinked']] unless hash['networkTokenLinked'].is_a? Hash @network_token_linked = OnlinePayments::SDK::Domain::NetworkTokenLinked.new_from_hash(hash['networkTokenLinked']) end if hash.has_key? 'paymentProductId' @payment_product_id = hash['paymentProductId'] end end |
#to_h ⇒ Hash
41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/onlinepayments/sdk/domain/token_response.rb', line 41 def to_h hash = super hash['card'] = @card.to_h unless @card.nil? hash['crmToken'] = @crm_token.to_h unless @crm_token.nil? hash['eWallet'] = @e_wallet.to_h unless @e_wallet.nil? hash['externalTokenLinked'] = @external_token_linked.to_h unless @external_token_linked.nil? hash['id'] = @id unless @id.nil? hash['isTemporary'] = @is_temporary unless @is_temporary.nil? hash['networkTokenLinked'] = @network_token_linked.to_h unless @network_token_linked.nil? hash['paymentProductId'] = @payment_product_id unless @payment_product_id.nil? hash end |