Class: Worldline::Connect::SDK::V1::Domain::ApprovePaymentRequest

Inherits:
Domain::DataObject show all
Defined in:
lib/worldline/connect/sdk/v1/domain/approve_payment_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::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/worldline/connect/sdk/v1/domain/approve_payment_request.rb', line 19

def amount
  @amount
end

#direct_debit_payment_method_specific_inputWorldline::Connect::SDK::V1::Domain::ApprovePaymentNonSepaDirectDebitPaymentMethodSpecificInput

Returns the current value of direct_debit_payment_method_specific_input.

Returns:



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

def direct_debit_payment_method_specific_input
  @direct_debit_payment_method_specific_input
end

#orderWorldline::Connect::SDK::V1::Domain::OrderApprovePayment

Returns the current value of order.

Returns:



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

def order
  @order
end

#sepa_direct_debit_payment_method_specific_inputWorldline::Connect::SDK::V1::Domain::ApprovePaymentSepaDirectDebitPaymentMethodSpecificInput

Returns the current value of sepa_direct_debit_payment_method_specific_input.

Returns:



19
20
21
# File 'lib/worldline/connect/sdk/v1/domain/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/worldline/connect/sdk/v1/domain/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 = Worldline::Connect::SDK::V1::Domain::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 = Worldline::Connect::SDK::V1::Domain::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 = Worldline::Connect::SDK::V1::Domain::ApprovePaymentSepaDirectDebitPaymentMethodSpecificInput.new_from_hash(hash['sepaDirectDebitPaymentMethodSpecificInput'])
  end
end

#to_hHash

Returns:

  • (Hash)


30
31
32
33
34
35
36
37
# File 'lib/worldline/connect/sdk/v1/domain/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