Class: Ingenico::Connect::SDK::Domain::Payment::OrderLineDetails

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

new_from_hash

Instance Attribute Details

#discount_amountInteger



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

def discount_amount
  @discount_amount
end

#google_product_category_idInteger



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

def google_product_category_id
  @google_product_category_id
end

#line_amount_totalInteger



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

def line_amount_total
  @line_amount_total
end

#product_categoryString



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

def product_category
  @product_category
end

#product_codeString



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

def product_code
  @product_code
end

#product_nameString



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

def product_name
  @product_name
end

#product_priceInteger



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

def product_price
  @product_price
end

#product_skuString



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

def product_sku
  @product_sku
end

#product_typeString



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

def product_type
  @product_type
end

#quantityInteger



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

def quantity
  @quantity
end

#tax_amountInteger



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

def tax_amount
  @tax_amount
end

#unitString



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

def unit
  @unit
end

Instance Method Details

#from_hash(hash) ⇒ Object



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
98
99
100
101
102
103
104
105
106
# File 'lib/ingenico/connect/sdk/domain/payment/order_line_details.rb', line 68

def from_hash(hash)
  super
  if hash.has_key? 'discountAmount'
    @discount_amount = hash['discountAmount']
  end
  if hash.has_key? 'googleProductCategoryId'
    @google_product_category_id = hash['googleProductCategoryId']
  end
  if hash.has_key? 'lineAmountTotal'
    @line_amount_total = hash['lineAmountTotal']
  end
  if hash.has_key? 'productCategory'
    @product_category = hash['productCategory']
  end
  if hash.has_key? 'productCode'
    @product_code = hash['productCode']
  end
  if hash.has_key? 'productName'
    @product_name = hash['productName']
  end
  if hash.has_key? 'productPrice'
    @product_price = hash['productPrice']
  end
  if hash.has_key? 'productSku'
    @product_sku = hash['productSku']
  end
  if hash.has_key? 'productType'
    @product_type = hash['productType']
  end
  if hash.has_key? 'quantity'
    @quantity = hash['quantity']
  end
  if hash.has_key? 'taxAmount'
    @tax_amount = hash['taxAmount']
  end
  if hash.has_key? 'unit'
    @unit = hash['unit']
  end
end

#to_hHash



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/ingenico/connect/sdk/domain/payment/order_line_details.rb', line 51

def to_h
  hash = super
  hash['discountAmount'] = @discount_amount unless @discount_amount.nil?
  hash['googleProductCategoryId'] = @google_product_category_id unless @google_product_category_id.nil?
  hash['lineAmountTotal'] = @line_amount_total unless @line_amount_total.nil?
  hash['productCategory'] = @product_category unless @product_category.nil?
  hash['productCode'] = @product_code unless @product_code.nil?
  hash['productName'] = @product_name unless @product_name.nil?
  hash['productPrice'] = @product_price unless @product_price.nil?
  hash['productSku'] = @product_sku unless @product_sku.nil?
  hash['productType'] = @product_type unless @product_type.nil?
  hash['quantity'] = @quantity unless @quantity.nil?
  hash['taxAmount'] = @tax_amount unless @tax_amount.nil?
  hash['unit'] = @unit unless @unit.nil?
  hash
end