class Ingenico::Direct::SDK::Domain::PaymentContext

@attr [Ingenico::Direct::SDK::Domain::AmountOfMoney] amount_of_money @attr [String] country_code @attr [true/false] is_recurring

Attributes

amount_of_money[RW]
country_code[RW]
is_recurring[RW]

Public Instance Methods

from_hash(hash) click to toggle source
# File lib/ingenico/direct/sdk/domain/payment_context.rb, line 28
def from_hash(hash)
  super
  if hash.key? 'amountOfMoney'
    raise TypeError, "value '%s' is not a Hash" % [hash['amountOfMoney']] unless hash['amountOfMoney'].is_a? Hash
    @amount_of_money = Ingenico::Direct::SDK::Domain::AmountOfMoney.new_from_hash(hash['amountOfMoney'])
  end
  @country_code = hash['countryCode'] if hash.key? 'countryCode'
  @is_recurring = hash['isRecurring'] if hash.key? 'isRecurring'
end
to_h() click to toggle source

@return (Hash)

Calls superclass method Ingenico::Direct::SDK::DataObject#to_h
# File lib/ingenico/direct/sdk/domain/payment_context.rb, line 20
def to_h
  hash = super
  hash['amountOfMoney'] = @amount_of_money.to_h if @amount_of_money
  hash['countryCode'] = @country_code unless @country_code.nil?
  hash['isRecurring'] = @is_recurring unless @is_recurring.nil?
  hash
end