Class: Stripe::PaymentIntentConfirmParams::AmountDetails

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

Defined Under Namespace

Classes: LineItem, Shipping, Tax

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

#to_h

Constructor Details

#initialize(discount_amount: nil, enforce_arithmetic_validation: nil, line_items: nil, shipping: nil, tax: nil) ⇒ AmountDetails

Returns a new instance of AmountDetails.



184
185
186
187
188
189
190
191
192
193
194
195
196
# File 'lib/stripe/params/payment_intent_confirm_params.rb', line 184

def initialize(
  discount_amount: nil,
  enforce_arithmetic_validation: nil,
  line_items: nil,
  shipping: nil,
  tax: nil
)
  @discount_amount = discount_amount
  @enforce_arithmetic_validation = enforce_arithmetic_validation
  @line_items = line_items
  @shipping = shipping
  @tax = tax
end

Instance Attribute Details

#discount_amountObject

The total discount applied on the transaction 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[#][discount_amount]` field.



170
171
172
# File 'lib/stripe/params/payment_intent_confirm_params.rb', line 170

def discount_amount
  @discount_amount
end

#enforce_arithmetic_validationObject

Set to ‘false` to return arithmetic validation errors in the response without failing the request. Use this when you want the operation to proceed regardless of arithmetic errors in the line item data.

Omit or set to ‘true` to immediately return a 400 error when arithmetic validation fails. Use this for strict validation that prevents processing with line item data that has arithmetic inconsistencies.

For card payments, Stripe doesn’t send line item data if there’s an arithmetic validation error to card networks.



176
177
178
# File 'lib/stripe/params/payment_intent_confirm_params.rb', line 176

def enforce_arithmetic_validation
  @enforce_arithmetic_validation
end

#line_itemsObject

A list of line items, each containing information about a product in the PaymentIntent. There is a maximum of 200 line items.



178
179
180
# File 'lib/stripe/params/payment_intent_confirm_params.rb', line 178

def line_items
  @line_items
end

#shippingObject

Contains information about the shipping portion of the amount.



180
181
182
# File 'lib/stripe/params/payment_intent_confirm_params.rb', line 180

def shipping
  @shipping
end

#taxObject

Contains information about the tax portion of the amount.



182
183
184
# File 'lib/stripe/params/payment_intent_confirm_params.rb', line 182

def tax
  @tax
end