Class: Stripe::Tax::CalculationCreateParams::LineItem

Inherits:
RequestParams
  • Object
show all
Defined in:
lib/stripe/params/tax/calculation_create_params.rb

Defined Under Namespace

Classes: PerformanceLocationDetails

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#amountObject

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

#metadataObject

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_locationObject

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_detailsObject

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

#productObject

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

#quantityObject

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

#referenceObject

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_behaviorObject

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_codeObject

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