Breaking Changes to Stripe.js
Stripe has removed several long-deprecated methods from Stripe.js as part of a major API cleanup. These methods will now throw an error if called, requiring immediate migration for affected integrations.
Affected Methods
Payment Intents API (3 methods removed):
handleCardPayment→ migrate toconfirmCardPaymentconfirmPaymentIntent→ migrate toconfirmCardPaymenthandleFpxPayment→ migrate toconfirmFpxPayment
Setup Intents API (2 methods removed):
handleCardSetup→ migrate toconfirmCardSetupconfirmSetupIntent→ migrate toconfirmCardSetup
Sources API (2 methods removed):
createSource→ migrate to Payment Methods APIretrieveSource→ migrate to Payment Methods API
Migration Guide
The updated methods use clearer naming and improved functionality. For example:
// Payment Intents - Before
stripe.handleCardPayment(clientSecret, cardElement);
// Payment Intents - After
stripe.confirmCardPayment(clientSecret, {
payment_method: { card: cardElement }
});
For the legacy Sources API methods, Stripe recommends migrating to the Payment Methods API, which offers better support for payment method reusability and compliance requirements.
Action Items
Review your Stripe.js integrations immediately to identify any usage of these deprecated methods. Stripe provides detailed migration examples in the changelog for each affected method. Update your code before the removal takes effect to avoid runtime errors in production.