#Oleksandr-webhook

1 messages · Page 1 of 1 (latest)

vital hound
#

Hi @red mango! Yes, this is expected as explained in the doc:

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.
https://stripe.com/docs/connect/webhooks

red mango
#

Understood, thanks. I assume the best practice would be adding environment field to the metadata?

vital hound
#

No need to use a metadata, you can directly look at the livemode value when receiving an event webhook.

Here's an example from the documentation of a webhook response with the livemode value.

  "id": "evt_OVE4hpoViwyLgv",
  "livemode": true, // <---
  "object": "event",
  "type": "customer.created",
  "account": "acct_VDqtEIQVwqTGAF",
  "pending_webhooks": 2,
  "created": 1349654313,
  "data": {...}
}```