Class: Ingenico::Connect::SDK::Domain::Payment::LineItem
- Inherits:
-
Ingenico::Connect::SDK::DataObject
- Object
- Ingenico::Connect::SDK::DataObject
- Ingenico::Connect::SDK::Domain::Payment::LineItem
- Defined in:
- lib/ingenico/connect/sdk/domain/payment/line_item.rb
Instance Attribute Summary collapse
-
#amount_of_money ⇒ Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney
The current value of amount_of_money.
-
#invoice_data ⇒ Ingenico::Connect::SDK::Domain::Payment::LineItemInvoiceData
The current value of invoice_data.
-
#level3_interchange_information ⇒ Object
deprecated
Deprecated.
Use orderLineDetails instead
-
#order_line_details ⇒ Ingenico::Connect::SDK::Domain::Payment::OrderLineDetails
The current value of order_line_details.
Instance Method Summary collapse
Methods inherited from Ingenico::Connect::SDK::DataObject
Instance Attribute Details
#amount_of_money ⇒ Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney
Returns the current value of amount_of_money.
19 20 21 |
# File 'lib/ingenico/connect/sdk/domain/payment/line_item.rb', line 19 def amount_of_money @amount_of_money end |
#invoice_data ⇒ Ingenico::Connect::SDK::Domain::Payment::LineItemInvoiceData
Returns the current value of invoice_data.
19 20 21 |
# File 'lib/ingenico/connect/sdk/domain/payment/line_item.rb', line 19 def invoice_data @invoice_data end |
#level3_interchange_information ⇒ Object
Deprecated.
Use orderLineDetails instead
19 20 21 |
# File 'lib/ingenico/connect/sdk/domain/payment/line_item.rb', line 19 def level3_interchange_information @level3_interchange_information end |
#order_line_details ⇒ Ingenico::Connect::SDK::Domain::Payment::OrderLineDetails
Returns the current value of order_line_details.
19 20 21 |
# File 'lib/ingenico/connect/sdk/domain/payment/line_item.rb', line 19 def order_line_details @order_line_details end |
Instance Method Details
#from_hash(hash) ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/ingenico/connect/sdk/domain/payment/line_item.rb', line 41 def from_hash(hash) super if hash.has_key? 'amountOfMoney' raise TypeError, "value '%s' is not a Hash" % [hash['amountOfMoney']] unless hash['amountOfMoney'].is_a? Hash @amount_of_money = Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney.new_from_hash(hash['amountOfMoney']) end if hash.has_key? 'invoiceData' raise TypeError, "value '%s' is not a Hash" % [hash['invoiceData']] unless hash['invoiceData'].is_a? Hash @invoice_data = Ingenico::Connect::SDK::Domain::Payment::LineItemInvoiceData.new_from_hash(hash['invoiceData']) end if hash.has_key? 'level3InterchangeInformation' raise TypeError, "value '%s' is not a Hash" % [hash['level3InterchangeInformation']] unless hash['level3InterchangeInformation'].is_a? Hash @level3_interchange_information = Ingenico::Connect::SDK::Domain::Payment::LineItemLevel3InterchangeInformation.new_from_hash(hash['level3InterchangeInformation']) end if hash.has_key? 'orderLineDetails' raise TypeError, "value '%s' is not a Hash" % [hash['orderLineDetails']] unless hash['orderLineDetails'].is_a? Hash @order_line_details = Ingenico::Connect::SDK::Domain::Payment::OrderLineDetails.new_from_hash(hash['orderLineDetails']) end end |
#to_h ⇒ Hash
32 33 34 35 36 37 38 39 |
# File 'lib/ingenico/connect/sdk/domain/payment/line_item.rb', line 32 def to_h hash = super hash['amountOfMoney'] = @amount_of_money.to_h unless @amount_of_money.nil? hash['invoiceData'] = @invoice_data.to_h unless @invoice_data.nil? hash['level3InterchangeInformation'] = @level3_interchange_information.to_h unless @level3_interchange_information.nil? hash['orderLineDetails'] = @order_line_details.to_h unless @order_line_details.nil? hash end |