#Debi Prasad-webhooks

1 messages · Page 1 of 1 (latest)

quick zealot
#

Hello there. What an 'environment' in this instance?

#

Can you share the Event object? evt_xxx

gray moon
#

Let's say I have 3 envs: dev, staging, prod
For each env I have created 3 webhooks listening to an event
Now, when I am making a request from dev environment, the webhook response is getting called for all 3 envs and that's breaking the server for staging and prod.

#

Are events getting generated on account level or domain level?

quick zealot
#

The events are created on an account level, dependent on which API keys were used (i.e. which Stripe environment you're using)

gray moon
#

Test

#

for now

quick zealot
#

So if you were listening for checkout.session.completed events in test mode on 3 webhooks, then yes it would be sent to them all

gray moon
#

And to mitigate this, I need to have 3 accounts for 3 separate envs, is that correct?

quick zealot
#

Not necessarily. Why would you send events from the Stripe test mode to your production server?

gray moon
#

Of course not, but just for testing even, for dev and staging, I need to have 2 accounts?

quick zealot
#

You don't need to. But you can have a dedicated Stripe account just for testing, yes

gray moon
#

Basically different accounts or different keys for separate environments.

#

So To have multiple webhooks listening to a single event, we need to have individual accounts for separate environments.

quick zealot
#

So To have multiple webhooks listening to a single event
Isn't that what you're trying to prevent?

#

You want a single event sent to a single webhook, no?

gray moon
#

Yes, that's what I'm trying to achieve

#

But for every environment, I have different endpoints, so I need to have different accounts for it as well, is that right? As stripe webhook events are created on account level based on public and private keys, so one account can serve max 2 environment as in dev->Test and prod->Live, but if one has more environments, what one should do

vague gyro
#

then you either map Stripe's test mode to multiple environments in your system somehow, or you'd create multiple Stripe accounts. There's no good solution I'm afraid.