#frederic_webhooks

1 messages ยท Page 1 of 1 (latest)

reef portalBOT
uncut fiberBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

reef portalBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1257653502679842858

๐Ÿ“ Have more to share? Add details, code, screenshots, videos, etc. below.

brave flax
cyan smelt
#

In test mode, I guess my only option is to enable and disable one webhook or the other depending on when I'm doing my tests. Correct ?

brave flax
#

There's two common ways to achieve what yiou want without ustilising Sandboxes:

  • Separeate Stripe accounts for each env
  • Utilise metadata on associated objects to reflect the 'env' and then filter accordingly in the webhook handler
cyan smelt
#

Does the sandbox approach involves Stripe CLI ? I'm asking because I'm developing under Linux and the Stripe-CLI story is not great with Linux. To be honest, I gave the idea to try to use it.
Is the overall handling and configuraiton of sandbox relatively easy ?

brave flax
#

I'd recommend reading the docs! Not very familiar with it myself tbh, it's pretty new

#

(and it's currently a private beta)

cyan smelt
#

The metadata idea sounds like a great idea but as far as I could see the event is only sent to one webhook. Is there a way that I return an answer that would make it to send the event to the other webhook ?

brave flax
#

No, all events are sent to all webhooks configured on the account

#

As I said, you'd need to add the filtering logic in your webhook handler to check the metadata in the event and decide whether that endpoint should process it or not

cyan smelt
#

Are you sure of that? I just tested before posting and it's not what I see in my dashboard.

brave flax
#

i.e. metadata[env]: 'staging' and then check that value in the code

cyan smelt
#

that it is sent to all webhooks ?

brave flax
#

If a payment_intent.suceeded event fires on an account, and that account has multiple webhooks that are configured to listen for such events then it'll be sent to all of them yes

cyan smelt
#

Those are the event I'm monitoring....

#

Just tested a payment today... it went through this webhook.

#

but not through this one:

brave flax
#

I'm assuming those top 2 are the same evt_xxx IDs

#

In any case, the red cross is indicative of a delivery failure โ€“ likely an issue on your end. But we did try to send it

cyan smelt
#

the red cross is for a yesterday event ...

brave flax
#

Whether or not it succeeds (green check) depends entirely on your webhook handler and whether it returns a 2xx

#

OK, but we still sent the event and attempted devliery. As I said, we don't guarantee delivery as ultimately your webhook code needs to return a 2xx

cyan smelt
#

Not sure what you mean..
If both my webhooks endpoints are up - these are the exact same piece of code (not the same db though)
If I make a test payment.
the checkout.session.completed event should through both webhooks endpoints Unless I misunderstood you.
I just made a test with both endpoints running before posting here and I got the event only sent to the first webhook endpoint in the list.

#

I can easily retry for the sake of confirming.

brave flax
# cyan smelt but not through this one:

I'm not sure how else to describe it. The event with the red cross failed to deliver to your endpoint, despite us sending it. You can see in the screenshot that your endpoint returned a 4xx response (endpoint disabled)

cyan smelt
#

it was a "yesterday" event ...

#

it's not the event in question

brave flax
#

OK, then why share the screenshot as if it's a problem?

#

Please clearly state which event(s) you're having issues with

#

The evt_xxx IDs are better too, screenshots aren't helpful

cyan smelt
#

it was to show you that the other endpoint didn't receive the event... sorry for the confusion

#

wait.... it looks like I also received the event on the other webhook endpoint...

#

Not sure why it took some time to refresh...

#

So your statement is correct.

#

and therefore, the idea of the metadata will do the trick ...

#

Sorry for the complete mess I made of this case. I should have wait a bit longer before posting ๐Ÿ™‚

brave flax
#

No problem, glad I could help!