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

:nodoc:


18
19
20
21
22
23
24
25
26
27
# File 'lib/braintree/transaction_line_item.rb', line 18

def initialize(gateway, attributes) # :nodoc:
  @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.


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

def commodity_code
  @commodity_code
end

#descriptionObject (readonly)

Returns the value of attribute description.


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

def description
  @description
end

#discount_amountObject (readonly)

Returns the value of attribute discount_amount.


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

def discount_amount
  @discount_amount
end

#kindObject (readonly)

Returns the value of attribute kind.


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

def kind
  @kind
end

#nameObject (readonly)

Returns the value of attribute name.


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

def name
  @name
end

#product_codeObject (readonly)

Returns the value of attribute product_code.


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

def product_code
  @product_code
end

#quantityObject (readonly)

Returns the value of attribute quantity.


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

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.


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

def unit_amount
  @unit_amount
end

#unit_of_measureObject (readonly)

Returns the value of attribute unit_of_measure.


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

def unit_of_measure
  @unit_of_measure
end

#unit_tax_amountObject (readonly)

Returns the value of attribute unit_tax_amount.


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

def unit_tax_amount
  @unit_tax_amount
end

#urlObject (readonly)

Returns the value of attribute url.


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

def url
  @url
end

Class Method Details

._new(*args) ⇒ Object

:nodoc:


31
32
33
# File 'lib/braintree/transaction_line_item.rb', line 31

def _new(*args) # :nodoc:
  self.new(*args)
end

.find_all(*args) ⇒ Object


36
37
38
# File 'lib/braintree/transaction_line_item.rb', line 36

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