#Debi Prasad-webhooks
1 messages · Page 1 of 1 (latest)
Hello there. What an 'environment' in this instance?
Can you share the Event object? evt_xxx
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?
The events are created on an account level, dependent on which API keys were used (i.e. which Stripe environment you're using)
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
And to mitigate this, I need to have 3 accounts for 3 separate envs, is that correct?
Not necessarily. Why would you send events from the Stripe test mode to your production server?
Of course not, but just for testing even, for dev and staging, I need to have 2 accounts?
You don't need to. But you can have a dedicated Stripe account just for testing, yes
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.
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?
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
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.