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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

new_from_hash

Instance Attribute Details

#airline_dataIngenico::Connect::SDK::Domain::Definitions::AirlineData



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

def airline_data
  @airline_data
end

#installmentsIngenico::Connect::SDK::Domain::Payment::Installments



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

def installments
  @installments
end

#level3_summary_dataObject

Deprecated.

Use Order.shoppingCart.amountBreakdown instead



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

def level3_summary_data
  @level3_summary_data
end

#loan_recipientIngenico::Connect::SDK::Domain::Payment::LoanRecipient



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

def loan_recipient
  @loan_recipient
end

#lodging_dataIngenico::Connect::SDK::Domain::Definitions::LodgingData



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

def lodging_data
  @lodging_data
end

#number_of_installmentsObject

Deprecated.

Use installments.numberOfInstallments instead



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

def number_of_installments
  @number_of_installments
end

#order_dateString



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

def order_date
  @order_date
end

#type_informationIngenico::Connect::SDK::Domain::Payment::OrderTypeInformation



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

def type_information
  @type_information
end

Instance Method Details

#from_hash(hash) ⇒ Object



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
# File 'lib/ingenico/connect/sdk/domain/payment/additional_order_input.rb', line 61

def from_hash(hash)
  super
  if hash.has_key? 'airlineData'
    raise TypeError, "value '%s' is not a Hash" % [hash['airlineData']] unless hash['airlineData'].is_a? Hash
    @airline_data = Ingenico::Connect::SDK::Domain::Definitions::AirlineData.new_from_hash(hash['airlineData'])
  end
  if hash.has_key? 'installments'
    raise TypeError, "value '%s' is not a Hash" % [hash['installments']] unless hash['installments'].is_a? Hash
    @installments = Ingenico::Connect::SDK::Domain::Payment::Installments.new_from_hash(hash['installments'])
  end
  if hash.has_key? 'level3SummaryData'
    raise TypeError, "value '%s' is not a Hash" % [hash['level3SummaryData']] unless hash['level3SummaryData'].is_a? Hash
    @level3_summary_data = Ingenico::Connect::SDK::Domain::Payment::Level3SummaryData.new_from_hash(hash['level3SummaryData'])
  end
  if hash.has_key? 'loanRecipient'
    raise TypeError, "value '%s' is not a Hash" % [hash['loanRecipient']] unless hash['loanRecipient'].is_a? Hash
    @loan_recipient = Ingenico::Connect::SDK::Domain::Payment::LoanRecipient.new_from_hash(hash['loanRecipient'])
  end
  if hash.has_key? 'lodgingData'
    raise TypeError, "value '%s' is not a Hash" % [hash['lodgingData']] unless hash['lodgingData'].is_a? Hash
    @lodging_data = Ingenico::Connect::SDK::Domain::Definitions::LodgingData.new_from_hash(hash['lodgingData'])
  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'
    raise TypeError, "value '%s' is not a Hash" % [hash['typeInformation']] unless hash['typeInformation'].is_a? Hash
    @type_information = Ingenico::Connect::SDK::Domain::Payment::OrderTypeInformation.new_from_hash(hash['typeInformation'])
  end
end

#to_hHash



48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/ingenico/connect/sdk/domain/payment/additional_order_input.rb', line 48

def to_h
  hash = super
  hash['airlineData'] = @airline_data.to_h unless @airline_data.nil?
  hash['installments'] = @installments.to_h unless @installments.nil?
  hash['level3SummaryData'] = @level3_summary_data.to_h unless @level3_summary_data.nil?
  hash['loanRecipient'] = @loan_recipient.to_h unless @loan_recipient.nil?
  hash['lodgingData'] = @lodging_data.to_h unless @lodging_data.nil?
  hash['numberOfInstallments'] = @number_of_installments unless @number_of_installments.nil?
  hash['orderDate'] = @order_date unless @order_date.nil?
  hash['typeInformation'] = @type_information.to_h unless @type_information.nil?
  hash
end