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_amountObject

Integer



14
15
16
# File 'lib/ingenico/connect/sdk/domain/payment/order_line_details.rb', line 14

def discount_amount
  @discount_amount
end

#google_product_category_idObject

Integer



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

def google_product_category_id
  @google_product_category_id
end

#line_amount_totalObject

Integer



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

def line_amount_total
  @line_amount_total
end

#product_categoryObject

String



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

def product_category
  @product_category
end

#product_codeObject

String



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

def product_code
  @product_code
end

#product_nameObject

String



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

def product_name
  @product_name
end

#product_priceObject

Integer



32
33
34
# File 'lib/ingenico/connect/sdk/domain/payment/order_line_details.rb', line 32

def product_price
  @product_price
end

#product_typeObject

String



35
36
37
# File 'lib/ingenico/connect/sdk/domain/payment/order_line_details.rb', line 35

def product_type
  @product_type
end

#quantityObject

Integer



38
39
40
# File 'lib/ingenico/connect/sdk/domain/payment/order_line_details.rb', line 38

def quantity
  @quantity
end

#tax_amountObject

Integer



41
42
43
# File 'lib/ingenico/connect/sdk/domain/payment/order_line_details.rb', line 41

def tax_amount
  @tax_amount
end

#unitObject

String



44
45
46
# File 'lib/ingenico/connect/sdk/domain/payment/order_line_details.rb', line 44

def unit
  @unit
end

Instance Method Details

#from_hash(hash) ⇒ Object



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
94
95
96
97
# File 'lib/ingenico/connect/sdk/domain/payment/order_line_details.rb', line 62

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?('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_hObject



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

def to_h
  hash = super
  add_to_hash(hash, 'discountAmount', @discount_amount)
  add_to_hash(hash, 'googleProductCategoryId', @google_product_category_id)
  add_to_hash(hash, 'lineAmountTotal', @line_amount_total)
  add_to_hash(hash, 'productCategory', @product_category)
  add_to_hash(hash, 'productCode', @product_code)
  add_to_hash(hash, 'productName', @product_name)
  add_to_hash(hash, 'productPrice', @product_price)
  add_to_hash(hash, 'productType', @product_type)
  add_to_hash(hash, 'quantity', @quantity)
  add_to_hash(hash, 'taxAmount', @tax_amount)
  add_to_hash(hash, 'unit', @unit)
  hash
end