Class: Ingenico::Connect::SDK::Domain::Payment::CompletePaymentRequest

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

new_from_hash

Instance Attribute Details

#card_payment_method_specific_inputIngenico::Connect::SDK::Domain::Payment::CompletePaymentCardPaymentMethodSpecificInput

Returns the current value of card_payment_method_specific_input.

Returns:



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

def card_payment_method_specific_input
  @card_payment_method_specific_input
end

#merchantIngenico::Connect::SDK::Domain::Payment::Merchant

Returns the current value of merchant.

Returns:



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

def merchant
  @merchant
end

#orderIngenico::Connect::SDK::Domain::Payment::Order

Returns the current value of order.

Returns:



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

def order
  @order
end

Instance Method Details

#from_hash(hash) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/ingenico/connect/sdk/domain/payment/complete_payment_request.rb', line 35

def from_hash(hash)
  super
  if hash.has_key? 'cardPaymentMethodSpecificInput'
    raise TypeError, "value '%s' is not a Hash" % [hash['cardPaymentMethodSpecificInput']] unless hash['cardPaymentMethodSpecificInput'].is_a? Hash
    @card_payment_method_specific_input = Ingenico::Connect::SDK::Domain::Payment::CompletePaymentCardPaymentMethodSpecificInput.new_from_hash(hash['cardPaymentMethodSpecificInput'])
  end
  if hash.has_key? 'merchant'
    raise TypeError, "value '%s' is not a Hash" % [hash['merchant']] unless hash['merchant'].is_a? Hash
    @merchant = Ingenico::Connect::SDK::Domain::Payment::Merchant.new_from_hash(hash['merchant'])
  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::Order.new_from_hash(hash['order'])
  end
end

#to_hHash

Returns:

  • (Hash)


27
28
29
30
31
32
33
# File 'lib/ingenico/connect/sdk/domain/payment/complete_payment_request.rb', line 27

def to_h
  hash = super
  hash['cardPaymentMethodSpecificInput'] = @card_payment_method_specific_input.to_h unless @card_payment_method_specific_input.nil?
  hash['merchant'] = @merchant.to_h unless @merchant.nil?
  hash['order'] = @order.to_h unless @order.nil?
  hash
end