Short version
On a platform which uses Stripe Connect to collect payments on behalf of clients, when a test-mode payment is transacted, Stripe calls live-mode webhooks. I want it to call test-mode webhooks for test payments.
Longer version
We have a simple, home-grown ticket-selling platform which allows people to register accounts and sell tickets for their events. The platform uses Stripe to process payments, and sets our clients up with Stripe connected accounts (as Stripe calls them). Our platform listens for webhook calls from Stripe to handle the outcomes of payments. I have webhooks set up in parallel for both live mode and test mode.
(In case you don’t know how this works… There is one main Stripe account for the ticketing platform, and then accounts for our clients are connected to this. When a payment happens, the platform makes API calls to the platform’s Stripe account, specifying the client account to receive the payment, and the money goes to the latter. Webhooks are set up in the platform’s account.)
My issue is that when a client accepts a payment, and a webhook is fired by Stripe, it seems to be using the live-mode webhooks, no matter whether the payment was a live-mode or a test-mode one. I’ve made sure that the payment is a test one:
- I’ve checked that platform uses the correct test-mode API keys when creating the
PaymentIntent
. - The transactions are showing up correctly in the test data of the client.
However, Stripe is still invoking live-mode webhooks for these test transactions.
Is this expected behaviour? Is there a way to convince it to use test-mode webhooks?