#idhruv - setup intents
1 messages · Page 1 of 1 (latest)
any updates?
Apologies, server got busy I will still be a couple minutes. I will see if I can get a colleague to hop on sooner
sure
You can use Checkout or a custom flow with the Payment Element: https://stripe.com/docs/payments/save-and-reuse
Have you seen that guide before?
i've seen this, and i find it almost impossible to consume from 5th point onwards
the workflow suddenly jumps on client side and it just doesn't match our existing functionality, and more so it is not clear how many exact steps are involved.
so basically on server side we create setupIntent and later we go ahead to create customer
let me try to explain this as it is very complicated to explain it here:
we have a common flow where user already has selected their card they want to use, then they click on pay now button, and from there we create paymentIntent and return the confirmation back to the UI for further confirmation steps.
now, if they want to use a new card they must add the details and also click on save for later radio button so that stripe can show this card the next time they visit our booking page.
but after the process for saving the card is done our logic jumps again directly to the common flow that i wrote above ie.. creating the paymentIntent n same story as is...
our problem is that we are not able to properly work with setupIntents and creating the customer workflow itself, if we miss this then i think we cannot save the card in our system as there will be no payment method linked. Hence there is some code which is already written which creates setupIntents and also creates customer but it demands payment method as it also attaches it on the go
now for this how can I easily get payment method created? so that i can get appropriate pm_xxx id in return that is also valid.
and is also connected with the customer that is being created. i hope you are able to understand my problem
now, if they want to use a new card they must add the details and also click on save for later radio button so that stripe can show this card the next time they visit our booking page For this part are they always going to proceed with payment with the newly added card in that same browser session? If so, there's no need for a setupintent. I can explain
yes, that is totally true and that is why our setup intents are created with on_session flag
Got it. Well in that case there's no need for a setup intent. You would create a payment intent, pass setup_future_usage to the payment intent: https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage Then use the payment intent client secret to collect the card details. This both will submit payment and save the card for future use
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.