View Source Stripe.PaymentIntent (stripity_stripe v3.2.0)
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
Summary
Types
If this is an acss_debit
PaymentMethod, this hash contains details about the ACSS Debit payment method.
Shipping address.
When you enable this parameter, this PaymentIntent accepts payment methods that you enable in the Dashboard and that are compatible with this PaymentIntent's other parameters.
Configuration for the bank transfer funding type, if the funding_type
is set to bank_transfer
.
Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
Cartes Bancaires-specific 3DS fields.
This hash contains details about the customer acceptance of the Mandate.
Customer's date of birth
Configuration for the eu_bank_transfer funding type.
Additional fields for Financial Connections Session creation
If this is an ideal
PaymentMethod, this hash contains details about the iDEAL payment method.
Installment configuration for payments attempted on this PaymentIntent (Mexico Only).
Configuration options for setting up an eMandate for cards issued in India.
Network specific 3DS fields. Network specific arguments require an explicit card brand choice. The parameter `payment_method_options.card.network`` must be populated accordingly
Additional fields for network related functions
If this is a Mandate accepted online, this hash contains details about the online acceptance.
If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear in the payment_method property on the PaymentIntent.
Payment method-specific configuration for this PaymentIntent.
Options to configure Radar. See Radar Session for more information.
Shipping information for this PaymentIntent.
The payment_intent
type.
If 3D Secure authentication was performed with a third-party provider, the authentication details to use for this payment.
The parameters that you can use to automatically create a Transfer. Learn more about the use case for connected accounts.
If this is an us_bank_account
PaymentMethod, this hash contains details about the US bank account payment method.
Functions
Manually reconcile the remaining amount for a customer_balance
PaymentIntent.
You can cancel a PaymentIntent object when it’s in one of these statuses: requires_payment_method
, requires_capture
, requires_confirmation
, requires_action
or, in rare cases, processing
.
Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture
.
Confirm that your customer intends to pay with current or providedpayment method. Upon confirmation, the PaymentIntent will attempt to initiate
a payment.
If the selected payment method requires additional authentication steps, the
PaymentIntent will transition to the requires_action
status and
suggest additional actions via next_action
. If payment fails,
the PaymentIntent transitions to the requires_payment_method
status or the
canceled
status if the confirmation limit is reached. If
payment succeeds, the PaymentIntent will transition to the succeeded
status (or requires_capture
, if capture_method
is set to manual
).
If the confirmation_method
is automatic
, payment may be attempted
using our client SDKs
and the PaymentIntent’s client_secret.
After next_action
s are handled by the client, no additional
confirmation is required to complete the payment.
If the confirmation_method
is manual
, all payment attempts must be
initiated using a secret key.
If any actions are required for the payment, the PaymentIntent will
return to the requires_confirmation
state
after those actions are completed. Your server needs to then
explicitly re-confirm the PaymentIntent to initiate the next payment
attempt. Read the expanded documentation
to learn more about manual confirmation.
Creates a PaymentIntent object.
Perform an incremental authorization on an eligiblePaymentIntent. To be eligible, the
PaymentIntent’s status must be requires_capture
and
incremental_authorization_supported
must be true
.
Returns a list of PaymentIntents.
Retrieves the details of a PaymentIntent that has previously been created.
Search for PaymentIntents you’ve previously created using Stripe’s Search Query Language.Don’t use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India.
Updates properties on a PaymentIntent object without confirming.
Verifies microdeposits on a PaymentIntent object.
Types
@type acss_debit() :: %{ optional(:account_number) => binary(), optional(:institution_number) => binary(), optional(:transit_number) => binary() }
If this is an acss_debit
PaymentMethod, this hash contains details about the ACSS Debit payment method.
@type address() :: %{ optional(:city) => binary(), optional(:country) => binary(), optional(:line1) => binary(), optional(:line2) => binary(), optional(:postal_code) => binary(), optional(:state) => binary() }
Shipping address.
@type affirm() :: %{ optional(:capture_method) => :manual, optional(:preferred_locale) => binary(), optional(:setup_future_usage) => :none }
@type afterpay_clearpay() :: %{ optional(:capture_method) => :manual, optional(:reference) => binary(), optional(:setup_future_usage) => :none }
@type alipay() :: %{optional(:setup_future_usage) => :none | :off_session}
@type au_becs_debit() :: %{
optional(:setup_future_usage) => :none | :off_session | :on_session
}
@type automatic_payment_methods() :: %{ optional(:allow_redirects) => :always | :never, optional(:enabled) => boolean() }
When you enable this parameter, this PaymentIntent accepts payment methods that you enable in the Dashboard and that are compatible with this PaymentIntent's other parameters.
@type bacs_debit() :: %{
optional(:setup_future_usage) => :none | :off_session | :on_session
}
@type bancontact() :: %{
optional(:preferred_language) => :de | :en | :fr | :nl,
optional(:setup_future_usage) => :none | :off_session
}
@type bank_transfer() :: %{ optional(:eu_bank_transfer) => eu_bank_transfer(), optional(:requested_address_types) => [ :aba | :iban | :sepa | :sort_code | :spei | :swift | :zengin ], optional(:type) => :eu_bank_transfer | :gb_bank_transfer | :jp_bank_transfer | :mx_bank_transfer | :us_bank_transfer }
Configuration for the bank transfer funding type, if the funding_type
is set to bank_transfer
.
@type billing_details() :: %{ optional(:address) => address() | binary(), optional(:email) => binary() | binary(), optional(:name) => binary() | binary(), optional(:phone) => binary() | binary() }
Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
@type blik() :: %{optional(:code) => binary()}
@type boleto() :: %{ optional(:expires_after_days) => integer(), optional(:setup_future_usage) => :none | :off_session | :on_session }
@type card() :: %{ optional(:capture_method) => :manual, optional(:cvc_token) => binary(), optional(:installments) => installments(), optional(:mandate_options) => mandate_options(), optional(:moto) => boolean(), optional(:network) => :amex | :cartes_bancaires | :diners | :discover | :eftpos_au | :interac | :jcb | :mastercard | :unionpay | :unknown | :visa, optional(:request_extended_authorization) => :if_available | :never, optional(:request_incremental_authorization) => :if_available | :never, optional(:request_multicapture) => :if_available | :never, optional(:request_overcapture) => :if_available | :never, optional(:request_three_d_secure) => :any | :automatic | :challenge, optional(:setup_future_usage) => :none | :off_session | :on_session, optional(:statement_descriptor_suffix_kana) => binary() | binary(), optional(:statement_descriptor_suffix_kanji) => binary() | binary(), optional(:three_d_secure) => three_d_secure() }
@type cartes_bancaires() :: %{ optional(:cb_avalgo) => :"0" | :"1" | :"2" | :"3" | :"4" | :A, optional(:cb_exemption) => binary(), optional(:cb_score) => integer() }
Cartes Bancaires-specific 3DS fields.
@type cashapp() :: %{
optional(:capture_method) => :manual,
optional(:setup_future_usage) => :none | :off_session | :on_session
}
@type customer_acceptance() :: %{ optional(:accepted_at) => integer(), optional(:offline) => map(), optional(:online) => online(), optional(:type) => :offline | :online }
This hash contains details about the customer acceptance of the Mandate.
@type customer_balance() :: %{ optional(:bank_transfer) => bank_transfer(), optional(:funding_type) => :bank_transfer, optional(:setup_future_usage) => :none }
@type dob() :: %{ optional(:day) => integer(), optional(:month) => integer(), optional(:year) => integer() }
Customer's date of birth
@type eps() :: %{optional(:setup_future_usage) => :none}
@type eu_bank_transfer() :: %{optional(:country) => binary()}
Configuration for the eu_bank_transfer funding type.
@type financial_connections() :: %{ optional(:permissions) => [ :balances | :ownership | :payment_method | :transactions ], optional(:prefetch) => [:balances | :transactions], optional(:return_url) => binary() }
Additional fields for Financial Connections Session creation
@type fpx() :: %{optional(:setup_future_usage) => :none}
@type giropay() :: %{optional(:setup_future_usage) => :none}
@type grabpay() :: %{optional(:setup_future_usage) => :none}
@type ideal() :: %{
optional(:bank) =>
:abn_amro
| :asn_bank
| :bunq
| :handelsbanken
| :ing
| :knab
| :moneyou
| :n26
| :rabobank
| :regiobank
| :revolut
| :sns_bank
| :triodos_bank
| :van_lanschot
| :yoursafe
}
If this is an ideal
PaymentMethod, this hash contains details about the iDEAL payment method.
Installment configuration for payments attempted on this PaymentIntent (Mexico Only).
For more information, see the installments integration guide.
@type klarna() :: %{
optional(:capture_method) => :manual,
optional(:preferred_locale) =>
:"cs-CZ"
| :"da-DK"
| :"de-AT"
| :"de-CH"
| :"de-DE"
| :"el-GR"
| :"en-AT"
| :"en-AU"
| :"en-BE"
| :"en-CA"
| :"en-CH"
| :"en-CZ"
| :"en-DE"
| :"en-DK"
| :"en-ES"
| :"en-FI"
| :"en-FR"
| :"en-GB"
| :"en-GR"
| :"en-IE"
| :"en-IT"
| :"en-NL"
| :"en-NO"
| :"en-NZ"
| :"en-PL"
| :"en-PT"
| :"en-SE"
| :"en-US"
| :"es-ES"
| :"es-US"
| :"fi-FI"
| :"fr-BE"
| :"fr-CA"
| :"fr-CH"
| :"fr-FR"
| :"it-CH"
| :"it-IT"
| :"nb-NO"
| :"nl-BE"
| :"nl-NL"
| :"pl-PL"
| :"pt-PT"
| :"sv-FI"
| :"sv-SE",
optional(:setup_future_usage) => :none
}
@type link() :: %{ optional(:capture_method) => :manual, optional(:persistent_token) => binary(), optional(:setup_future_usage) => :none | :off_session }
@type mandate_data() :: %{optional(:customer_acceptance) => customer_acceptance()}
@type mandate_options() :: %{ optional(:amount) => integer(), optional(:amount_type) => :fixed | :maximum, optional(:description) => binary(), optional(:end_date) => integer(), optional(:interval) => :day | :month | :sporadic | :week | :year, optional(:interval_count) => integer(), optional(:reference) => binary(), optional(:start_date) => integer(), optional(:supported_types) => [:india] }
Configuration options for setting up an eMandate for cards issued in India.
@type network_options() :: %{optional(:cartes_bancaires) => cartes_bancaires()}
Network specific 3DS fields. Network specific arguments require an explicit card brand choice. The parameter `payment_method_options.card.network`` must be populated accordingly
@type networks() :: %{optional(:requested) => [:ach | :us_domestic_wire]}
Additional fields for network related functions
If this is a Mandate accepted online, this hash contains details about the online acceptance.
@type oxxo() :: %{ optional(:expires_after_days) => integer(), optional(:setup_future_usage) => :none }
@type p24() :: %{ optional(:setup_future_usage) => :none, optional(:tos_shown_and_accepted) => boolean() }
@type payment_method_data() :: %{ optional(:pix) => map(), optional(:fpx) => fpx(), optional(:affirm) => map(), optional(:acss_debit) => acss_debit(), optional(:bacs_debit) => bacs_debit(), optional(:alipay) => map(), optional(:giropay) => map(), optional(:ideal) => ideal(), optional(:revolut_pay) => map(), optional(:radar_options) => radar_options(), optional(:metadata) => %{optional(binary()) => binary()}, optional(:link) => map(), optional(:promptpay) => map(), optional(:cashapp) => map(), optional(:oxxo) => map(), optional(:interac_present) => map(), optional(:us_bank_account) => us_bank_account(), optional(:zip) => map(), optional(:paypal) => map(), optional(:boleto) => boleto(), optional(:konbini) => map(), optional(:billing_details) => billing_details(), optional(:blik) => map(), optional(:wechat_pay) => map(), optional(:sofort) => sofort(), optional(:p24) => p24(), optional(:afterpay_clearpay) => map(), optional(:type) => :acss_debit | :affirm | :afterpay_clearpay | :alipay | :au_becs_debit | :bacs_debit | :bancontact | :blik | :boleto | :cashapp | :customer_balance | :eps | :fpx | :giropay | :grabpay | :ideal | :klarna | :konbini | :link | :oxxo | :p24 | :paynow | :paypal | :pix | :promptpay | :revolut_pay | :sepa_debit | :sofort | :us_bank_account | :wechat_pay | :zip, optional(:grabpay) => map(), optional(:bancontact) => map(), optional(:au_becs_debit) => au_becs_debit(), optional(:customer_balance) => map(), optional(:sepa_debit) => sepa_debit(), optional(:klarna) => klarna(), optional(:paynow) => map(), optional(:eps) => eps() }
If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear in the payment_method property on the PaymentIntent.
@type payment_method_options() :: %{ optional(:pix) => pix() | binary(), optional(:fpx) => fpx() | binary(), optional(:affirm) => affirm() | binary(), optional(:acss_debit) => acss_debit() | binary(), optional(:bacs_debit) => bacs_debit() | binary(), optional(:alipay) => alipay() | binary(), optional(:giropay) => giropay() | binary(), optional(:ideal) => ideal() | binary(), optional(:revolut_pay) => revolut_pay() | binary(), optional(:card) => card() | binary(), optional(:link) => link() | binary(), optional(:promptpay) => promptpay() | binary(), optional(:cashapp) => cashapp() | binary(), optional(:oxxo) => oxxo() | binary(), optional(:interac_present) => map() | binary(), optional(:us_bank_account) => us_bank_account() | binary(), optional(:zip) => zip() | binary(), optional(:paypal) => paypal() | binary(), optional(:boleto) => boleto() | binary(), optional(:konbini) => konbini() | binary(), optional(:blik) => blik() | binary(), optional(:wechat_pay) => wechat_pay() | binary(), optional(:sofort) => sofort() | binary(), optional(:p24) => p24() | binary(), optional(:afterpay_clearpay) => afterpay_clearpay() | binary(), optional(:grabpay) => grabpay() | binary(), optional(:bancontact) => bancontact() | binary(), optional(:au_becs_debit) => au_becs_debit() | binary(), optional(:customer_balance) => customer_balance() | binary(), optional(:card_present) => card_present() | binary(), optional(:sepa_debit) => sepa_debit() | binary(), optional(:klarna) => klarna() | binary(), optional(:paynow) => paynow() | binary(), optional(:eps) => eps() | binary() }
Payment method-specific configuration for this PaymentIntent.
@type paynow() :: %{optional(:setup_future_usage) => :none}
@type paypal() :: %{ optional(:capture_method) => :manual, optional(:preferred_locale) => :"cs-CZ" | :"da-DK" | :"de-AT" | :"de-DE" | :"de-LU" | :"el-GR" | :"en-GB" | :"en-US" | :"es-ES" | :"fi-FI" | :"fr-BE" | :"fr-FR" | :"fr-LU" | :"hu-HU" | :"it-IT" | :"nl-BE" | :"nl-NL" | :"pl-PL" | :"pt-PT" | :"sk-SK" | :"sv-SE", optional(:reference) => binary(), optional(:risk_correlation_id) => binary(), optional(:setup_future_usage) => :none | :off_session }
@type plan() :: %{ optional(:count) => integer(), optional(:interval) => :month, optional(:type) => :fixed_count }
@type promptpay() :: %{optional(:setup_future_usage) => :none}
@type radar_options() :: %{optional(:session) => binary()}
Options to configure Radar. See Radar Session for more information.
@type revolut_pay() :: %{optional(:setup_future_usage) => :none | :off_session}
@type sepa_debit() :: %{ optional(:mandate_options) => map(), optional(:setup_future_usage) => :none | :off_session | :on_session }
@type shipping() :: %{ optional(:address) => address(), optional(:carrier) => binary(), optional(:name) => binary(), optional(:phone) => binary(), optional(:tracking_number) => binary() }
Shipping information for this PaymentIntent.
@type sofort() :: %{
optional(:preferred_language) => :de | :en | :es | :fr | :it | :nl | :pl,
optional(:setup_future_usage) => :none | :off_session
}
@type t() :: %Stripe.PaymentIntent{ amount: integer(), amount_capturable: integer(), amount_details: term(), amount_received: integer(), application: (binary() | term()) | nil, application_fee_amount: integer() | nil, automatic_payment_methods: term() | nil, canceled_at: integer() | nil, cancellation_reason: binary() | nil, capture_method: binary(), client_secret: binary() | nil, confirmation_method: binary(), created: integer(), currency: binary(), customer: (binary() | Stripe.Customer.t() | Stripe.DeletedCustomer.t()) | nil, description: binary() | nil, id: binary(), invoice: (binary() | Stripe.Invoice.t()) | nil, last_payment_error: Stripe.ApiErrors.t() | nil, latest_charge: (binary() | Stripe.Charge.t()) | nil, livemode: boolean(), metadata: term(), next_action: term() | nil, object: binary(), on_behalf_of: (binary() | Stripe.Account.t()) | nil, payment_method: (binary() | Stripe.PaymentMethod.t()) | nil, payment_method_configuration_details: term() | nil, payment_method_options: term() | nil, payment_method_types: term(), processing: term() | nil, receipt_email: binary() | nil, review: (binary() | Stripe.Review.t()) | nil, setup_future_usage: binary() | nil, shipping: term() | nil, source: (binary() | Stripe.PaymentSource.t() | Stripe.DeletedPaymentSource.t()) | nil, statement_descriptor: binary() | nil, statement_descriptor_suffix: binary() | nil, status: binary(), transfer_data: term() | nil, transfer_group: binary() | nil }
The payment_intent
type.
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).amount_capturable
Amount that can be captured from this PaymentIntent.amount_details
amount_received
Amount that this PaymentIntent collects.application
ID of the Connect application that created the PaymentIntent.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.automatic_payment_methods
Settings to configure compatible payment methods from the Stripe Dashboardcanceled_at
Populated whenstatus
iscanceled
, this is the time at which the PaymentIntent was canceled. Measured in seconds since the Unix epoch.cancellation_reason
Reason for cancellation of this PaymentIntent, either user-provided (duplicate
,fraudulent
,requested_by_customer
, orabandoned
) or generated by Stripe internally (failed_invoice
,void_invoice
, orautomatic
).capture_method
Controls when the funds will be captured from the customer's account.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.
confirmation_method
Describes whether we can confirm this PaymentIntent automatically, or if it requires customer action to confirm the payment.created
Time at which the object was created. Measured in seconds since the Unix epoch.currency
Three-letter ISO currency code, in lowercase. Must be a supported currency.customer
ID of the Customer this PaymentIntent belongs to, if one exists.
Payment methods attached to other Customers cannot be used with this PaymentIntent.
If present in combination with setup_future_usage, this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete.
description
An arbitrary string attached to the object. Often useful for displaying to users.id
Unique identifier for the object.invoice
ID of the invoice that created this PaymentIntent, if it exists.last_payment_error
The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason.latest_charge
The latest charge created by this PaymentIntent.livemode
Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode.metadata
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. Learn more about storing information in metadata.next_action
If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source.object
String representing the object's type. Objects of the same type share the same value.on_behalf_of
The account (if any) for which the funds of the PaymentIntent are intended. See the PaymentIntents use case for connected accounts for details.payment_method
ID of the payment method used in this PaymentIntent.payment_method_configuration_details
Information about the payment method configuration used for this PaymentIntent.payment_method_options
Payment-method-specific configuration for this PaymentIntent.payment_method_types
The list of payment method types (e.g. card) that this PaymentIntent is allowed to use.processing
If present, this property tells you about the processing state of the payment.receipt_email
Email address that the receipt for the resulting payment will be sent to. Ifreceipt_email
is specified for a payment in live mode, a receipt will be sent regardless of your email settings.review
ID of the review associated with this PaymentIntent, if any.setup_future_usage
Indicates that you intend to make future payments with this PaymentIntent's payment method.
Providing this parameter will attach the payment method to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be attached to a Customer after the transaction completes.
When processing card payments, Stripe also uses setup_future_usage
to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA.
shipping
Shipping information for this PaymentIntent.source
This is a legacy field that will be removed in the future. It is the ID of the Source object that is associated with this PaymentIntent, if one was supplied.statement_descriptor
For card charges, use statement_descriptor_suffix. Otherwise, you can use this value as the complete description of a charge on your customers' statements. It must contain at least one letter and be 1–22 characters long.statement_descriptor_suffix
Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.status
Status of this PaymentIntent, one ofrequires_payment_method
,requires_confirmation
,requires_action
,processing
,requires_capture
,canceled
, orsucceeded
. Read more about each PaymentIntent status.transfer_data
The data that automatically creates a Transfer after the payment finalizes. Learn more about the use case for connected accounts.transfer_group
A string that identifies the resulting payment as part of a group. Learn more about the use case for connected accounts.
@type three_d_secure() :: %{ optional(:ares_trans_status) => :A | :C | :I | :N | :R | :U | :Y, optional(:cryptogram) => binary(), optional(:electronic_commerce_indicator) => :"01" | :"02" | :"05" | :"06" | :"07", optional(:exemption_indicator) => :low_risk | :none, optional(:network_options) => network_options(), optional(:requestor_challenge_indicator) => binary(), optional(:transaction_id) => binary(), optional(:version) => :"1.0.2" | :"2.1.0" | :"2.2.0" }
If 3D Secure authentication was performed with a third-party provider, the authentication details to use for this payment.
The parameters that you can use to automatically create a Transfer. Learn more about the use case for connected accounts.
@type us_bank_account() :: %{ optional(:account_holder_type) => :company | :individual, optional(:account_number) => binary(), optional(:account_type) => :checking | :savings, optional(:financial_connections_account) => binary(), optional(:routing_number) => binary() }
If this is an us_bank_account
PaymentMethod, this hash contains details about the US bank account payment method.
@type wechat_pay() :: %{ optional(:app_id) => binary(), optional(:client) => :android | :ios | :web, optional(:setup_future_usage) => :none }
@type zip() :: %{optional(:setup_future_usage) => :none}
Functions
@spec apply_customer_balance( intent :: binary(), params :: %{ optional(:amount) => integer(), optional(:currency) => binary(), optional(:expand) => [binary()] }, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Manually reconcile the remaining amount for a customer_balance
PaymentIntent.
Details
- Method:
post
- Path:
/v1/payment_intents/{intent}/apply_customer_balance
@spec cancel( intent :: binary(), params :: %{ optional(:cancellation_reason) => :abandoned | :duplicate | :fraudulent | :requested_by_customer, optional(:expand) => [binary()] }, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
You can cancel a PaymentIntent object when it’s in one of these statuses: requires_payment_method
, requires_capture
, requires_confirmation
, requires_action
or, in rare cases, processing
.
After it’s canceled, no additional charges are made by the PaymentIntent and any operations on the PaymentIntent fail with an error. For PaymentIntents with a status
of requires_capture
, the remaining amount_capturable
is automatically refunded.
You can’t cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session instead.
Details
- Method:
post
- Path:
/v1/payment_intents/{intent}/cancel
@spec capture( intent :: binary(), params :: %{ optional(:amount_to_capture) => integer(), optional(:application_fee_amount) => integer(), optional(:expand) => [binary()], optional(:final_capture) => boolean(), optional(:metadata) => %{optional(binary()) => binary()} | binary(), optional(:statement_descriptor) => binary(), optional(:statement_descriptor_suffix) => binary(), optional(:transfer_data) => transfer_data() }, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture
.
Uncaptured PaymentIntents are cancelled a set number of days (7 by default) after their creation.
Learn more about separate authorization and capture.
Details
- Method:
post
- Path:
/v1/payment_intents/{intent}/capture
@spec confirm( intent :: binary(), params :: %{ optional(:capture_method) => :automatic | :automatic_async | :manual, optional(:error_on_requires_action) => boolean(), optional(:expand) => [binary()], optional(:mandate) => binary(), optional(:mandate_data) => mandate_data() | binary() | mandate_data(), optional(:off_session) => boolean() | :one_off | :recurring, optional(:payment_method) => binary(), optional(:payment_method_data) => payment_method_data(), optional(:payment_method_options) => payment_method_options(), optional(:radar_options) => radar_options(), optional(:receipt_email) => binary() | binary(), optional(:return_url) => binary(), optional(:setup_future_usage) => :off_session | :on_session, optional(:shipping) => shipping() | binary(), optional(:use_stripe_sdk) => boolean() }, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Confirm that your customer intends to pay with current or providedpayment method. Upon confirmation, the PaymentIntent will attempt to initiate
a payment.
If the selected payment method requires additional authentication steps, the
PaymentIntent will transition to the requires_action
status and
suggest additional actions via next_action
. If payment fails,
the PaymentIntent transitions to the requires_payment_method
status or the
canceled
status if the confirmation limit is reached. If
payment succeeds, the PaymentIntent will transition to the succeeded
status (or requires_capture
, if capture_method
is set to manual
).
If the confirmation_method
is automatic
, payment may be attempted
using our client SDKs
and the PaymentIntent’s client_secret.
After next_action
s are handled by the client, no additional
confirmation is required to complete the payment.
If the confirmation_method
is manual
, all payment attempts must be
initiated using a secret key.
If any actions are required for the payment, the PaymentIntent will
return to the requires_confirmation
state
after those actions are completed. Your server needs to then
explicitly re-confirm the PaymentIntent to initiate the next payment
attempt. Read the expanded documentation
to learn more about manual confirmation.
@spec create( params :: %{ optional(:amount) => integer(), optional(:application_fee_amount) => integer(), optional(:automatic_payment_methods) => automatic_payment_methods(), optional(:capture_method) => :automatic | :automatic_async | :manual, optional(:confirm) => boolean(), optional(:confirmation_method) => :automatic | :manual, optional(:currency) => binary(), optional(:customer) => binary(), optional(:description) => binary(), optional(:error_on_requires_action) => boolean(), optional(:expand) => [binary()], optional(:mandate) => binary(), optional(:mandate_data) => mandate_data() | binary(), optional(:metadata) => %{optional(binary()) => binary()}, optional(:off_session) => boolean() | :one_off | :recurring, optional(:on_behalf_of) => binary(), optional(:payment_method) => binary(), optional(:payment_method_configuration) => binary(), optional(:payment_method_data) => payment_method_data(), optional(:payment_method_options) => payment_method_options(), optional(:payment_method_types) => [binary()], optional(:radar_options) => radar_options(), optional(:receipt_email) => binary(), optional(:return_url) => binary(), optional(:setup_future_usage) => :off_session | :on_session, optional(:shipping) => shipping(), optional(:statement_descriptor) => binary(), optional(:statement_descriptor_suffix) => binary(), optional(:transfer_data) => transfer_data(), optional(:transfer_group) => binary(), optional(:use_stripe_sdk) => boolean() }, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Creates a PaymentIntent object.
After the PaymentIntent is created, attach a payment method and confirmto continue the payment. Learn more about the available payment flows with the Payment Intents API.
When you use confirm=true
during creation, it’s equivalent to creatingand confirming the PaymentIntent in the same call. You can use any parameters
available in the confirm API when you supply
confirm=true
.
@spec increment_authorization( intent :: binary(), params :: %{ optional(:amount) => integer(), optional(:application_fee_amount) => integer(), optional(:description) => binary(), optional(:expand) => [binary()], optional(:metadata) => %{optional(binary()) => binary()}, optional(:statement_descriptor) => binary(), optional(:transfer_data) => transfer_data() }, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Perform an incremental authorization on an eligiblePaymentIntent. To be eligible, the
PaymentIntent’s status must be requires_capture
and
incremental_authorization_supported
must be true
.
Incremental authorizations attempt to increase the authorized amount onyour customer’s card to the new, higher amount
provided. Similar to the
initial authorization, incremental authorizations can be declined. A
single PaymentIntent can call this endpoint multiple times to further
increase the authorized amount.
If the incremental authorization succeeds, the PaymentIntent objectreturns with the updated amount. If the incremental authorization fails, a card_declined error returns, and no other fields on the PaymentIntent or Charge update. The PaymentIntent object remains capturable for the previously authorized amount.
Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines.After it’s captured, a PaymentIntent can no longer be incremented.
Learn more about incremental authorizations.
#### Details * Method: `post` * Path: `/v1/payment_intents/{intent}/increment_authorization`@spec list( params :: %{ optional(:created) => created() | integer(), optional(:customer) => binary(), optional(:ending_before) => binary(), optional(:expand) => [binary()], optional(:limit) => integer(), optional(:starting_after) => binary() }, opts :: Keyword.t() ) :: {:ok, Stripe.List.t(t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Returns a list of PaymentIntents.
Details
- Method:
get
- Path:
/v1/payment_intents
@spec retrieve( intent :: binary(), params :: %{ optional(:client_secret) => binary(), optional(:expand) => [binary()] }, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Retrieves the details of a PaymentIntent that has previously been created.
You can retrieve a PaymentIntent client-side using a publishable key when the client_secret
is in the query string.
If you retrieve a PaymentIntent with a publishable key, it only returns a subset of properties. Refer to the payment intent object reference for more details.
Details
- Method:
get
- Path:
/v1/payment_intents/{intent}
@spec search( params :: %{ optional(:expand) => [binary()], optional(:limit) => integer(), optional(:page) => binary(), optional(:query) => binary() }, opts :: Keyword.t() ) :: {:ok, Stripe.SearchResult.t(t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Search for PaymentIntents you’ve previously created using Stripe’s Search Query Language.Don’t use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India.
#### Details * Method: `get` * Path: `/v1/payment_intents/search`@spec update( intent :: binary(), params :: %{ optional(:amount) => integer(), optional(:application_fee_amount) => integer() | binary(), optional(:capture_method) => :automatic | :automatic_async | :manual, optional(:currency) => binary(), optional(:customer) => binary(), optional(:description) => binary(), optional(:expand) => [binary()], optional(:metadata) => %{optional(binary()) => binary()} | binary(), optional(:payment_method) => binary(), optional(:payment_method_configuration) => binary(), optional(:payment_method_data) => payment_method_data(), optional(:payment_method_options) => payment_method_options(), optional(:payment_method_types) => [binary()], optional(:receipt_email) => binary() | binary(), optional(:setup_future_usage) => :off_session | :on_session, optional(:shipping) => shipping() | binary(), optional(:statement_descriptor) => binary(), optional(:statement_descriptor_suffix) => binary(), optional(:transfer_data) => transfer_data(), optional(:transfer_group) => binary() }, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Updates properties on a PaymentIntent object without confirming.
Depending on which properties you update, you might need to confirm thePaymentIntent again. For example, updating the payment_method
always requires you to confirm the PaymentIntent again. If you prefer to
update and confirm at the same time, we recommend updating properties through
the confirm API instead.
@spec verify_microdeposits( intent :: binary(), params :: %{ optional(:amounts) => [integer()], optional(:descriptor_code) => binary(), optional(:expand) => [binary()] }, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Verifies microdeposits on a PaymentIntent object.
Details
- Method:
post
- Path:
/v1/payment_intents/{intent}/verify_microdeposits