#idhruv-setup-intents
1 messages · Page 1 of 1 (latest)
Hey, Setup Intents are used for collecting and saving payment details for later use (when there's no initial payment): https://stripe.com/docs/payments/setup-intents
okay
so we are basically creating setup_intent and then retrieving payment_method from it, so is it correct to use payment_method retrieved from setup_intent
?
Yes, exactly!
ook
also, what can be an alternative for this code:
const resp = await stripe.confirmCardSetup(setupIntent, { payment_method: { card: this.card, }, });
we always create a setupIntent first and then pass that intent to this code which triggers 3ds authentication, and I want to eliminate this approach
because as per our discussion yesterday
https://discord.com/channels/841573134531821608/1011582338444042311
this is really bad approach
so apparently we are creating setupIntents and then assigning paymentMethods first is to save a new card, but it completely jumbles up our workflow for 3DS as discussed in thread before
as I say yesterday you'd just create the PaymentIntent and use that instead
customer comes to your site and wants to pay —> generate a PaymentIntent on the backend, send it to the frontend and which displays our Elements frontend and calls confirmCardPayment when the user hits a button. If you create the PaymentIntent with the right fields then that function will present 3D Secure, charge the customer, and save the card to them for future use.