#johan_docs

1 messages ยท Page 1 of 1 (latest)

dry zincBOT
unborn martenBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

dry zincBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1247476402094215198

๐Ÿ“ Have more to share? Add details, code, screenshots, videos, etc. below.

lofty shadow
#

๐Ÿ‘‹ happy to help

#

instead of the direct flow

real fulcrum
#

so that means once I collected the payment method I can essentially use the same endpoints we already have that creates and confirm the paymentIntent?

lofty shadow
#

I'm not sure what you already have

real fulcrum
#

we do something similar in this screenshot to what you shared. We first create the payment method in the client like this:

lofty shadow
#

basically when you have a logic that you want to execute before you capture the method you have 3 options:
1- use manual capture https://docs.stripe.com/payments/place-a-hold-on-a-payment-method
2- use the deferred payment intent flow in that case you can refer to https://docs.stripe.com/payments/accept-a-payment-deferred?platform=web&type=payment
3- use the two step confirmation https://docs.stripe.com/payments/build-a-two-step-confirmation

Separate payment authorization and capture to create a charge now, but capture funds later.

Build an integration where you can render the Payment Element prior to creating a PaymentIntent or SetupIntent.

Add an optional review page or run validations after a user enters their payment details.

real fulcrum
#

and then once we have the payment method, we take the paymentMethod.id and attach it to the setup intent when creating it

lofty shadow
#

why do you need a SetupIntent in this case?

real fulcrum
#

sorry my bad I meant to say payment intent

#

we take the paymentMethod.id and attach it to the paymenIntent we create and confirm in the server. we get the result in the same call, if it's successful we fulfil the order straightaway in the same call too

lofty shadow
#

the preferable way is to still confirm it on the frontend though

#

because of SCA

#

you shouldn't capture the money until you're sure that you can reserve the place

#

so what needs to happen in your own logic is to out the reservation on hold from your side once you collect the payment method

#

and then once you confirm you confirm the reservation with webhooks

real fulcrum
#

I understand, does this approach still needs webhooks or I can do this server confirmation just in the paymentIntent?

lofty shadow
#

you can do server side confirmation

#

but if the PI requires_action for 3DS

#

you would still need to pass the PI to the frontend and do a frontend side confirmation

#

that's why I suggested not going with the server-side confirmation

real fulcrum
#

yeah exactly we also handle SCA and send the pi back to the client, once the user confirms it the order gets fulfilled

#

we have some validations to prevent charging customers when the class is fully booked

#

There used to be one approach that you guys had in the docs to use the same endpoint but I can't find it anymore. we use that approach to implement it that way and it works really well

#

do you have idea if that is possible to do as well?

lofty shadow
#

I'm not sure I know what you're referring to

#

I just gave you your 3 options

real fulcrum
#

okay thanks a lot for your help! have a great day