Stripe difference about `setup_future_usage: "off_session"` and `confirmCardSetup` if I just want to save user's credit card when buying

Viewed 2158

If I want to save user's card for future usage, I have noticed two options

  1. confirmCardSetup - This definitely can save user's card
  2. setup_future_usage: "off_session" inside confirmCardPayment - I just found out, this can also save user's card

If I only want to have a checkbox for the user to check Remember This Card when buying, then which method should I use it properly?

What's the difference between these two?

1 Answers

If I only want to have a checkbox for the user to check Remember This Card when buying, then which method should I use it properly?

You would use setup_future_usage for this and complete the payment using only a PaymentIntent, it's exactly what it's intended for. It ensures that the card is set up during the payment in the optimised way.

https://stripe.com/docs/payments/save-during-payment

enter image description here

What's the difference between these two?

You'd only use a SetupIntent(confirmCardSetup) directly if you are saving the card outside the context of a payment. It allows for a 'non-payment' 3D Secure authentication to happen, which helps ensure the success of future payments. You don't need to do that explicitly when there's a payment happening though, since setup_future_usage is giving you exactly the same benefit.

https://stripe.com/docs/payments/save-and-reuse

enter image description here

You simply use SetupIntents when not making a payment, and PaymentIntents when you are.

Related