| [ Web Proxy ] |
| Viewing: https://stripe.com/ae/docs/payments/payment-methods | [Back] [Original] |
The Payment Methods API allows you to accept a variety of payment methods through a single API. A PaymentMethod object contains the payment method details to create payments. With the Payment Methods API, you can combine a PaymentMethod:
To determine which payment methods to use for specific locales, see the guide to payment methods.
The guide includes available payment methods for different regions, a detailed description of each payment methods characteristics, and the geographic regions where theyre most relevant. You can enable any payment methods available to you in the Dashboard. Activation is generally instantaneous and doesnt require additional contracts.
Some payment methods require your customer to take additional steps to complete the payment. The PaymentIntent objects next_action parameter specifies the type of customer action.
Some common actions that customers need to perform are:
Not all payment methods require additional customer actions. For example, card payments (excluding 3D Secure) require no additional authentication beyond collecting card details.
For payment methods that require customer action, configure webhook endpoints for notifications on whether a payment has succeeded or not.
Some payment methods immediately return payment status when a transaction is attempted (for example, card payments) but other methods have a delay such as ACH debits. For those that immediately return payment status, the PaymentIntent status either changes to succeeded or requires_payment_method. A status of succeeded guarantees that youll receive the funds from your customers.
Payment methods with delayed notification cant guarantee payment during the delay. The status of the PaymentIntent object will be processing until the payment status is either successful or failed. Its common for businesses to hold an order in a pending state during this time, not fulfilling the order until the payment is successful.
For payment methods with delayed notification, configure webhook endpoints for notifications on whether a payment has succeeded or not.
You can reuse certain payment methods (for example, cards or bank debits) for additional payments without authorizing and collecting payment details again.
You should always set up reusable payment methods for future use to reduce the chance of future declines and payment friction (such as authentication being required). Reusable payment methods can be set up for future use when accepting a payment or set up for future use without taking a payment.
Single-use payment methods (for example, some kinds of bank transfers) cant be attached to customers because theyre consumed after a payment attempt.
Configure webhooks by creating a webhook endpoint or other type of event destination for payment methods that either require customer action or when payment notification is delayed. Stripe sends the following events when the PaymentIntent status is updated:
| Event | Description | Next steps |
|---|---|---|
payment_intent.processing | The customers payment was submitted to Stripe successfully. Only applicable to payment methods with delayed notification. | Wait for the initiated payment to succeed or fail. |
payment_intent.succeeded | The payment succeeded. | Fulfill the purchased goods or services. |
payment_intent.payment_failed | The payment failed. | Send an email or push notification to request another payment method. |
You can also use the following options instead of setting up an event destination to listen to events:
A PaymentMethod contains reusable payment method details for creating payments (for example, card expiration date or billing address), it doesnt include transaction-specific information (for example, amount, currency). A PaymentMethod is attached to a PaymentIntent to represent the states of a payment lifecycle. Each PaymentMethod has a type attribute (for example, "type": "sepa_debit" ) and an additional hash whose name matches the type and contains information specific to the PaymentMethod type (for example, "sepa_debit":{}). Example of a sepa_debit PaymentMethod object:
{ "id": "pm_123456789", "object": "payment_method", "billing_details": { "address": {...}, "email": "jenny@example.com", "name": "Jenny Rosen", "phone": "+335555555555" }, "sepa_debit": { "bank_code": "37040044", "branch_code": "94832", "country": "FR", "fingerprint": "ygEJfUjzWMGyWnZg", "last4": "3000" }, "type": "sepa_debit", (...) }
To safely handle sensitive payment information and automatically handle customer actions, Stripe recommends that you create payment methods using Stripe.js.
| Web Proxy Viewer | New URL | Original Page |