#Indesh-webhook
1 messages · Page 1 of 1 (latest)
Hi! I'm not sure to understand, can you clarify your question? What events are you receiving, and what is the issue?
I've enabled 2 events.
I'm testing test payments on my localhost with the keys of webhook (with endpoint of my localhost).
But when I complete the payment and receive its related event, my one more webhook which I've created on LIVE mode gets same request which it should not get.
I'm doing checkout on behalf of connect account.
We are an ecommerce platform, and sellers connect their Stripe account, then we initiate checkouts on their behalf, using their account-id.
So you are doing testmode payments, but your livemode webhook receives events? This is expected when using connect webhooks
For Connect webhooks, it’s important to note that while only test webhooks will be sent to your development webhook URLs, both live and test webhooks will be sent to your production webhook URLs. This is due to the fact that you can perform both live and test transactions under a production application. For this reason, we recommend you check the livemode value when receiving an event webhook to know what action, if any, should be taken.
https://stripe.com/docs/connect/webhooks
Right. It is happening like you mentioned. Can I avoid this?
Unfortunately, no. But in your live webhook code you could ignore the testmode events by looking at the livemode property https://stripe.com/docs/api/events/object#event_object-livemode
Hmm yea. That can be the way.
So should I verify the signatures later after matching livemode so that it does not throw me the errors of "Invalid Signature" which I'm now frequently getting?
Yes you should first ignore test events, and then check the signature.
Okay
Thanks a lot. I've been going in circles to find the right solution.
Thanks a ton
But there is another scenario where we're providing an options to sellers to place 'test' payments on live server.
This way we'll be in need of both livemode and non-livemode events.
I'd suggest not doing that then, since it's really complicated to implement
We've implemented it successfully but just this thing is bothering where we're receiving same event on multiple webhooks.
what's the event ID evt_xxx where that happens?
1 sec
evt_1KhADPLzqjfxJhTENMF9Hpmh
I've received this same event on 2 different accounts in 2 different webhooks of 2 different modes
that's probably related to https://stripe.com/docs/connect/webhooks#connect-webhooks
For Connect webhooks, it’s important to note that while only test webhooks will be sent to your development webhook URLs, both live and test webhooks will be sent to your production webhook URLs. This is due to the fact that you can perform both live and test transactions under a production application. For this reason, we recommend you check the livemode value when receiving an event webhook to know what action, if any, should be taken.
Yes, right its due to 'connect' type webhooks. But we now wondering if I have to handle them at our own end in code as Stripe is going to send it to all related webhooks.
we'll send the event to any endpoint that is listening to that type of event in that mode(or in livemode for that Connect edge case) on the account itself or any connected platforms, so the same event can be sent to many different places depending on how exactly things are set up