#cnguyen
1 messages · Page 1 of 1 (latest)
Hi, you'd want to listen to https://stripe.com/docs/api/events/types#event_types-setup_intent.created event in this case.
what is the difference with succeeded ?
Because, the flow I want is :
- Front > Call a WS "get setup intent client secret"
- Back > WS > Create the customer + create the SetupIntent and return the client secret
- Front > Display the credit card form and use the client secret to associate the payment method to the customer in order to use the pm later
- Back > Once the pm is associated through the SetupIntent, I generate a subscription
I think that in my case, I have to listen the setup_intent.succeeded ?
And I read
"Use stripe.confirmSetup to complete the setup using details collected by the Payment Element. Provide a return_url to this function so that Stripe can redirect the user after they complete setup. We may first redirect them to an intermediate site, like a bank authorization page, before redirecting them to the return_url. If your user saves their card details, we immediately redirect them to the return_url when setup is successful."
But I just want to enter the credit card info throughCardNumberElement, and like a PI, I want to display the 3DS if needed, then just display a OK message without to be redirected to an other page.
Is it possible ?
I read this too quickly, yes -- if you want to be notified after confirmSetup, then you'd want to listen to https://stripe.com/docs/api/events/types#event_types-setup_intent.succeeded for successful setup intents.
Our Elements would handle 3DS for you.
In the front, I have to use await stripe.confirmSetup
but I don't understand the url param ? Is it mandatory ? Because, in my case, I want to stay on the same page and display a popin OK when it's successful
Or maybe I don't need it if I use => https://stripe.com/docs/js/setup_intents/confirm_card_setup#stripe_confirm_card_setup-with_element
Let's back up here... you mentioned you generate a subscription after you use Setup Intent, can you speak more into this? Are you immediately creating a Subscription after the Setup Intent succeeds?
I don't know yet
that's why I try to check all the possibilities
to allow me to choose
First option => directly after => I think I have to use setup_intent.succeeded
2nd option => X days later => I have to keep the date when it's will be X and do the stuff
If your intent is to just create a subscription then, you should look at this Integration: https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements.