Class: Ingenico::Connect::SDK::Domain::Hostedcheckout::CreateHostedCheckoutRequest

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

new_from_hash

Instance Attribute Details

#bank_transfer_payment_method_specific_inputObject



21
22
23
# File 'lib/ingenico/connect/sdk/domain/hostedcheckout/create_hosted_checkout_request.rb', line 21

def bank_transfer_payment_method_specific_input
  @bank_transfer_payment_method_specific_input
end

#card_payment_method_specific_inputObject



24
25
26
# File 'lib/ingenico/connect/sdk/domain/hostedcheckout/create_hosted_checkout_request.rb', line 24

def card_payment_method_specific_input
  @card_payment_method_specific_input
end

#cash_payment_method_specific_inputObject



27
28
29
# File 'lib/ingenico/connect/sdk/domain/hostedcheckout/create_hosted_checkout_request.rb', line 27

def cash_payment_method_specific_input
  @cash_payment_method_specific_input
end

#fraud_fieldsObject



30
31
32
# File 'lib/ingenico/connect/sdk/domain/hostedcheckout/create_hosted_checkout_request.rb', line 30

def fraud_fields
  @fraud_fields
end

#hosted_checkout_specific_inputObject



33
34
35
# File 'lib/ingenico/connect/sdk/domain/hostedcheckout/create_hosted_checkout_request.rb', line 33

def hosted_checkout_specific_input
  @hosted_checkout_specific_input
end

#orderObject



36
37
38
# File 'lib/ingenico/connect/sdk/domain/hostedcheckout/create_hosted_checkout_request.rb', line 36

def order
  @order
end

#redirect_payment_method_specific_inputObject



39
40
41
# File 'lib/ingenico/connect/sdk/domain/hostedcheckout/create_hosted_checkout_request.rb', line 39

def redirect_payment_method_specific_input
  @redirect_payment_method_specific_input
end

Instance Method Details

#from_hash(hash) ⇒ Object



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/ingenico/connect/sdk/domain/hostedcheckout/create_hosted_checkout_request.rb', line 53

def from_hash(hash)
  super
  if hash.has_key?('bankTransferPaymentMethodSpecificInput')
    if !(hash['bankTransferPaymentMethodSpecificInput'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['bankTransferPaymentMethodSpecificInput']]
    end
    @bank_transfer_payment_method_specific_input = Ingenico::Connect::SDK::Domain::Payment::BankTransferPaymentMethodSpecificInputBase.new_from_hash(hash['bankTransferPaymentMethodSpecificInput'])
  end
  if hash.has_key?('cardPaymentMethodSpecificInput')
    if !(hash['cardPaymentMethodSpecificInput'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['cardPaymentMethodSpecificInput']]
    end
    @card_payment_method_specific_input = Ingenico::Connect::SDK::Domain::Payment::CardPaymentMethodSpecificInputBase.new_from_hash(hash['cardPaymentMethodSpecificInput'])
  end
  if hash.has_key?('cashPaymentMethodSpecificInput')
    if !(hash['cashPaymentMethodSpecificInput'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['cashPaymentMethodSpecificInput']]
    end
    @cash_payment_method_specific_input = Ingenico::Connect::SDK::Domain::Payment::CashPaymentMethodSpecificInputBase.new_from_hash(hash['cashPaymentMethodSpecificInput'])
  end
  if hash.has_key?('fraudFields')
    if !(hash['fraudFields'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['fraudFields']]
    end
    @fraud_fields = Ingenico::Connect::SDK::Domain::Definitions::FraudFields.new_from_hash(hash['fraudFields'])
  end
  if hash.has_key?('hostedCheckoutSpecificInput')
    if !(hash['hostedCheckoutSpecificInput'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['hostedCheckoutSpecificInput']]
    end
    @hosted_checkout_specific_input = Ingenico::Connect::SDK::Domain::Hostedcheckout::HostedCheckoutSpecificInput.new_from_hash(hash['hostedCheckoutSpecificInput'])
  end
  if hash.has_key?('order')
    if !(hash['order'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['order']]
    end
    @order = Ingenico::Connect::SDK::Domain::Payment::Order.new_from_hash(hash['order'])
  end
  if hash.has_key?('redirectPaymentMethodSpecificInput')
    if !(hash['redirectPaymentMethodSpecificInput'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['redirectPaymentMethodSpecificInput']]
    end
    @redirect_payment_method_specific_input = Ingenico::Connect::SDK::Domain::Payment::RedirectPaymentMethodSpecificInputBase.new_from_hash(hash['redirectPaymentMethodSpecificInput'])
  end
end

#to_hObject



41
42
43
44
45
46
47
48
49
50
51
# File 'lib/ingenico/connect/sdk/domain/hostedcheckout/create_hosted_checkout_request.rb', line 41

def to_h
  hash = super
  add_to_hash(hash, 'bankTransferPaymentMethodSpecificInput', @bank_transfer_payment_method_specific_input)
  add_to_hash(hash, 'cardPaymentMethodSpecificInput', @card_payment_method_specific_input)
  add_to_hash(hash, 'cashPaymentMethodSpecificInput', @cash_payment_method_specific_input)
  add_to_hash(hash, 'fraudFields', @fraud_fields)
  add_to_hash(hash, 'hostedCheckoutSpecificInput', @hosted_checkout_specific_input)
  add_to_hash(hash, 'order', @order)
  add_to_hash(hash, 'redirectPaymentMethodSpecificInput', @redirect_payment_method_specific_input)
  hash
end