#michael - browser tabs

1 messages · Page 1 of 1 (latest)

sacred steppe
#

Hello! Just starting a thread for you -- I'll review and respond as soon as I can 🙂

gleaming ginkgo
#

Hi!

#

Thanks for your time.

sacred steppe
#

hey there, what exactly are you having issues with?

#

NP

gleaming ginkgo
#

We have develop a platform for selling event tickets via connected accounts. The frontend is a custom react development, the backend is a nodejs framework similar to express.

sacred steppe
#

OK, and what is causing you trouble across tabs as you've described?

gleaming ginkgo
#

When a customer adds a ticket to his cart in the frontend we only add it to an orders table and associate with the session id.

#

From the cart the customer can proceed to the the checkout where a payment intent is created on the backend and the client_secret is returned to the frontend. Also the cart total ist returned and displayed.
In the checkout view we use Payment Element.

sacred steppe
#

OK

gleaming ginkgo
#

Now if the customer stays on this page and open a new browser tab, adds another ticket to his cart (only the orders table is updated, no changes to the payment intent are made) and switches back to the tab where the checkout is open he can complete the payment with the Payment Element.
Our Backend is listening for the webhooks and will then fulfil the order process. And this is my problem: the payment intent has not been updated.

#

I guess I could update the payment intent every time the cart changes, then the charged amount would correspond with the order total, but the customer would still see outdated order total in the checkout of the first initial tab.

#

Is there any way (invalidating intent etc.) to get around this?

sacred steppe
#

I could update the payment intent every time the cart changes
Yes, if what you describe is a normal customer journey it sounds like you should do this

#

Or at a minimum with the customer hits your pay button

#

You'll need to handle tracking those tab/order state syncs

gleaming ginkgo
#

Ok, thanks. I'll give it a try.