Class: Worldline::Connect::SDK::V1::Domain::LineItem

Inherits:
Domain::DataObject show all
Defined in:
lib/worldline/connect/sdk/v1/domain/line_item.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#amount_of_moneyWorldline::Connect::SDK::V1::Domain::AmountOfMoney

Returns the current value of amount_of_money.

Returns:



20
21
22
# File 'lib/worldline/connect/sdk/v1/domain/line_item.rb', line 20

def amount_of_money
  @amount_of_money
end

#invoice_dataWorldline::Connect::SDK::V1::Domain::LineItemInvoiceData

Returns the current value of invoice_data.

Returns:



20
21
22
# File 'lib/worldline/connect/sdk/v1/domain/line_item.rb', line 20

def invoice_data
  @invoice_data
end

#level3_interchange_informationObject

Deprecated.

Use orderLineDetails instead



20
21
22
# File 'lib/worldline/connect/sdk/v1/domain/line_item.rb', line 20

def level3_interchange_information
  @level3_interchange_information
end

#order_line_detailsWorldline::Connect::SDK::V1::Domain::OrderLineDetails

Returns the current value of order_line_details.

Returns:



20
21
22
# File 'lib/worldline/connect/sdk/v1/domain/line_item.rb', line 20

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/worldline/connect/sdk/v1/domain/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 = Worldline::Connect::SDK::V1::Domain::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 = Worldline::Connect::SDK::V1::Domain::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 = Worldline::Connect::SDK::V1::Domain::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 = Worldline::Connect::SDK::V1::Domain::OrderLineDetails.new_from_hash(hash['orderLineDetails'])
  end
end

#to_hHash

Returns:

  • (Hash)


32
33
34
35
36
37
38
39
# File 'lib/worldline/connect/sdk/v1/domain/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