#birdy247-webhooks

1 messages · Page 1 of 1 (latest)

stiff ginkgo
#

👋 happy to help

#

what is your question?

lilac latch
#

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?

stiff ginkgo
#

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

lilac latch
#

We are not using stipe checkout

stiff ginkgo
#

what are you using then?

lilac latch
#

Its the payment element

stiff ginkgo
#

I'm not following what seems to be the issue

lilac latch
#

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

cobalt meteor
lilac latch
#

sorry, I mean generically

cobalt meteor
#

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

lilac latch
#

Yes, I did think that

#

Or a websocket I guess

#

Do you have any stats on how quickly that webhook is sent?

cobalt meteor
#

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

lilac latch
#

Got it

#

I guess if we see our DB is "unpaid", we query stripe