#afonso

1 messages · Page 1 of 1 (latest)

mellow pilotBOT
radiant owl
#

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

restive nacelle
#

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({
radiant owl
#

But at that point the Customer should've left the checkout form. Could you redirect them back?

restive nacelle
#

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?

radiant owl
#

Can you get the total amount (with upsells) and then create a PaymentIntent?

restive nacelle
#

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.

radiant owl
#

You mean you are collecting the Payment Method information before upselling?

restive nacelle
#

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?

radiant owl
#

Our team don't do calls, but I think I have something for you.

restive nacelle
#

Right I just saw this now, this is very recent right?

#

I don't remember seeing this some weeks ago.

radiant owl
#

Yes, it's very new, but will be likely the new standard integration.

restive nacelle
#

what's the support for this?

#

don't want to put it in and then it changes

radiant owl
#

It's live for everyone, so it's there to stay.