#mrx_docs

1 messages ¡ Page 1 of 1 (latest)

scenic jettyBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always 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/1266033326481739796

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

peak island
#

Hello

mental reef
#

hello

peak island
#

You want to use setup_future_usage: 'off_session on the frontend and backend to save the PaymentMethod to be able to charge it in the future.

#

You also pass a Customer ID to your PaymentIntent on your backend

mental reef
#

Sorry for asking again, I am a bit confused. Should I create Payment Method on Front End. Send it on Back End and then Create Customer and Payment Intent?

scenic jettyBOT
peak island
#

If you want to confirm server-side then yes, you create a ConfirmationToken on your frontend, which represents the PaymentMethod, and then you create a Customer and PaymentIntent on your backend to charge it.

However, to set up future payments the key is that you also pass setupFutureUsage: 'off_session' on your frontend when creating your Elements object (see: https://docs.stripe.com/payments/finalize-payments-on-the-server?platform=web&type=payment#additional-options where that is listed as an additional option) and then similarly pass setup_future_usage: 'off_session' on your backend when you create the PaymentIntent: https://docs.stripe.com/api/payment_intents/create#create_payment_intent-setup_future_usage

mental reef
#

After I create the first Payment Intent on the back end, that is supposed to be charged right away. I need to capture it with Web Hooks right?

peak island
#

If you are using a synchronous payment method type (like a Card) then no, it will respond synchronously in your backend. However, if 3DS is then required to be completed you will want Webhooks for that

#

To know that 3DS was successfully completed and the PaymentIntent moved to succeeded

mental reef
#

Thanks for you help and your time!