class Ingenico::Connect::SDK::Domain::Token::TokenResponse

@attr [Ingenico::Connect::SDK::Domain::Token::TokenCard] card @attr [Ingenico::Connect::SDK::Domain::Token::TokenEWallet] e_wallet @attr [String] id @attr [Ingenico::Connect::SDK::Domain::Token::TokenNonSepaDirectDebit] non_sepa_direct_debit @attr [String] original_payment_id @attr [Integer] payment_product_id @attr [Ingenico::Connect::SDK::Domain::Token::TokenSepaDirectDebit] sepa_direct_debit

Attributes

card[RW]
e_wallet[RW]
id[RW]
non_sepa_direct_debit[RW]
original_payment_id[RW]
payment_product_id[RW]
sepa_direct_debit[RW]

Public Instance Methods

from_hash(hash) click to toggle source
# File lib/ingenico/connect/sdk/domain/token/token_response.rb, line 51
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 = Ingenico::Connect::SDK::Domain::Token::TokenCard.new_from_hash(hash['card'])
  end
  if hash.has_key? 'eWallet'
    raise TypeError, "value '%s' is not a Hash" % [hash['eWallet']] unless hash['eWallet'].is_a? Hash
    @e_wallet = Ingenico::Connect::SDK::Domain::Token::TokenEWallet.new_from_hash(hash['eWallet'])
  end
  if hash.has_key? 'id'
    @id = hash['id']
  end
  if hash.has_key? 'nonSepaDirectDebit'
    raise TypeError, "value '%s' is not a Hash" % [hash['nonSepaDirectDebit']] unless hash['nonSepaDirectDebit'].is_a? Hash
    @non_sepa_direct_debit = Ingenico::Connect::SDK::Domain::Token::TokenNonSepaDirectDebit.new_from_hash(hash['nonSepaDirectDebit'])
  end
  if hash.has_key? 'originalPaymentId'
    @original_payment_id = hash['originalPaymentId']
  end
  if hash.has_key? 'paymentProductId'
    @payment_product_id = hash['paymentProductId']
  end
  if hash.has_key? 'sepaDirectDebit'
    raise TypeError, "value '%s' is not a Hash" % [hash['sepaDirectDebit']] unless hash['sepaDirectDebit'].is_a? Hash
    @sepa_direct_debit = Ingenico::Connect::SDK::Domain::Token::TokenSepaDirectDebit.new_from_hash(hash['sepaDirectDebit'])
  end
end
to_h() click to toggle source

@return (Hash)

Calls superclass method Ingenico::Connect::SDK::DataObject#to_h
# File lib/ingenico/connect/sdk/domain/token/token_response.rb, line 39
def to_h
  hash = super
  hash['card'] = @card.to_h unless @card.nil?
  hash['eWallet'] = @e_wallet.to_h unless @e_wallet.nil?
  hash['id'] = @id unless @id.nil?
  hash['nonSepaDirectDebit'] = @non_sepa_direct_debit.to_h unless @non_sepa_direct_debit.nil?
  hash['originalPaymentId'] = @original_payment_id unless @original_payment_id.nil?
  hash['paymentProductId'] = @payment_product_id unless @payment_product_id.nil?
  hash['sepaDirectDebit'] = @sepa_direct_debit.to_h unless @sepa_direct_debit.nil?
  hash
end