class Ingenico::Connect::SDK::Domain::Services::PaymentContext
@attr [Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney] amount_of_money
@attr [String] country_code
@attr [true/false] is_installments
@attr [true/false] is_recurring
Attributes
amount_of_money[RW]
country_code[RW]
is_installments[RW]
is_recurring[RW]
Public Instance Methods
from_hash(hash)
click to toggle source
Calls superclass method
Ingenico::Connect::SDK::DataObject#from_hash
# File lib/ingenico/connect/sdk/domain/services/payment_context.rb, line 36 def from_hash(hash) super if hash.has_key? 'amountOfMoney' raise TypeError, "value '%s' is not a Hash" % [hash['amountOfMoney']] unless hash['amountOfMoney'].is_a? Hash @amount_of_money = Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney.new_from_hash(hash['amountOfMoney']) end if hash.has_key? 'countryCode' @country_code = hash['countryCode'] end if hash.has_key? 'isInstallments' @is_installments = hash['isInstallments'] end if hash.has_key? 'isRecurring' @is_recurring = hash['isRecurring'] 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/services/payment_context.rb, line 27 def to_h hash = super hash['amountOfMoney'] = @amount_of_money.to_h unless @amount_of_money.nil? hash['countryCode'] = @country_code unless @country_code.nil? hash['isInstallments'] = @is_installments unless @is_installments.nil? hash['isRecurring'] = @is_recurring unless @is_recurring.nil? hash end