Class: OnlinePayments::SDK::Domain::OrderLineDetails

Inherits:
DataObject
  • Object
show all
Defined in:
lib/onlinepayments/sdk/domain/order_line_details.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#discount_amountInteger

Returns the current value of discount_amount.

Returns:

  • (Integer)

    the current value of discount_amount



19
20
21
# File 'lib/onlinepayments/sdk/domain/order_line_details.rb', line 19

def discount_amount
  @discount_amount
end

#product_brandString

Returns the current value of product_brand.

Returns:

  • (String)

    the current value of product_brand



19
20
21
# File 'lib/onlinepayments/sdk/domain/order_line_details.rb', line 19

def product_brand
  @product_brand
end

#product_codeString

Returns the current value of product_code.

Returns:

  • (String)

    the current value of product_code



19
20
21
# File 'lib/onlinepayments/sdk/domain/order_line_details.rb', line 19

def product_code
  @product_code
end

#product_nameString

Returns the current value of product_name.

Returns:

  • (String)

    the current value of product_name



19
20
21
# File 'lib/onlinepayments/sdk/domain/order_line_details.rb', line 19

def product_name
  @product_name
end

#product_priceInteger

Returns the current value of product_price.

Returns:

  • (Integer)

    the current value of product_price



19
20
21
# File 'lib/onlinepayments/sdk/domain/order_line_details.rb', line 19

def product_price
  @product_price
end

#product_typeString

Returns the current value of product_type.

Returns:

  • (String)

    the current value of product_type



19
20
21
# File 'lib/onlinepayments/sdk/domain/order_line_details.rb', line 19

def product_type
  @product_type
end

#quantityInteger

Returns the current value of quantity.

Returns:

  • (Integer)

    the current value of quantity



19
20
21
# File 'lib/onlinepayments/sdk/domain/order_line_details.rb', line 19

def quantity
  @quantity
end

#tax_amountInteger

Returns the current value of tax_amount.

Returns:

  • (Integer)

    the current value of tax_amount



19
20
21
# File 'lib/onlinepayments/sdk/domain/order_line_details.rb', line 19

def tax_amount
  @tax_amount
end

#tax_percentagefloat

Returns the current value of tax_percentage.

Returns:

  • (float)

    the current value of tax_percentage



19
20
21
# File 'lib/onlinepayments/sdk/domain/order_line_details.rb', line 19

def tax_percentage
  @tax_percentage
end

#unitString

Returns the current value of unit.

Returns:

  • (String)

    the current value of unit



19
20
21
# File 'lib/onlinepayments/sdk/domain/order_line_details.rb', line 19

def unit
  @unit
end

Instance Method Details

#from_hash(hash) ⇒ Object



57
58
59
60
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
# File 'lib/onlinepayments/sdk/domain/order_line_details.rb', line 57

def from_hash(hash)
  super
  if hash.has_key? 'discountAmount'
    @discount_amount = hash['discountAmount']
  end
  if hash.has_key? 'productBrand'
    @product_brand = hash['productBrand']
  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? 'taxPercentage'
    @tax_percentage = hash['taxPercentage']
  end
  if hash.has_key? 'unit'
    @unit = hash['unit']
  end
end

#to_hHash

Returns:

  • (Hash)


42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/onlinepayments/sdk/domain/order_line_details.rb', line 42

def to_h
  hash = super
  hash['discountAmount'] = @discount_amount unless @discount_amount.nil?
  hash['productBrand'] = @product_brand unless @product_brand.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['productType'] = @product_type unless @product_type.nil?
  hash['quantity'] = @quantity unless @quantity.nil?
  hash['taxAmount'] = @tax_amount unless @tax_amount.nil?
  hash['taxPercentage'] = @tax_percentage unless @tax_percentage.nil?
  hash['unit'] = @unit unless @unit.nil?
  hash
end