class Ingenico::Connect::SDK::Domain::Token::CustomerToken

@attr [Ingenico::Connect::SDK::Domain::Definitions::Address] billing_address @attr [Ingenico::Connect::SDK::Domain::Token::PersonalInformationToken] personal_information

Attributes

billing_address[RW]
personal_information[RW]

Public Instance Methods

from_hash(hash) click to toggle source
# File lib/ingenico/connect/sdk/domain/token/customer_token.rb, line 29
def from_hash(hash)
  super
  if hash.has_key? 'billingAddress'
    raise TypeError, "value '%s' is not a Hash" % [hash['billingAddress']] unless hash['billingAddress'].is_a? Hash
    @billing_address = Ingenico::Connect::SDK::Domain::Definitions::Address.new_from_hash(hash['billingAddress'])
  end
  if hash.has_key? 'personalInformation'
    raise TypeError, "value '%s' is not a Hash" % [hash['personalInformation']] unless hash['personalInformation'].is_a? Hash
    @personal_information = Ingenico::Connect::SDK::Domain::Token::PersonalInformationToken.new_from_hash(hash['personalInformation'])
  end
end
to_h() click to toggle source

@return (Hash)

# File lib/ingenico/connect/sdk/domain/token/customer_token.rb, line 22
def to_h
  hash = super
  hash['billingAddress'] = @billing_address.to_h unless @billing_address.nil?
  hash['personalInformation'] = @personal_information.to_h unless @personal_information.nil?
  hash
end