Class: Braintree::TransactionLineItem
- Inherits:
-
Object
- Object
- Braintree::TransactionLineItem
- Includes:
- BaseModule
- Defined in:
- lib/braintree/transaction_line_item.rb
Instance Attribute Summary collapse
-
#commodity_code ⇒ Object
readonly
Returns the value of attribute commodity_code.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#discount_amount ⇒ Object
readonly
Returns the value of attribute discount_amount.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#product_code ⇒ Object
readonly
Returns the value of attribute product_code.
-
#quantity ⇒ Object
readonly
Returns the value of attribute quantity.
-
#tax_amount ⇒ Object
readonly
Returns the value of attribute tax_amount.
-
#total_amount ⇒ Object
readonly
Returns the value of attribute total_amount.
-
#unit_amount ⇒ Object
readonly
Returns the value of attribute unit_amount.
-
#unit_of_measure ⇒ Object
readonly
Returns the value of attribute unit_of_measure.
-
#unit_tax_amount ⇒ Object
readonly
Returns the value of attribute unit_tax_amount.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(gateway, attributes) ⇒ TransactionLineItem
constructor
:nodoc:.
Methods included from BaseModule
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_code ⇒ Object (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 |
#description ⇒ Object (readonly)
Returns the value of attribute description.
6 7 8 |
# File 'lib/braintree/transaction_line_item.rb', line 6 def description @description end |
#discount_amount ⇒ Object (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 |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
7 8 9 |
# File 'lib/braintree/transaction_line_item.rb', line 7 def kind @kind end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/braintree/transaction_line_item.rb', line 5 def name @name end |
#product_code ⇒ Object (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 |
#quantity ⇒ Object (readonly)
Returns the value of attribute quantity.
4 5 6 |
# File 'lib/braintree/transaction_line_item.rb', line 4 def quantity @quantity end |
#tax_amount ⇒ Object (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_amount ⇒ Object (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_amount ⇒ Object (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_measure ⇒ Object (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_amount ⇒ Object (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 |
#url ⇒ Object (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 |