#birdy247-webhooks
1 messages · Page 1 of 1 (latest)
We currently move people from the checkout to a "completed" page
We wait for the response at the checkout from stripe to understand if the payment was susscessfull
If the payment failed, we would not move to the next page
We are now using webhooks, so the response will be some what asynchronous
So the question is, if we take them to the same "complete" page, how do we confidently show them that we are waiting for the webhook?
once the customer is redirected to the success page this means that you will get the event to your webhook endpoint
if the payment failed you will still be in the Checkout Session Page
We are not using stipe checkout
what are you using then?
Its the payment element
I'm not following what seems to be the issue
Hi, sorry I had to take a call
the payment intent status goes from created -> complete
Therefore how we do know when they leave the checkout page that payment is inflight
are you actually using Stripe Checkout, the /v1/checkout API (https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=checkout) or are you using "checkout" generically?
sorry, I mean generically
then it really depends what exactly you're building and how
but for example you can have your page poll your backend by sending it an AJAX request to check if your database is updated from the webhook yet
Yes, I did think that
Or a websocket I guess
Do you have any stats on how quickly that webhook is sent?
nope!
should be ~immediate though
you also don't have to wait, you could have your success page tell your backend to call the PaymentIntent retrieve API, and then you reconcile your database straight away
you have to build your "reconcile your database" function to be idempotent though so it could be called from either the frontend or webhook at the same time and still work