Breaking changes
Removes deprecated Payment Intents, Setup Intents, and Sources methods from Stripe.js Breaking 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:
- handleCardPayment
- confirmPaymentIntent
- handleFpxPayment
Setup Intents API:
- handleCardSetup
- confirmSetupIntent
Sources API:
- createSource
- retrieveSource
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 handleCardPayment with confirmCardPayment , which has a similar API signature and behavior.
// Before (deprecated)
stripe.handleCardPayment(clientSecret, cardElement);
// After
stripe.confirmCardPayment(clientSecret, {
payment_method: {
card: cardElement,
},
});
- Replace confirmPaymentIntent with the more explicit confirmCardPayment .
// Before (deprecated)
stripe.confirmPaymentIntent(clientSecret, {
payment_method: {
card: cardElement,
},
});
// After
stripe.confirmCardPayment(clientSecret, {
payment_method: {
card: cardElement,
},
});
- Replace handleFpxPayment with 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 confirmSetupIntent with 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.
