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

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

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, product: nil, quantity: nil, reference: nil, tax_behavior: nil, tax_code: nil) ⇒ LineItem

Returns a new instance of LineItem.



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/stripe/params/tax/calculation_create_params.rb', line 93

def initialize(
  amount: nil,
  metadata: nil,
  product: nil,
  quantity: nil,
  reference: nil,
  tax_behavior: nil,
  tax_code: nil
)
  @amount = amount
  @metadata = 
  @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.



79
80
81
# File 'lib/stripe/params/tax/calculation_create_params.rb', line 79

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.



81
82
83
# File 'lib/stripe/params/tax/calculation_create_params.rb', line 81

def 
  @metadata
end

#productObject

If provided, the product's tax_code will be used as the line item's tax_code.



83
84
85
# File 'lib/stripe/params/tax/calculation_create_params.rb', line 83

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.



85
86
87
# File 'lib/stripe/params/tax/calculation_create_params.rb', line 85

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.



87
88
89
# File 'lib/stripe/params/tax/calculation_create_params.rb', line 87

def reference
  @reference
end

#tax_behaviorObject

Specifies whether the amount includes taxes. Defaults to exclusive.



89
90
91
# File 'lib/stripe/params/tax/calculation_create_params.rb', line 89

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.



91
92
93
# File 'lib/stripe/params/tax/calculation_create_params.rb', line 91

def tax_code
  @tax_code
end