Class: OnlinePayments::SDK::Domain::TokenEWallet

Inherits:
DataObject
  • Object
show all
Defined in:
lib/onlinepayments/sdk/domain/token_e_wallet.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#aliasObject

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

#customerOnlinePayments::SDK::Domain::CustomerToken

Returns the current value of customer.

Returns:



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_hHash

Returns:

  • (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