View Source Stripe.PaymentIntent (Striped v0.5.0) (generated)

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.

Link to this section Summary

Types

If this is an acss_debit PaymentMethod, this hash contains details about the ACSS Debit payment method.

Shipping address.

When enabled, this PaymentIntent will accept payment methods that you have enabled in the Dashboard and 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.

This hash contains details about the customer acceptance of the Mandate.

Customer's date of birth

Additional fields for Financial Connections Session creation

Installment configuration for payments attempted on this PaymentIntent (Mexico Only).

This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.

Configuration options for setting up an eMandate for cards issued in India.

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.

t()

The payment_intent type.

The parameters used to automatically create a Transfer when the payment succeeds. For more information, see the PaymentIntents use case for connected accounts.

Functions

Manually reconcile the remaining amount for a customer_balance PaymentIntent.

A PaymentIntent object can be canceled when it is in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action, or 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 will transition to the requires_payment_method status. 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_actions 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.

Link to this section 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(: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
}
Link to this type

automatic_payment_methods()

View Source
@type automatic_payment_methods() :: %{optional(:enabled) => boolean()}

When enabled, this PaymentIntent will accept payment methods that you have enabled in the Dashboard and 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) => [
    :iban | :sepa | :sort_code | :spei | :zengin
  ],
  optional(:type) =>
    :eu_bank_transfer
    | :gb_bank_transfer
    | :jp_bank_transfer
    | :mx_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(),
  optional(:phone) => 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
    | :interac
    | :jcb
    | :mastercard
    | :unionpay
    | :unknown
    | :visa,
  optional(:request_three_d_secure) => :any | :automatic,
  optional(:setup_future_usage) => :none | :off_session | :on_session,
  optional(:statement_descriptor_suffix_kana) => binary() | binary(),
  optional(:statement_descriptor_suffix_kanji) => binary() | binary()
}
@type card_present() :: %{
  optional(:request_extended_authorization) => boolean(),
  optional(:request_incremental_authorization_support) => boolean()
}
@type created() :: %{
  optional(:gt) => integer(),
  optional(:gte) => integer(),
  optional(:lt) => integer(),
  optional(:lte) => integer()
}
@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()}
Link to this type

financial_connections()

View Source
@type financial_connections() :: %{
  optional(:permissions) => [
    :balances | :ownership | :payment_method | :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(:setup_future_usage) => :none | :off_session}
@type installments() :: %{
  optional(:enabled) => boolean(),
  optional(:plan) => plan() | binary()
}

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) =>
    :"da-DK"
    | :"de-AT"
    | :"de-CH"
    | :"de-DE"
    | :"en-AT"
    | :"en-AU"
    | :"en-BE"
    | :"en-CA"
    | :"en-CH"
    | :"en-DE"
    | :"en-DK"
    | :"en-ES"
    | :"en-FI"
    | :"en-FR"
    | :"en-GB"
    | :"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 konbini() :: %{
  optional(:confirmation_number) => binary(),
  optional(:expires_after_days) => integer() | binary(),
  optional(:expires_at) => integer() | binary(),
  optional(:product_description) => binary(),
  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()}

This hash contains details about the Mandate to create. This parameter can only be used with confirm=true.

@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 networks() :: %{optional(:requested) => [:ach | :us_domestic_wire]}

Additional fields for network related functions

@type online() :: %{
  optional(:ip_address) => binary(),
  optional(:user_agent) => binary()
}

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(:acss_debit) => acss_debit(),
  optional(:affirm) => map(),
  optional(:afterpay_clearpay) => map(),
  optional(:alipay) => map(),
  optional(:au_becs_debit) => au_becs_debit(),
  optional(:bacs_debit) => bacs_debit(),
  optional(:bancontact) => map(),
  optional(:billing_details) => billing_details(),
  optional(:blik) => map(),
  optional(:boleto) => boleto(),
  optional(:customer_balance) => map(),
  optional(:eps) => eps(),
  optional(:fpx) => fpx(),
  optional(:giropay) => map(),
  optional(:grabpay) => map(),
  optional(:ideal) => ideal(),
  optional(:interac_present) => map(),
  optional(:klarna) => klarna(),
  optional(:konbini) => map(),
  optional(:link) => map(),
  optional(:metadata) => %{optional(binary()) => binary()},
  optional(:oxxo) => map(),
  optional(:p24) => p24(),
  optional(:paynow) => map(),
  optional(:pix) => map(),
  optional(:promptpay) => map(),
  optional(:radar_options) => radar_options(),
  optional(:sepa_debit) => sepa_debit(),
  optional(:sofort) => sofort(),
  optional(:type) =>
    :acss_debit
    | :affirm
    | :afterpay_clearpay
    | :alipay
    | :au_becs_debit
    | :bacs_debit
    | :bancontact
    | :blik
    | :boleto
    | :customer_balance
    | :eps
    | :fpx
    | :giropay
    | :grabpay
    | :ideal
    | :klarna
    | :konbini
    | :link
    | :oxxo
    | :p24
    | :paynow
    | :pix
    | :promptpay
    | :sepa_debit
    | :sofort
    | :us_bank_account
    | :wechat_pay,
  optional(:us_bank_account) => us_bank_account(),
  optional(:wechat_pay) => map()
}

If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear in the payment_method property on the PaymentIntent.

Link to this type

payment_method_options()

View Source
@type payment_method_options() :: %{
  optional(:acss_debit) => acss_debit() | binary(),
  optional(:affirm) => affirm() | binary(),
  optional(:afterpay_clearpay) => afterpay_clearpay() | binary(),
  optional(:alipay) => alipay() | binary(),
  optional(:au_becs_debit) => au_becs_debit() | binary(),
  optional(:bacs_debit) => bacs_debit() | binary(),
  optional(:bancontact) => bancontact() | binary(),
  optional(:blik) => blik() | binary(),
  optional(:boleto) => boleto() | binary(),
  optional(:card) => card() | binary(),
  optional(:card_present) => card_present() | binary(),
  optional(:customer_balance) => customer_balance() | binary(),
  optional(:eps) => eps() | binary(),
  optional(:fpx) => fpx() | binary(),
  optional(:giropay) => giropay() | binary(),
  optional(:grabpay) => grabpay() | binary(),
  optional(:ideal) => ideal() | binary(),
  optional(:interac_present) => map() | binary(),
  optional(:klarna) => klarna() | binary(),
  optional(:konbini) => konbini() | binary(),
  optional(:link) => link() | binary(),
  optional(:oxxo) => oxxo() | binary(),
  optional(:p24) => p24() | binary(),
  optional(:paynow) => paynow() | binary(),
  optional(:pix) => pix() | binary(),
  optional(:promptpay) => promptpay() | binary(),
  optional(:sepa_debit) => sepa_debit() | binary(),
  optional(:sofort) => sofort() | binary(),
  optional(:us_bank_account) => us_bank_account() | binary(),
  optional(:wechat_pay) => wechat_pay() | binary()
}

Payment-method-specific configuration for this PaymentIntent.

@type paynow() :: %{optional(:setup_future_usage) => :none}
@type pix() :: %{
  optional(:expires_after_seconds) => integer(),
  optional(:expires_at) => integer(),
  optional(:setup_future_usage) => :none
}
@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 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_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.

  • 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.

  • payment_method ID of the payment method used in this PaymentIntent.
  • livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode.
  • processing If present, this property tells you about the processing state of the payment.
  • capture_method Controls when the funds will be captured from the customer's account.
  • payment_method_options Payment-method-specific configuration for this PaymentIntent.
  • amount_received Amount that was collected by this PaymentIntent.
  • 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. For more information, see the documentation.
  • description An arbitrary string attached to the object. Often useful for displaying to users.
  • payment_method_types The list of payment method types (e.g. card) that this PaymentIntent is allowed to use.
  • amount_capturable Amount that can be captured from this PaymentIntent.
  • review ID of the review associated with this PaymentIntent, if any.
  • confirmation_method
  • 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.
  • 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.
  • 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.

  • 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).
  • invoice ID of the invoice that created this PaymentIntent, if it exists.
  • automatic_payment_methods Settings to configure compatible payment methods from the Stripe Dashboard
  • statement_descriptor For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.
  • latest_charge The latest charge created by this payment intent.
  • application ID of the Connect application that created the PaymentIntent.
  • 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.

  • 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.
  • object String representing the object's type. Objects of the same type share the same value.
  • 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.
  • 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.
  • canceled_at Populated when status is canceled, this is the time at which the PaymentIntent was canceled. Measured in seconds since the Unix epoch.
  • currency Three-letter ISO currency code, in lowercase. Must be a supported currency.
  • created Time at which the object was created. Measured in seconds since the Unix epoch.
  • 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).
  • 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.
  • transfer_group A string that identifies the resulting payment as part of a group. See the PaymentIntents use case for connected accounts for details.
  • amount_details
  • 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.
  • 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.
  • transfer_data The data with which to automatically create a Transfer when the payment is finalized. See the PaymentIntents use case for connected accounts for details.
  • id Unique identifier for the object.
  • shipping Shipping information for this PaymentIntent.
@type transfer_data() :: %{
  optional(:amount) => integer(),
  optional(:destination) => binary()
}

The parameters used to automatically create a Transfer when the payment succeeds. For more information, see the PaymentIntents use case for connected accounts.

@type us_bank_account() :: %{
  optional(:financial_connections) => financial_connections(),
  optional(:networks) => networks(),
  optional(:setup_future_usage) => :none | :off_session | :on_session,
  optional(:verification_method) => :automatic | :instant | :microdeposits
}
@type wechat_pay() :: %{
  optional(:app_id) => binary(),
  optional(:client) => :android | :ios | :web,
  optional(:setup_future_usage) => :none
}

Link to this section Functions

Link to this function

apply_customer_balance(client, intent, params \\ %{}, opts \\ [])

View Source
@spec apply_customer_balance(
  client :: Stripe.t(),
  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
Link to this function

cancel(client, intent, params \\ %{}, opts \\ [])

View Source
@spec cancel(
  client :: Stripe.t(),
  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()}

A PaymentIntent object can be canceled when it is in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action, or processing..

Once canceled, no additional charges will be made by the PaymentIntent and any operations on the PaymentIntent will fail with an error. For PaymentIntents with status=’requires_capture’, the remaining amount_capturable will automatically be refunded..

You cannot cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session instea.

Details

  • Method: post
  • Path: /v1/payment_intents/{intent}/cancel
Link to this function

capture(client, intent, params \\ %{}, opts \\ [])

View Source
@spec capture(
  client :: Stripe.t(),
  intent :: binary(),
  params :: %{
    optional(:amount_to_capture) => integer(),
    optional(:application_fee_amount) => integer(),
    optional(:expand) => [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 will be canceled a set number of days after they are created (7 by default).

Learn more about separate authorization and capture.

Details

  • Method: post
  • Path: /v1/payment_intents/{intent}/capture
Link to this function

confirm(client, intent, params \\ %{}, opts \\ [])

View Source
@spec confirm(
  client :: Stripe.t(),
  intent :: binary(),
  params :: %{
    optional(:capture_method) => :automatic | :manual,
    optional(:error_on_requires_action) => boolean(),
    optional(:expand) => [binary()],
    optional(:mandate) => binary(),
    optional(:mandate_data) => mandate_data() | 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 will transition to the requires_payment_method status. 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_actions 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.

Details

  • Method: post
  • Path: /v1/payment_intents/{intent}/confirm
Link to this function

create(client, params \\ %{}, opts \\ [])

View Source
@spec create(
  client :: Stripe.t(),
  params :: %{
    optional(:amount) => integer(),
    optional(:application_fee_amount) => integer(),
    optional(:automatic_payment_methods) => automatic_payment_methods(),
    optional(:capture_method) => :automatic | :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(),
    optional(:metadata) => %{optional(binary()) => binary()},
    optional(:off_session) => boolean() | :one_off | :recurring,
    optional(:on_behalf_of) => binary(),
    optional(:payment_method) => 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. You can read more about the different payment flows available via the Payment Intents API here.

When confirm=true is used during creation, it is equivalent to creatingand confirming the PaymentIntent in the same call. You may use any parameters available in the confirm API when confirm=true is supplied.

Details

  • Method: post
  • Path: /v1/payment_intents
Link to this function

increment_authorization(client, intent, params \\ %{}, opts \\ [])

View Source
@spec increment_authorization(
  client :: Stripe.t(),
  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. As with the initial authorization, incremental authorizations may be declined. A single PaymentIntent can call this endpoint multiple times to further increase the authorized amount.

If the incremental authorization succeeds, the PaymentIntent object isreturned with the updated amount. If the incremental authorization fails, a card_declined error is returned, and no fields on the PaymentIntent or Charge are updated. The PaymentIntent object remains capturable for the previously authorized amount.

Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines.Once captured, a PaymentIntent can no longer be incremented.

Learn more about incremental authorizations.

Details

  • Method: post
  • Path: /v1/payment_intents/{intent}/increment_authorization
Link to this function

list(client, params \\ %{}, opts \\ [])

View Source
@spec list(
  client :: Stripe.t(),
  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
Link to this function

retrieve(client, intent, params \\ %{}, opts \\ [])

View Source
@spec retrieve(
  client :: Stripe.t(),
  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..

Client-side retrieval using a publishable key is allowed when the client_secret is provided in the query string..

When retrieved with a publishable key, only a subset of properties will be returned. Please refer to the payment intent object reference for more details.

Details

  • Method: get
  • Path: /v1/payment_intents/{intent}
Link to this function

search(client, params \\ %{}, opts \\ [])

View Source
@spec search(
  client :: Stripe.t(),
  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
Link to this function

update(client, intent, params \\ %{}, opts \\ [])

View Source
@spec update(
  client :: Stripe.t(),
  intent :: binary(),
  params :: %{
    optional(:amount) => integer(),
    optional(:application_fee_amount) => integer() | binary(),
    optional(:capture_method) => :automatic | :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_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 may need to confirm thePaymentIntent again. For example, updating the payment_method will always require you to confirm the PaymentIntent again. If you prefer to update and confirm at the same time, we recommend updating properties via the confirm API instead.

Details

  • Method: post
  • Path: /v1/payment_intents/{intent}
Link to this function

verify_microdeposits(client, intent, params \\ %{}, opts \\ [])

View Source
@spec verify_microdeposits(
  client :: Stripe.t(),
  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