Class: Stripe::PaymentIntentCreateParams::AmountDetails::LineItem

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

Defined Under Namespace

Classes: PaymentMethodOptions, Tax

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(discount_amount: nil, payment_method_options: nil, product_code: nil, product_name: nil, quantity: nil, tax: nil, unit_cost: nil, unit_of_measure: nil, quantity_precision: nil) ⇒ LineItem

Returns a new instance of LineItem.



137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/stripe/params/payment_intent_create_params.rb', line 137

def initialize(
  discount_amount: nil,
  payment_method_options: nil,
  product_code: nil,
  product_name: nil,
  quantity: nil,
  tax: nil,
  unit_cost: nil,
  unit_of_measure: nil,
  quantity_precision: nil
)
  @discount_amount = discount_amount
  @payment_method_options = payment_method_options
  @product_code = product_code
  @product_name = product_name
  @quantity = quantity
  @tax = tax
  @unit_cost = unit_cost
  @unit_of_measure = unit_of_measure
  @quantity_precision = quantity_precision
end

Instance Attribute Details

#discount_amountObject

The discount applied on this line item represented in the [smallest currency unit](docs.stripe.com/currencies#zero-decimal). An integer greater than 0.

This field is mutually exclusive with the ‘amount_details` field.



117
118
119
# File 'lib/stripe/params/payment_intent_create_params.rb', line 117

def discount_amount
  @discount_amount
end

#payment_method_optionsObject

Payment method-specific information for line items.



119
120
121
# File 'lib/stripe/params/payment_intent_create_params.rb', line 119

def payment_method_options
  @payment_method_options
end

#product_codeObject

The product code of the line item, such as an SKU. Required for L3 rates. At most 12 characters long.



121
122
123
# File 'lib/stripe/params/payment_intent_create_params.rb', line 121

def product_code
  @product_code
end

#product_nameObject

The product name of the line item. Required for L3 rates. At most 1024 characters long.

For Cards, this field is truncated to 26 alphanumeric characters before being sent to the card networks. For PayPal, this field is truncated to 127 characters.



125
126
127
# File 'lib/stripe/params/payment_intent_create_params.rb', line 125

def product_name
  @product_name
end

#quantityObject

The quantity of items. Required for L3 rates. An integer greater than 0.



127
128
129
# File 'lib/stripe/params/payment_intent_create_params.rb', line 127

def quantity
  @quantity
end

#quantity_precisionObject

The number of decimal places implied in the quantity. For example, if quantity is 10000 and quantity_precision is 2, the actual quantity is 100.00. Defaults to 0 if not provided.



135
136
137
# File 'lib/stripe/params/payment_intent_create_params.rb', line 135

def quantity_precision
  @quantity_precision
end

#taxObject

Contains information about the tax on the item.



129
130
131
# File 'lib/stripe/params/payment_intent_create_params.rb', line 129

def tax
  @tax
end

#unit_costObject

The unit cost of the line item represented in the [smallest currency unit](docs.stripe.com/currencies#zero-decimal). Required for L3 rates. An integer greater than or equal to 0.



131
132
133
# File 'lib/stripe/params/payment_intent_create_params.rb', line 131

def unit_cost
  @unit_cost
end

#unit_of_measureObject

A unit of measure for the line item, such as gallons, feet, meters, etc.



133
134
135
# File 'lib/stripe/params/payment_intent_create_params.rb', line 133

def unit_of_measure
  @unit_of_measure
end