Class: Braintree::TransactionLineItem

Inherits:
Object
  • Object
show all
Includes:
BaseModule
Defined in:
lib/braintree/transaction_line_item.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from BaseModule

included

Methods included from BaseModule::Methods

#copy_instance_variables_from_object, #return_object_or_raise, #set_instance_variables_from_hash, #singleton_class

Constructor Details

#initialize(gateway, attributes) ⇒ TransactionLineItem

Returns a new instance of TransactionLineItem.



21
22
23
24
25
26
27
28
29
30
# File 'lib/braintree/transaction_line_item.rb', line 21

def initialize(gateway, attributes)
  @gateway = gateway
  set_instance_variables_from_hash(attributes)
  @quantity = Util.to_big_decimal(quantity)
  @unit_amount = Util.to_big_decimal(unit_amount)
  @unit_tax_amount = Util.to_big_decimal(unit_tax_amount)
  @discount_amount = Util.to_big_decimal(discount_amount)
  @tax_amount = Util.to_big_decimal(tax_amount)
  @total_amount = Util.to_big_decimal(total_amount)
end

Instance Attribute Details

#commodity_codeObject (readonly)

Returns the value of attribute commodity_code.



4
5
6
# File 'lib/braintree/transaction_line_item.rb', line 4

def commodity_code
  @commodity_code
end

#descriptionObject (readonly)

Returns the value of attribute description.



5
6
7
# File 'lib/braintree/transaction_line_item.rb', line 5

def description
  @description
end

#discount_amountObject (readonly)

Returns the value of attribute discount_amount.



6
7
8
# File 'lib/braintree/transaction_line_item.rb', line 6

def discount_amount
  @discount_amount
end

#image_urlObject (readonly)

Returns the value of attribute image_url.



7
8
9
# File 'lib/braintree/transaction_line_item.rb', line 7

def image_url
  @image_url
end

#kindObject (readonly)

Returns the value of attribute kind.



8
9
10
# File 'lib/braintree/transaction_line_item.rb', line 8

def kind
  @kind
end

#nameObject (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/braintree/transaction_line_item.rb', line 9

def name
  @name
end

#product_codeObject (readonly)

Returns the value of attribute product_code.



10
11
12
# File 'lib/braintree/transaction_line_item.rb', line 10

def product_code
  @product_code
end

#quantityObject (readonly)

Returns the value of attribute quantity.



11
12
13
# File 'lib/braintree/transaction_line_item.rb', line 11

def quantity
  @quantity
end

#tax_amountObject (readonly)

Returns the value of attribute tax_amount.



12
13
14
# File 'lib/braintree/transaction_line_item.rb', line 12

def tax_amount
  @tax_amount
end

#total_amountObject (readonly)

Returns the value of attribute total_amount.



13
14
15
# File 'lib/braintree/transaction_line_item.rb', line 13

def total_amount
  @total_amount
end

#unit_amountObject (readonly)

Returns the value of attribute unit_amount.



14
15
16
# File 'lib/braintree/transaction_line_item.rb', line 14

def unit_amount
  @unit_amount
end

#unit_of_measureObject (readonly)

Returns the value of attribute unit_of_measure.



15
16
17
# File 'lib/braintree/transaction_line_item.rb', line 15

def unit_of_measure
  @unit_of_measure
end

#unit_tax_amountObject (readonly)

Returns the value of attribute unit_tax_amount.



16
17
18
# File 'lib/braintree/transaction_line_item.rb', line 16

def unit_tax_amount
  @unit_tax_amount
end

#upc_codeObject (readonly)

Returns the value of attribute upc_code.



17
18
19
# File 'lib/braintree/transaction_line_item.rb', line 17

def upc_code
  @upc_code
end

#upc_typeObject (readonly)

Returns the value of attribute upc_type.



18
19
20
# File 'lib/braintree/transaction_line_item.rb', line 18

def upc_type
  @upc_type
end

#urlObject (readonly)

Returns the value of attribute url.



19
20
21
# File 'lib/braintree/transaction_line_item.rb', line 19

def url
  @url
end

Class Method Details

._new(*args) ⇒ Object



34
35
36
# File 'lib/braintree/transaction_line_item.rb', line 34

def _new(*args)
  self.new(*args)
end

.find_all(*args) ⇒ Object



39
40
41
# File 'lib/braintree/transaction_line_item.rb', line 39

def self.find_all(*args)
  Configuration.gateway.transaction_line_item.find_all(*args)
end