#devangbhuva97-connect-webhooks

1 messages · Page 1 of 1 (latest)

heady cove
#

So how to differentiate webhook event by applications? Like which event is for which application?
You mean you have a single webhook endpoint that's used across multiple Stripe accounts?

frosty pier
#

No, I registered multiple webhook endpoint. Like 1 for staging, 1 for production

So now problem is, all event data will come on both endpoint. So is there anyway to fix that?

heady cove
#

There's not, no

#

Do you have 1x Stripe account or 1x for each environment?

frosty pier
#

We have only 1 Stripe account & that used in every environment

heady cove
#

Got it. Unfortunately Stripe events triggered in a certain mode (test/live) will be sent to all webhook endpoints configured to listen for that event type

frosty pier
#

I saw that - there is setAppInfo option while initialize stripe sdk. So can you pass those details with webhook?

heady cove
#

You can't, no

frosty pier
#

Any alternative solution for this except multiple accounts for each environment?

#

And any plan to support this type of things in stripe roadmap?

heady cove
frosty pier
#

Thank you @heady cove

Let me know if you find any alternative solution

heady cove
#

My suggestion would be maybe using some kind of URL parameters in the webhook endpoint to differentiate between stages

#

Then in your handler you can ignore certain events depending on that parameter

frosty pier
#

I don't think it will work.. because we need some data in webhook event to differentiate

heady cove
#

Another option is to filter based on the signing secret of the webhook, which is unique per endpoint

heady cove
frosty pier
#

One thing we can pass some env details in metadata of every stripe request but not sure that metadata will get in all events

heady cove
#

Yeah, it depends on if the objects you're using support metadata

#

Even then that's pretty fragile as it assumes its guaranteed to be set on every object