Class: Ingenico::Connect::SDK::Domain::Payment::ApprovePaymentRequest

Inherits:
Ingenico::Connect::SDK::DataObject show all
Defined in:
lib/ingenico/connect/sdk/domain/payment/approve_payment_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ingenico::Connect::SDK::DataObject

new_from_hash

Instance Attribute Details

#amountInteger

Returns the current value of amount.

Returns:

  • (Integer)

    the current value of amount



19
20
21
# File 'lib/ingenico/connect/sdk/domain/payment/approve_payment_request.rb', line 19

def amount
  @amount
end

#direct_debit_payment_method_specific_inputIngenico::Connect::SDK::Domain::Payment::ApprovePaymentNonSepaDirectDebitPaymentMethodSpecificInput

Returns the current value of direct_debit_payment_method_specific_input.

Returns:



19
20
21
# File 'lib/ingenico/connect/sdk/domain/payment/approve_payment_request.rb', line 19

def direct_debit_payment_method_specific_input
  @direct_debit_payment_method_specific_input
end

#orderIngenico::Connect::SDK::Domain::Payment::OrderApprovePayment

Returns the current value of order.

Returns:



19
20
21
# File 'lib/ingenico/connect/sdk/domain/payment/approve_payment_request.rb', line 19

def order
  @order
end

#sepa_direct_debit_payment_method_specific_inputIngenico::Connect::SDK::Domain::Payment::ApprovePaymentSepaDirectDebitPaymentMethodSpecificInput

Returns the current value of sepa_direct_debit_payment_method_specific_input.

Returns:



19
20
21
# File 'lib/ingenico/connect/sdk/domain/payment/approve_payment_request.rb', line 19

def sepa_direct_debit_payment_method_specific_input
  @sepa_direct_debit_payment_method_specific_input
end

Instance Method Details

#from_hash(hash) ⇒ Object



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/ingenico/connect/sdk/domain/payment/approve_payment_request.rb', line 39

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_hHash

Returns:

  • (Hash)


30
31
32
33
34
35
36
37
# File 'lib/ingenico/connect/sdk/domain/payment/approve_payment_request.rb', line 30

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