class

Stripe::PaymentIntent

Inherits OpenApi::Json < OpenApi::Validatable < JSON::Serializable::Unmapped < JSON::Serializable < Reference < Object

A PaymentIntent guides you through the process of collecting a payment from your customer. We recommend that you create exactly one PaymentIntent for each order or customer session in your system. You can reference the PaymentIntent later to see the history of payment attempts for a particular session. A PaymentIntent transitions through multiple statuses throughout its lifetime as it interfaces with Stripe.js to perform authentication flows and ultimately creates at most one successful charge. Related guide: Payment Intents API

Constants

ERROR_MESSAGE_FOR_CANCELLATION_REASON = "invalid value for \"cancellation_reason\", must be one of [abandoned, automatic, duplicate, failed_invoice, fraudulent, requested_by_customer, void_invoice]."
ERROR_MESSAGE_FOR_CAPTURE_METHOD = "invalid value for \"capture_method\", must be one of [automatic, automatic_async, manual]."
ERROR_MESSAGE_FOR_CONFIRMATION_METHOD = "invalid value for \"confirmation_method\", must be one of [automatic, manual]."
ERROR_MESSAGE_FOR_OBJECT = "invalid value for \"object\", must be one of [payment_intent]."
ERROR_MESSAGE_FOR_SETUP_FUTURE_USAGE = "invalid value for \"setup_future_usage\", must be one of [off_session, on_session]."
ERROR_MESSAGE_FOR_STATUS = "invalid value for \"status\", must be one of [canceled, processing, requires_action, requires_capture, requires_confirmation, requires_payment_method, succeeded]."
MAX_LENGTH_FOR_CLIENT_SECRET = 5000
MAX_LENGTH_FOR_DESCRIPTION = 5000
MAX_LENGTH_FOR_ID = 5000
MAX_LENGTH_FOR_RECEIPT_EMAIL = 5000
MAX_LENGTH_FOR_STATEMENT_DESCRIPTOR = 5000
MAX_LENGTH_FOR_STATEMENT_DESCRIPTOR_SUFFIX = 5000
MAX_LENGTH_FOR_TRANSFER_GROUP = 5000
VALID_VALUES_FOR_CANCELLATION_REASON = String.static_array("abandoned", "automatic", "duplicate", "failed_invoice", "fraudulent", "requested_by_customer", "void_invoice")
VALID_VALUES_FOR_CAPTURE_METHOD = String.static_array("automatic", "automatic_async", "manual")
VALID_VALUES_FOR_CONFIRMATION_METHOD = String.static_array("automatic", "manual")
VALID_VALUES_FOR_OBJECT = String.static_array("payment_intent")
VALID_VALUES_FOR_SETUP_FUTURE_USAGE = String.static_array("off_session", "on_session")
VALID_VALUES_FOR_STATUS = String.static_array("canceled", "processing", "requires_action", "requires_capture", "requires_confirmation", "requires_payment_method", "succeeded")

Constructors

new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source
new(*, amount : Int64 | Nil = nil, amount_capturable : Int64 | Nil = nil, amount_received : Int64 | Nil = nil, application : Stripe::PaymentIntentApplication | Nil = nil, application_fee_amount : Int64 | Nil = nil, automatic_payment_methods : Stripe::PaymentIntentAutomaticPaymentMethods | Nil = nil, canceled_at : Int64 | Nil = nil, cancellation_reason : String | Nil = nil, capture_method : String | Nil = nil, client_secret : String | Nil = nil, confirmation_method : String | Nil = nil, created : Int64 | Nil = nil, currency : String | Nil = nil, customer : Stripe::PaymentIntentCustomer | Nil = nil, description : String | Nil = nil, id : String | Nil = nil, invoice : Stripe::PaymentIntentInvoice | Nil = nil, last_payment_error : Stripe::PaymentIntentLastPaymentError | Nil = nil, latest_charge : Stripe::PaymentIntentLatestCharge | Nil = nil, livemode : Bool | Nil = nil, metadata : Hash(String, String) | Nil = nil, next_action : Stripe::PaymentIntentNextAction1 | Nil = nil, object : String | Nil = nil, on_behalf_of : Stripe::PaymentIntentOnBehalfOf | Nil = nil, payment_method : Stripe::PaymentIntentPaymentMethod | Nil = nil, payment_method_configuration_details : Stripe::PaymentIntentPaymentMethodConfigurationDetails | Nil = nil, payment_method_options : Stripe::PaymentIntentPaymentMethodOptions1 | Nil = nil, payment_method_types : Array(String) | Nil = nil, processing : Stripe::PaymentIntentProcessing1 | Nil = nil, receipt_email : String | Nil = nil, review : Stripe::PaymentIntentReview | Nil = nil, setup_future_usage : String | Nil = nil, shipping : Stripe::PaymentIntentShipping | Nil = nil, source : Stripe::PaymentIntentSource | Nil = nil, statement_descriptor : String | Nil = nil, statement_descriptor_suffix : String | Nil = nil, status : String | Nil = nil, transfer_data : Stripe::PaymentIntentTransferData | Nil = nil, transfer_group : String | Nil = nil, amount_details : Stripe::PaymentFlowsAmountDetails | Nil = nil)

Initializes the object @param [Hash] attributes Model attributes in the form of hash

Source

Instance methods

==(other : self)

Generates #hash and #== methods from all fields #== @return [Bool] #hash calculates hash code according to all attributes. #hash @return [UInt64] Hash code

amount

Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).

Source
amount=(new_value : Int64 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] amount Object to be assigned

Source
amount_capturable

Amount that can be captured from this PaymentIntent.

Source
amount_capturable=(new_value : Int64 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] amount_capturable Object to be assigned

Source
amount_details
Source
amount_details=(new_value : Stripe::PaymentFlowsAmountDetails | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] amount_details Object to be assigned

Source
amount_received

Amount that this PaymentIntent collects.

Source
amount_received=(new_value : Int64 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] amount_received Object to be assigned

Source
application
Source
application=(new_value : Stripe::PaymentIntentApplication | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] application Object to be assigned

Source
application_fee_amount

The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents use case for connected accounts.

Source
application_fee_amount=(new_value : Int64 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] application_fee_amount Object to be assigned

Source
automatic_payment_methods
Source
automatic_payment_methods=(new_value : Stripe::PaymentIntentAutomaticPaymentMethods | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] automatic_payment_methods Object to be assigned

Source
canceled_at

Populated when status is canceled, this is the time at which the PaymentIntent was canceled. Measured in seconds since the Unix epoch.

Source
canceled_at=(new_value : Int64 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] canceled_at Object to be assigned

Source
cancellation_reason

Reason for cancellation of this PaymentIntent, either user-provided (duplicate, fraudulent, requested_by_customer, or abandoned) or generated by Stripe internally (failed_invoice, void_invoice, or automatic).

Source
cancellation_reason=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] cancellation_reason Object to be assigned

Source
capture_method

Controls when the funds will be captured from the customer's account.

Source
capture_method=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] capture_method Object to be assigned

Source
client_secret

The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key. The client secret can be used to complete a payment from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret. Refer to our docs to accept a payment and learn about how client_secret should be handled.

Source
client_secret=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] client_secret Object to be assigned

Source
confirmation_method

Describes whether we can confirm this PaymentIntent automatically, or if it requires customer action to confirm the payment.

Source
confirmation_method=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] confirmation_method Object to be assigned

Source
created

Time at which the object was created. Measured in seconds since the Unix epoch.

Source
created=(new_value : Int64 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] created Object to be assigned

Source
currency

Three-letter ISO currency code, in lowercase. Must be a supported currency.

Source
currency=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] currency Object to be assigned

Source
customer
Source
customer=(new_value : Stripe::PaymentIntentCustomer | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] customer Object to be assigned

Source
description

An arbitrary string attached to the object. Often useful for displaying to users.

Source
description=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] description Object to be assigned

Source
hash(hasher)

Generates #hash and #== methods from all fields #== @return [Bool] #hash calculates hash code according to all attributes. #hash @return [UInt64] Hash code

id

Unique identifier for the object.

Source
id=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] id Object to be assigned

Source
invoice
Source
invoice=(new_value : Stripe::PaymentIntentInvoice | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] invoice Object to be assigned

Source
last_payment_error
Source
last_payment_error=(new_value : Stripe::PaymentIntentLastPaymentError | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] last_payment_error Object to be assigned

Source
latest_charge
Source
latest_charge=(new_value : Stripe::PaymentIntentLatestCharge | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] latest_charge Object to be assigned

Source
list_invalid_properties

Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons

Source
livemode

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

Source
livemode=(new_value : Bool | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] livemode Object to be assigned

Source
metadata
Source
metadata=(new_value : Hash(String, String) | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] metadata Object to be assigned

Source
next_action
Source
next_action=(new_value : Stripe::PaymentIntentNextAction1 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] next_action Object to be assigned

Source
object

String representing the object's type. Objects of the same type share the same value.

Source
object=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] object Object to be assigned

Source
on_behalf_of
Source
on_behalf_of=(new_value : Stripe::PaymentIntentOnBehalfOf | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] on_behalf_of Object to be assigned

Source
payment_method
Source
payment_method=(new_value : Stripe::PaymentIntentPaymentMethod | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] payment_method Object to be assigned

Source
payment_method_configuration_details
Source
payment_method_configuration_details=(new_value : Stripe::PaymentIntentPaymentMethodConfigurationDetails | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] payment_method_configuration_details Object to be assigned

Source
payment_method_options
Source
payment_method_options=(new_value : Stripe::PaymentIntentPaymentMethodOptions1 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] payment_method_options Object to be assigned

Source
payment_method_types

The list of payment method types (e.g. card) that this PaymentIntent is allowed to use.

Source
payment_method_types=(new_value : Array(String) | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] payment_method_types Object to be assigned

Source
processing
Source
processing=(new_value : Stripe::PaymentIntentProcessing1 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] processing Object to be assigned

Source
receipt_email

Email address that the receipt for the resulting payment will be sent to. If receipt_email is specified for a payment in live mode, a receipt will be sent regardless of your email settings.

Source
receipt_email=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] receipt_email Object to be assigned

Source
review
Source
review=(new_value : Stripe::PaymentIntentReview | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] review Object to be assigned

Source
setup_future_usage

Indicates that you intend to make future payments with this PaymentIntent's payment method. If you provide a Customer with the PaymentIntent, you can use this parameter to attach the payment method to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still attach the payment method to a Customer after the transaction completes. If the payment method is card_present and isn't a digital wallet, Stripe creates and attaches a generated_card payment method representing the card to the Customer instead. When processing card payments, Stripe uses setup_future_usage to help you comply with regional legislation and network rules, such as SCA.

Source
setup_future_usage=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] setup_future_usage Object to be assigned

Source
shipping
Source
shipping=(new_value : Stripe::PaymentIntentShipping | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] shipping Object to be assigned

Source
source
Source
source=(new_value : Stripe::PaymentIntentSource | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] source Object to be assigned

Source
statement_descriptor

Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see the Statement Descriptor docs. Setting this value for a card charge returns an error. For card charges, set the statement_descriptor_suffix instead.

Source
statement_descriptor=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] statement_descriptor Object to be assigned

Source
statement_descriptor_suffix

Provides information about a card charge. Concatenated to the account's statement descriptor prefix to form the complete statement descriptor that appears on the customer's statement.

Source
statement_descriptor_suffix=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] statement_descriptor_suffix Object to be assigned

Source
status

Status of this PaymentIntent, one of requires_payment_method, requires_confirmation, requires_action, processing, requires_capture, canceled, or succeeded. Read more about each PaymentIntent status.

Source
status=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] status Object to be assigned

Source
transfer_data
Source
transfer_data=(new_value : Stripe::PaymentIntentTransferData | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] transfer_data Object to be assigned

Source
transfer_group

A string that identifies the resulting payment as part of a group. Learn more about the use case for connected accounts.

Source
transfer_group=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] transfer_group Object to be assigned

Source
valid?

Check to see if the all the properties in the model are valid @return true if the model is valid

Source