Breaking changes
Removes deprecated Payment Intents, Setup Intents, and Sources methods from Stripe.jsBreaking changes
What’s new
Removes several deprecated methods from Stripe.js in favor of equivalent methods with clearer naming and improved functionality.
Why is this a breaking change?
The following methods have been removed and will throw an error if called:
Payment Intents API:
handleCardPaymentconfirmPaymentIntenthandleFpxPayment
Setup Intents API:
handleCardSetupconfirmSetupIntent
Sources API:
createSourceretrieveSource
Impact
If your integration uses any of the deprecated methods, you must update your code to use different methods, as in the following examples:
Payment Intents API methods
- Replace
handleCardPaymentwith confirmCardPayment, which has a similar API signature and behavior.
// Before (deprecated) stripe.handleCardPayment(clientSecret, cardElement); // After stripe.confirmCardPayment(clientSecret, { payment_method: { card: cardElement, }, });
- Replace
confirmPaymentIntentwith the more explicit confirmCardPayment.
// Before (deprecated) stripe.confirmPaymentIntent(clientSecret, { payment_method: { card: cardElement, }, }); // After stripe.confirmCardPayment(clientSecret, { payment_method: { card: cardElement, }, });
- Replace
handleFpxPaymentwith confirmFpxPayment, which has an identical API signature and behavior.
// Before (deprecated) stripe.handleFpxPayment(clientSecret, { payment_method: { fpx: fpxBankElement, }, }); // After stripe.confirmFpxPayment(clientSecret, { payment_method: { fpx: fpxBankElement, }, });
Setup Intents API methods
- Replace handleCardSetup` with confirmCardSetup, which has a similar API signature and behavior.
// Before (deprecated) stripe.handleCardSetup(clientSecret, cardElement); // After stripe.confirmCardSetup(clientSecret, { payment_method: { card: cardElement, }, });
- Replace
confirmSetupIntentwith the more explicit confirmCardSetup.
// Before (deprecated) stripe.confirmSetupIntent(clientSecret, { payment_method: { card: cardElement, }, }); // After stripe.confirmCardSetup(clientSecret, { payment_method: { card: cardElement, }, });
Sources API methods
If your code uses methods like createSource and retrieveSource from the legacy Sources API, migrate your integration to use the Payment Methods API instead.
The Payment Methods API provides better support for payment methods, reusability, and compliance requirements.