Class: Ingenico::Direct::SDK::Domain::CreatedTokenResponse
- Inherits:
-
Ingenico::Direct::SDK::DataObject
- Object
- Ingenico::Direct::SDK::DataObject
- Ingenico::Direct::SDK::Domain::CreatedTokenResponse
- Defined in:
- lib/ingenico/direct/sdk/domain/created_token_response.rb
Instance Attribute Summary collapse
-
#card ⇒ Ingenico::Direct::SDK::Domain::CardWithoutCvv
The current value of card.
-
#external_token_linked ⇒ Ingenico::Direct::SDK::Domain::ExternalTokenLinked
The current value of external_token_linked.
-
#is_new_token ⇒ true/false
The current value of is_new_token.
-
#token ⇒ String
The current value of token.
-
#token_status ⇒ String
The current value of token_status.
Instance Method Summary collapse
Methods inherited from Ingenico::Direct::SDK::DataObject
Instance Attribute Details
#card ⇒ Ingenico::Direct::SDK::Domain::CardWithoutCvv
Returns the current value of card.
17 18 19 |
# File 'lib/ingenico/direct/sdk/domain/created_token_response.rb', line 17 def card @card end |
#external_token_linked ⇒ Ingenico::Direct::SDK::Domain::ExternalTokenLinked
Returns the current value of external_token_linked.
17 18 19 |
# File 'lib/ingenico/direct/sdk/domain/created_token_response.rb', line 17 def external_token_linked @external_token_linked end |
#is_new_token ⇒ true/false
Returns the current value of is_new_token.
17 18 19 |
# File 'lib/ingenico/direct/sdk/domain/created_token_response.rb', line 17 def is_new_token @is_new_token end |
#token ⇒ String
Returns the current value of token.
17 18 19 |
# File 'lib/ingenico/direct/sdk/domain/created_token_response.rb', line 17 def token @token end |
#token_status ⇒ String
Returns the current value of token_status.
17 18 19 |
# File 'lib/ingenico/direct/sdk/domain/created_token_response.rb', line 17 def token_status @token_status end |
Instance Method Details
#from_hash(hash) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/ingenico/direct/sdk/domain/created_token_response.rb', line 35 def from_hash(hash) super if hash.key? 'card' raise TypeError, "value '%s' is not a Hash" % [hash['card']] unless hash['card'].is_a? Hash @card = Ingenico::Direct::SDK::Domain::CardWithoutCvv.new_from_hash(hash['card']) end if hash.key? 'externalTokenLinked' raise TypeError, "value '%s' is not a Hash" % [hash['externalTokenLinked']] unless hash['externalTokenLinked'].is_a? Hash @external_token_linked = Ingenico::Direct::SDK::Domain::ExternalTokenLinked.new_from_hash(hash['externalTokenLinked']) end @is_new_token = hash['isNewToken'] if hash.key? 'isNewToken' @token = hash['token'] if hash.key? 'token' @token_status = hash['tokenStatus'] if hash.key? 'tokenStatus' end |
#to_h ⇒ Hash
25 26 27 28 29 30 31 32 33 |
# File 'lib/ingenico/direct/sdk/domain/created_token_response.rb', line 25 def to_h hash = super hash['card'] = @card.to_h if @card hash['externalTokenLinked'] = @external_token_linked.to_h if @external_token_linked hash['isNewToken'] = @is_new_token unless @is_new_token.nil? hash['token'] = @token unless @token.nil? hash['tokenStatus'] = @token_status unless @token_status.nil? hash end |