#zzking
1 messages · Page 1 of 1 (latest)
Hi there!
Seems like an odd flow. Why not directly create the SetupIntent or PaymentIntent to automatically create the PaymentMethod for you?
I know.. the code is a bit old so it's not feasible to completely re-write everything
But everything seems fine if I follow what I described, and from stripe's API doc, it seems it's OK to attach an existing payment_method when creating a setupIntent or a paymentIntent
Yes once you have an existing PaymentMethod, you can use it with a PaymentIntent.
and a setupIntent ,right ?
Correct. But if you already have a PaymentMethod saved on a customer, then there's no point in doing a SetupIntent.
We want to "save the card for future usage", especially in the EU where SCA is required, so I think a setupIntent IS required for this use case ,right ?
bascially we'd need customer to authenticate the card first , should SCA happens
In your original question you said "create a customer and attach the payment_method to the customer". So if you already attached the PaymentMethod, no need for a SetupIntent. But you could use the SetupIntent to attach the PaymentMethod in the first place.
In your original question you said "create a customer and attach the payment_method to the customer". So if you already attached the PaymentMethod,
Then how would you trigger a card authentication in this case ?
I mean without a setupIntent, how could you tell the bank (via Stripe) to authenticate the card ? I believe it would not happen if I just attach the payment_method to the customer , right ?
@hallow wren sorry, any thoughts ?
Oh sorry for the delay (Discord has been busy). Looking into this now.
no problem, thank you. I know our flow might be a bit odd (due to the code being old), but I THINK it would still work, especially in the context of SCA
Yes you are correct. If you want to trigger 3DS, then yes you need to use a SetupIntent. So I would recommend something this:
- Create the PaymentMethod
- Add it to a SetupIntent. This will automatically: attach it to the customer and trigger 3DS if needed
Almost like what we are doing:
- Create the PaymentMethod
- Create the Customer, and attach the PaymentMethod to the Customer
- Create the SetupIntent, and attach Customer/PaymentMethod to the SetupIntent during the creating procedure. This should trigger 3DS if needed.
I believe above should also work ? Sorry just trying to fit my code into our current codebase with less branching
"attach the PaymentMethod to the Customer" in step 2 seems useless (since the SetupIntent will take care of this), but technically it should work.
hmmm, interesting. Thanks for that ! Another related question is:
AFAIK , setupIntent or paymentIntent with "setup_for_future_usage:off_session" are both optimised for the SCA flow when saving a card. I'd like to know if we apply the same logic to the US where SCA is not required , would it also always trigger a 3DS card authentication during the card setup procedure ?
would it also always trigger a 3DS card authentication
No, it would only trigger 3DS if the bank requests it.
aha great, that's nice to know. Thanks for your help
Happy to help 🙂