#mchlcrtz
1 messages · Page 1 of 1 (latest)
confirmSetup is for SetupIntents which save a payment method's details without charging the customer
confirmPayment is for PaymentIntents which are what you use to charge customers (you can also save payment method data while charging a customer)
To ensure that the payment intent is charged successfully, can I use the confrimSetup and then confirmPayment sequentially?
Hello 👋
What's your end goal?
If you're trying to save the payment method and are using SetupIntents API then you can use confirmSetup to save the payment method and charge the amount server-side.
You can't call confirmSetup and confirmPayment both on a single payment intent
Ah I see, thanks for clearing that up. I'm trying to handle failed charges after a setup intent is successful. For example, when testing with this card number, a customer gets created but the subscription fails because the charge fails.
The clearer question would be how can I handle these failed charges when the setup intent is successful?
There's not much you can do when this happens really. You could cancel the subscription and/or ask the customer to provide a new payment method.
Would these be the proper steps to follow? https://stripe.com/docs/declines#responding-to-failures-api