Class: Ingenico::Connect::SDK::Domain::Payment::AdditionalOrderInput

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

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

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

new_from_hash

Instance Attribute Details

#airline_dataObject



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

def airline_data
  @airline_data
end

#level3_summary_dataObject



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

def level3_summary_data
  @level3_summary_data
end

#number_of_installmentsObject

Integer



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

def number_of_installments
  @number_of_installments
end

#order_dateObject

String



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

def order_date
  @order_date
end

#type_informationObject



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

def type_information
  @type_information
end

Instance Method Details

#from_hash(hash) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/ingenico/connect/sdk/domain/payment/additional_order_input.rb', line 42

def from_hash(hash)
  super
  if hash.has_key?('airlineData')
    if !(hash['airlineData'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['airlineData']]
    end
    @airline_data = Ingenico::Connect::SDK::Domain::Definitions::AirlineData.new_from_hash(hash['airlineData'])
  end
  if hash.has_key?('level3SummaryData')
    if !(hash['level3SummaryData'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['level3SummaryData']]
    end
    @level3_summary_data = Ingenico::Connect::SDK::Domain::Payment::Level3SummaryData.new_from_hash(hash['level3SummaryData'])
  end
  if hash.has_key?('numberOfInstallments')
    @number_of_installments = hash['numberOfInstallments']
  end
  if hash.has_key?('orderDate')
    @order_date = hash['orderDate']
  end
  if hash.has_key?('typeInformation')
    if !(hash['typeInformation'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['typeInformation']]
    end
    @type_information = Ingenico::Connect::SDK::Domain::Payment::OrderTypeInformation.new_from_hash(hash['typeInformation'])
  end
end

#to_hObject



32
33
34
35
36
37
38
39
40
# File 'lib/ingenico/connect/sdk/domain/payment/additional_order_input.rb', line 32

def to_h
  hash = super
  add_to_hash(hash, 'airlineData', @airline_data)
  add_to_hash(hash, 'level3SummaryData', @level3_summary_data)
  add_to_hash(hash, 'numberOfInstallments', @number_of_installments)
  add_to_hash(hash, 'orderDate', @order_date)
  add_to_hash(hash, 'typeInformation', @type_information)
  hash
end