#afonso
1 messages · Page 1 of 1 (latest)
Hi! Let me help you with this.
Why do you need to have a new clientSecret?
You can just re-try with the same one
Well, it doesn't work for cards that are successfully attached to the customer but then later fail.
For example this one,
We use the payment element to confirmSetup , which is successful.
We can't re-run again, because the confirmSetup succeeds, it's only later when we try to charge it, that it fails.
I mean confirmSetup
const result = await stripe.confirmSetup({
But at that point the Customer should've left the checkout form. Could you redirect them back?
This is very complicated, we're currently allowing for upsells in the same page as the payment element.
In order for us to mount the payment element, we need a client secret.
But then, the price might change, depending whether he toggles the upsells.
So, when he clicks PAY, we use a setupIntent to save the payment method, and only after do we charge him.
Does this make sense?
Can you get the total amount (with upsells) and then create a PaymentIntent?
This is how we currently do it.
Create Secret -> Render Payment element -> Upsells -> SetupIntent -> Create Invoice & Pay
Those last two happen one after the other.
You mean you are collecting the Payment Method information before upselling?
We render the payment element in the same screen as the upsells.
We can't create a payment intent after the upsells, because then how do we render the payment element in the first place?
We need the client secret.
I know you're so busy, is jumping on a call unfeasible for you?
Our team don't do calls, but I think I have something for you.
This is a new flow, that allows you to render a Payment Element without a PaymentIntent: https://stripe.com/docs/payments/accept-a-payment-deferred
Right I just saw this now, this is very recent right?
I don't remember seeing this some weeks ago.
Yes, it's very new, but will be likely the new standard integration.
It's live for everyone, so it's there to stay.