Class: Ingenico::Connect::SDK::Domain::Payment::PaymentApprovalResponse

Inherits:
Ingenico::Connect::SDK::DataObject show all
Defined in:
lib/ingenico/connect/sdk/domain/payment/payment_approval_response.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_outputObject



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

def card_payment_method_specific_output
  @card_payment_method_specific_output
end

#mobile_payment_method_specific_outputObject



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

def mobile_payment_method_specific_output
  @mobile_payment_method_specific_output
end

#paymentObject



23
24
25
# File 'lib/ingenico/connect/sdk/domain/payment/payment_approval_response.rb', line 23

def payment
  @payment
end

#payment_method_specific_outputObject

ApprovePaymentCardPaymentMethodSpecificOutput

Deprecated; Use cardPaymentMethodSpecificOutput instead



28
29
30
# File 'lib/ingenico/connect/sdk/domain/payment/payment_approval_response.rb', line 28

def payment_method_specific_output
  @payment_method_specific_output
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
57
58
59
60
61
62
63
64
65
# File 'lib/ingenico/connect/sdk/domain/payment/payment_approval_response.rb', line 39

def from_hash(hash)
  super
  if hash.has_key?('cardPaymentMethodSpecificOutput')
    if !(hash['cardPaymentMethodSpecificOutput'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['cardPaymentMethodSpecificOutput']]
    end
    @card_payment_method_specific_output = Ingenico::Connect::SDK::Domain::Payment::ApprovePaymentCardPaymentMethodSpecificOutput.new_from_hash(hash['cardPaymentMethodSpecificOutput'])
  end
  if hash.has_key?('mobilePaymentMethodSpecificOutput')
    if !(hash['mobilePaymentMethodSpecificOutput'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['mobilePaymentMethodSpecificOutput']]
    end
    @mobile_payment_method_specific_output = Ingenico::Connect::SDK::Domain::Payment::ApprovePaymentMobilePaymentMethodSpecificOutput.new_from_hash(hash['mobilePaymentMethodSpecificOutput'])
  end
  if hash.has_key?('payment')
    if !(hash['payment'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['payment']]
    end
    @payment = Ingenico::Connect::SDK::Domain::Payment::Payment.new_from_hash(hash['payment'])
  end
  if hash.has_key?('paymentMethodSpecificOutput')
    if !(hash['paymentMethodSpecificOutput'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['paymentMethodSpecificOutput']]
    end
    @payment_method_specific_output = Ingenico::Connect::SDK::Domain::Payment::ApprovePaymentCardPaymentMethodSpecificOutput.new_from_hash(hash['paymentMethodSpecificOutput'])
  end
end

#to_hObject



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

def to_h
  hash = super
  add_to_hash(hash, 'cardPaymentMethodSpecificOutput', @card_payment_method_specific_output)
  add_to_hash(hash, 'mobilePaymentMethodSpecificOutput', @mobile_payment_method_specific_output)
  add_to_hash(hash, 'payment', @payment)
  add_to_hash(hash, 'paymentMethodSpecificOutput', @payment_method_specific_output)
  hash
end