Class: Stripe::Tax::CalculationCreateParams::LineItem
- Inherits:
-
RequestParams
- Object
- RequestParams
- Stripe::Tax::CalculationCreateParams::LineItem
- Defined in:
- lib/stripe/params/tax/calculation_create_params.rb
Defined Under Namespace
Classes: PerformanceLocationDetails
Instance Attribute Summary collapse
-
#amount ⇒ Object
A positive integer representing the line item's total price in the smallest currency unit.
-
#metadata ⇒ Object
Set of key-value pairs that you can attach to an object.
-
#performance_location ⇒ Object
A tax location ID.
-
#performance_location_details ⇒ Object
Details of the performance location for this line item.
-
#product ⇒ Object
If provided, the product's
tax_codewill be used as the line item'stax_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
amountincludes taxes. -
#tax_code ⇒ Object
A tax code ID to use for this line item.
Instance Method Summary collapse
-
#initialize(amount: nil, metadata: nil, performance_location: nil, performance_location_details: nil, product: nil, quantity: nil, reference: nil, tax_behavior: nil, tax_code: nil) ⇒ LineItem
constructor
A new instance of LineItem.
Methods inherited from RequestParams
attr_accessor, coerce_params, coerce_value, field_encodings, new, #to_h
Constructor Details
#initialize(amount: nil, metadata: nil, performance_location: nil, performance_location_details: nil, product: nil, quantity: nil, reference: nil, tax_behavior: nil, tax_code: nil) ⇒ LineItem
Returns a new instance of LineItem.
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
# File 'lib/stripe/params/tax/calculation_create_params.rb', line 135 def initialize( amount: nil, metadata: nil, performance_location: nil, performance_location_details: nil, product: nil, quantity: nil, reference: nil, tax_behavior: nil, tax_code: nil ) @amount = amount @metadata = @performance_location = performance_location @performance_location_details = performance_location_details @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.
If tax_behavior=inclusive, then this amount includes taxes. Otherwise, taxes are calculated on top of this amount.
117 118 119 |
# File 'lib/stripe/params/tax/calculation_create_params.rb', line 117 def amount @amount end |
#metadata ⇒ Object
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
119 120 121 |
# File 'lib/stripe/params/tax/calculation_create_params.rb', line 119 def @metadata end |
#performance_location ⇒ Object
A tax location ID. Depending on the tax code, this is required, optional, or not supported.
121 122 123 |
# File 'lib/stripe/params/tax/calculation_create_params.rb', line 121 def performance_location @performance_location end |
#performance_location_details ⇒ Object
Details of the performance location for this line item. Use this to specify an address directly instead of a tax location ID.
123 124 125 |
# File 'lib/stripe/params/tax/calculation_create_params.rb', line 123 def performance_location_details @performance_location_details end |
#product ⇒ Object
If provided, the product's tax_code will be used as the line item's tax_code.
125 126 127 |
# File 'lib/stripe/params/tax/calculation_create_params.rb', line 125 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.
127 128 129 |
# File 'lib/stripe/params/tax/calculation_create_params.rb', line 127 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.
129 130 131 |
# File 'lib/stripe/params/tax/calculation_create_params.rb', line 129 def reference @reference end |
#tax_behavior ⇒ Object
Specifies whether the amount includes taxes. Defaults to exclusive.
131 132 133 |
# File 'lib/stripe/params/tax/calculation_create_params.rb', line 131 def tax_behavior @tax_behavior end |
#tax_code ⇒ Object
A tax code 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.
133 134 135 |
# File 'lib/stripe/params/tax/calculation_create_params.rb', line 133 def tax_code @tax_code end |