#shpatak - webhook events

1 messages · Page 1 of 1 (latest)

twilit muskBOT
outer pivot
#

Hi there

brittle berry
#

stripe.events.list({ limit: 100, delivery_success: false })

outer pivot
#

How old are these Events you are trying to list?

#

Do you have a request ID I could look at?

brittle berry
#

couple of minutes

#

evt_3McD2UK1mDNK4xVY0LAHSRgF

#

I am simulating 400 server error to get list of failed events - but no success

outer pivot
#

Ah okay

#

I'd assume this doesn't work with the CLI

#

I've never tested this myself

#

But I would guess you need an actual endpoint here

#

To list by delivery_success: false

brittle berry
#

I am already listing by delivery_success

#

But how can i list ones that failed locally?

#

with the cli

#

I have a recurrent code which runs each 2 minutes (on dev) to check all failed events

#

NodeJs and CronTab

outer pivot
#

Yeah this will work fine with delivery_success since even with just the CLI those events won't fail so it is basically a no-op for delivery_success: true

#

You are going to need to use an actual endpoint to test here

#

Like an ngrok

brittle berry
#

i managed to get the list without specifying delivery_success

outer pivot
#

Right you should get all of them without delivery_success

brittle berry
#

hm

#

it would be great to have a way of testing it in development

outer pivot
#

Yeah you are going to need to use an endpoint served over HTTPS for that and not rely on forwarding via the CLI

brittle berry
#

hypothetically it's gonna fail

#

xd

outer pivot
#

Yeah then you are going to get a 500

#

If you want to test a 4xx

#

You need to be able to respond

vast anvil
#

There are services like ngrok that can allow you to get a public URL for your localhost that you can test with

brittle berry
#

Thank you

#

wil give it a test

brittle berry
#

Is there a way to let Stripe know that I've successfully handled this event after retrieving list of non-succeeded?

vast anvil
#

Once you respond with a 200 we consider delivery successful and will stop retrying the event

brittle berry
#

That's when webhook is fired

#

I mean when I listed all failed events -> to proces each of them and let Stipe know that they are not in the failed list anymore

vast anvil
#

shpatak - webhook events

#

Good question. Checking in to whether you can set this yourself

bitter raven
#

Hello 👋
Taking over as Pompey needs to step away soon
Unfortunately, there isn't really a way to mark them as "received" or "handled" as such

brittle berry
#

Okay, thank you guys