Class: TaxCloud::CartItem
Overview
A CartItem
defines a single line item for the purchase. Used to calculate the tax amount.
Instance Attribute Summary collapse
-
#index ⇒ Object
The unique index number for the line item.
-
#item_id ⇒ Object
The stock keeping unit (SKU) number.
-
#price ⇒ Object
The price of the item.
-
#quantity ⇒ Object
The total number of items.
-
#tic ⇒ Object
The taxable information code.
Instance Method Summary collapse
-
#to_hash ⇒ Object
Convert the object to a usable hash for SOAP requests.
Methods inherited from Record
Constructor Details
This class inherits a constructor from TaxCloud::Record
Instance Attribute Details
#index ⇒ Object
The unique index number for the line item. Must be unique for the scope of the cart.
5 6 7 |
# File 'lib/tax_cloud/cart_item.rb', line 5 def index @index end |
#item_id ⇒ Object
The stock keeping unit (SKU) number.
7 8 9 |
# File 'lib/tax_cloud/cart_item.rb', line 7 def item_id @item_id end |
#price ⇒ Object
The price of the item. All prices are USD. Do not include currency symbol.
11 12 13 |
# File 'lib/tax_cloud/cart_item.rb', line 11 def price @price end |
#quantity ⇒ Object
The total number of items.
13 14 15 |
# File 'lib/tax_cloud/cart_item.rb', line 13 def quantity @quantity end |
#tic ⇒ Object
The taxable information code. See TaxCloud::TaxCodes.
9 10 11 |
# File 'lib/tax_cloud/cart_item.rb', line 9 def tic @tic end |
Instance Method Details
#to_hash ⇒ Object
Convert the object to a usable hash for SOAP requests.
16 17 18 19 20 21 22 23 24 |
# File 'lib/tax_cloud/cart_item.rb', line 16 def to_hash { 'Index' => index, 'ItemID' => item_id, 'TIC' => tic, 'Price' => price, 'Qty' => quantity } end |