Class: Stripe::Tax::Calculation::CreateParams::LineItem
- Inherits:
-
RequestParams
- Object
- RequestParams
- Stripe::Tax::Calculation::CreateParams::LineItem
- Defined in:
- lib/stripe/resources/tax/calculation.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
A positive integer representing the line item’s total price in the [smallest currency unit](stripe.com/docs/currencies#zero-decimal).
-
#product ⇒ Object
If provided, the product’s ‘tax_code` will be used as the line item’s ‘tax_code`.
-
#quantity ⇒ Object
The number of units of the item being purchased.
-
#reference ⇒ Object
A custom identifier for this line item, which must be unique across the line items in the calculation.
-
#tax_behavior ⇒ Object
Specifies whether the ‘amount` includes taxes.
-
#tax_code ⇒ Object
A [tax code](stripe.com/docs/tax/tax-categories) ID to use for this line item.
Instance Method Summary collapse
-
#initialize(amount: nil, product: nil, quantity: nil, reference: nil, tax_behavior: nil, tax_code: nil) ⇒ LineItem
constructor
A new instance of LineItem.
Methods inherited from RequestParams
Constructor Details
#initialize(amount: nil, product: nil, quantity: nil, reference: nil, tax_behavior: nil, tax_code: nil) ⇒ LineItem
Returns a new instance of LineItem.
254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
# File 'lib/stripe/resources/tax/calculation.rb', line 254 def initialize( amount: nil, product: nil, quantity: nil, reference: nil, tax_behavior: nil, tax_code: nil ) @amount = amount @product = product @quantity = quantity @reference = reference @tax_behavior = tax_behavior @tax_code = tax_code end |
Instance Attribute Details
#amount ⇒ Object
A positive integer representing the line item’s total price in the [smallest currency unit](stripe.com/docs/currencies#zero-decimal). If ‘tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes are calculated on top of this amount.
242 243 244 |
# File 'lib/stripe/resources/tax/calculation.rb', line 242 def amount @amount end |
#product ⇒ Object
If provided, the product’s ‘tax_code` will be used as the line item’s ‘tax_code`.
244 245 246 |
# File 'lib/stripe/resources/tax/calculation.rb', line 244 def product @product end |
#quantity ⇒ Object
The number of units of the item being purchased. Used to calculate the per-unit price from the total ‘amount` for the line. For example, if `amount=100` and `quantity=4`, the calculated unit price is 25.
246 247 248 |
# File 'lib/stripe/resources/tax/calculation.rb', line 246 def quantity @quantity end |
#reference ⇒ Object
A custom identifier for this line item, which must be unique across the line items in the calculation. The reference helps identify each line item in exported [tax reports](stripe.com/docs/tax/reports).
248 249 250 |
# File 'lib/stripe/resources/tax/calculation.rb', line 248 def reference @reference end |
#tax_behavior ⇒ Object
Specifies whether the ‘amount` includes taxes. Defaults to `exclusive`.
250 251 252 |
# File 'lib/stripe/resources/tax/calculation.rb', line 250 def tax_behavior @tax_behavior end |
#tax_code ⇒ Object
A [tax code](stripe.com/docs/tax/tax-categories) ID to use for this line item. If not provided, we will use the tax code from the provided ‘product` param. If neither `tax_code` nor `product` is provided, we will use the default tax code from your Tax Settings.
252 253 254 |
# File 'lib/stripe/resources/tax/calculation.rb', line 252 def tax_code @tax_code end |