Class: OnlinePayments::SDK::Domain::TokenEWallet
- Inherits:
-
DataObject
- Object
- DataObject
- OnlinePayments::SDK::Domain::TokenEWallet
- Defined in:
- lib/onlinepayments/sdk/domain/token_e_wallet.rb
Instance Attribute Summary collapse
-
#alias ⇒ Object
deprecated
Deprecated.
This field is not used by any payment product An alias for the token. This can be used to visually represent the token.
-
#customer ⇒ OnlinePayments::SDK::Domain::CustomerToken
The current value of customer.
Instance Method Summary collapse
Methods inherited from DataObject
Instance Attribute Details
#alias ⇒ Object
Deprecated.
This field is not used by any payment product An alias for the token. This can be used to visually represent the token.
12 13 14 |
# File 'lib/onlinepayments/sdk/domain/token_e_wallet.rb', line 12 def alias @alias end |
#customer ⇒ OnlinePayments::SDK::Domain::CustomerToken
Returns the current value of customer.
12 13 14 |
# File 'lib/onlinepayments/sdk/domain/token_e_wallet.rb', line 12 def customer @customer end |
Instance Method Details
#from_hash(hash) ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/onlinepayments/sdk/domain/token_e_wallet.rb', line 27 def from_hash(hash) super if hash.has_key? 'alias' @alias = hash['alias'] end if hash.has_key? 'customer' raise TypeError, "value '%s' is not a Hash" % [hash['customer']] unless hash['customer'].is_a? Hash @customer = OnlinePayments::SDK::Domain::CustomerToken.new_from_hash(hash['customer']) end end |
#to_h ⇒ Hash
20 21 22 23 24 25 |
# File 'lib/onlinepayments/sdk/domain/token_e_wallet.rb', line 20 def to_h hash = super hash['alias'] = @alias unless @alias.nil? hash['customer'] = @customer.to_h unless @customer.nil? hash end |