#BrianC-Webhooks

1 messages · Page 1 of 1 (latest)

lean comet
#

There isn't a way to specify endpoints, you will need to filter the Events when they hit your handler

#

For instance, ignore if livemode: false

signal hound
#

OK. Thanks!

lean comet
#

Sure!

signal hound
#

Just to clarify, it seems like all webhooks (live and test) are sent to all endpoints. Is this correct?

lean comet
#

For Connect endpoints yes. For Direct endpoints, no. Direct livemode endpoints will only receive livemode events from your account (and testmode likewise).

signal hound
#

I am actually looking for clarification between live and test server endpoints, regardless of direct or connect charges. It seems like all webhooks (live and test) are sent to all endpoints created (regardless of what their purpose is). Is this correct?

lean comet
#

Ah no that is dependent on how you set up the endpoint. You decide which webhooks the endpoint listens for when you create the endpoint.

#

But then both live and testmode webhooks for that type of webhook will be sent to that Connect endpoint.

#

So, for example, if you create the Connect webhook to just listen for account.updated, then only account.updated webhooks will go to that endpoint, but both livemode and testmode account.updated hooks.

signal hound
#

So yes, all webhooks are sent to all endpoints (even if they are carved out). There is no way to control that except after it is sent. I need clarification on this when setting up testing. We don;t want our live endpoints to have to field a lot of garbage requests (even though we will conditiionally only process livemode). Seems inefficient use of resources so trying to get our heads around it here.

lean comet
#

Yes what you stated above is the expected behavior.

signal hound
#

OK. Just trying to get our heads around this. So, if test event is sent to both our test and live endpoints, the live endpoint will fail and the test will succeed. How does Stripe handle that? Will the live endpoint eventually be disabled due to the number of failed requests?

lean comet
#

You want to make sure to always respond to the Webhook, otherwise yes the endpoint would eventually be disabled. You can respond without performing any actions though.

signal hound
#

What response code should we send? I'm hoping not a 200 for a failed request 🙂

lean comet
#

lol it isn't a failed request though. You respond with a 200 to say "yes we received this successfully".

signal hound
#

OK. We will do that. How do we deal with app stress testing though? If we send a large number of requests for testing purposes, each one will hit our live server too? It just seems like we are missing something here. Doesn't make sense.

lean comet
#

If you need to stress test then you can always create a different test account so that your livemode endpoint is not hit.

signal hound
#

OK. Maybe defeats the purpose of having a test mode as all of the settings, etc would have to be exact. It would be MUCH easier if Stripe didn't sent test webhooks to live endpoints. We will work with what we have though. Thanks

lean comet
#

@signal hound actually there is a workaround here

#

If you connect an account to your platform in only test-mode, then the test events for that Connected Account will only be sent to the platform's Test Connect webhook endpoint (and not the live endpoint).