Class: OnlinePayments::SDK::Domain::CreatedTokenResponse
- Inherits:
-
DataObject
- Object
- DataObject
- OnlinePayments::SDK::Domain::CreatedTokenResponse
- Defined in:
- lib/onlinepayments/sdk/domain/created_token_response.rb
Instance Attribute Summary collapse
-
#card ⇒ OnlinePayments::SDK::Domain::CardWithoutCvv
The current value of card.
-
#external_token_linked ⇒ OnlinePayments::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 DataObject
Instance Attribute Details
#card ⇒ OnlinePayments::SDK::Domain::CardWithoutCvv
Returns the current value of card.
16 17 18 |
# File 'lib/onlinepayments/sdk/domain/created_token_response.rb', line 16 def card @card end |
#external_token_linked ⇒ OnlinePayments::SDK::Domain::ExternalTokenLinked
Returns the current value of external_token_linked.
16 17 18 |
# File 'lib/onlinepayments/sdk/domain/created_token_response.rb', line 16 def external_token_linked @external_token_linked end |
#is_new_token ⇒ true/false
Returns the current value of is_new_token.
16 17 18 |
# File 'lib/onlinepayments/sdk/domain/created_token_response.rb', line 16 def is_new_token @is_new_token end |
#token ⇒ String
Returns the current value of token.
16 17 18 |
# File 'lib/onlinepayments/sdk/domain/created_token_response.rb', line 16 def token @token end |
#token_status ⇒ String
Returns the current value of token_status.
16 17 18 |
# File 'lib/onlinepayments/sdk/domain/created_token_response.rb', line 16 def token_status @token_status end |
Instance Method Details
#from_hash(hash) ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/onlinepayments/sdk/domain/created_token_response.rb', line 39 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::CardWithoutCvv.new_from_hash(hash['card']) 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? 'isNewToken' @is_new_token = hash['isNewToken'] end if hash.has_key? 'token' @token = hash['token'] end if hash.has_key? 'tokenStatus' @token_status = hash['tokenStatus'] end end |
#to_h ⇒ Hash
29 30 31 32 33 34 35 36 37 |
# File 'lib/onlinepayments/sdk/domain/created_token_response.rb', line 29 def to_h hash = super hash['card'] = @card.to_h unless @card.nil? hash['externalTokenLinked'] = @external_token_linked.to_h unless @external_token_linked.nil? 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 |