class Ingenico::Connect::SDK::Domain::Payment::ApprovePaymentRequest

@attr [Integer] amount @attr [Ingenico::Connect::SDK::Domain::Payment::ApprovePaymentNonSepaDirectDebitPaymentMethodSpecificInput] direct_debit_payment_method_specific_input @attr [Ingenico::Connect::SDK::Domain::Payment::OrderApprovePayment] order @attr [Ingenico::Connect::SDK::Domain::Payment::ApprovePaymentSepaDirectDebitPaymentMethodSpecificInput] sepa_direct_debit_payment_method_specific_input

Attributes

amount[RW]
direct_debit_payment_method_specific_input[RW]
order[RW]
sepa_direct_debit_payment_method_specific_input[RW]

Public Instance Methods

from_hash(hash) click to toggle source
# File lib/ingenico/connect/sdk/domain/payment/approve_payment_request.rb, line 38
def from_hash(hash)
  super
  if hash.has_key? 'amount'
    @amount = hash['amount']
  end
  if hash.has_key? 'directDebitPaymentMethodSpecificInput'
    raise TypeError, "value '%s' is not a Hash" % [hash['directDebitPaymentMethodSpecificInput']] unless hash['directDebitPaymentMethodSpecificInput'].is_a? Hash
    @direct_debit_payment_method_specific_input = Ingenico::Connect::SDK::Domain::Payment::ApprovePaymentNonSepaDirectDebitPaymentMethodSpecificInput.new_from_hash(hash['directDebitPaymentMethodSpecificInput'])
  end
  if hash.has_key? 'order'
    raise TypeError, "value '%s' is not a Hash" % [hash['order']] unless hash['order'].is_a? Hash
    @order = Ingenico::Connect::SDK::Domain::Payment::OrderApprovePayment.new_from_hash(hash['order'])
  end
  if hash.has_key? 'sepaDirectDebitPaymentMethodSpecificInput'
    raise TypeError, "value '%s' is not a Hash" % [hash['sepaDirectDebitPaymentMethodSpecificInput']] unless hash['sepaDirectDebitPaymentMethodSpecificInput'].is_a? Hash
    @sepa_direct_debit_payment_method_specific_input = Ingenico::Connect::SDK::Domain::Payment::ApprovePaymentSepaDirectDebitPaymentMethodSpecificInput.new_from_hash(hash['sepaDirectDebitPaymentMethodSpecificInput'])
  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/payment/approve_payment_request.rb, line 29
def to_h
  hash = super
  hash['amount'] = @amount unless @amount.nil?
  hash['directDebitPaymentMethodSpecificInput'] = @direct_debit_payment_method_specific_input.to_h unless @direct_debit_payment_method_specific_input.nil?
  hash['order'] = @order.to_h unless @order.nil?
  hash['sepaDirectDebitPaymentMethodSpecificInput'] = @sepa_direct_debit_payment_method_specific_input.to_h unless @sepa_direct_debit_payment_method_specific_input.nil?
  hash
end