I got a webshop (Laravel API/Vue) that uses Stripe. I have 3 environments for this app, local, development/staging and production.
Local and development/staging use the same Stripe publishable and secret test key, but use different webhook secret test keys.
My local environment is using Laravel Homestead and I use ngrok installed on my pc (windows) to forward my local environment to a live server.
I recently noticed that whenever I test a transaction on my local server, which triggers a payment_intent.succeeded
event on Stripe, this event gets handled in a job on both local AND development/staging. This results in an order being processed and saved on the development database, even if that order is placed using the local environment. It's vice versa whenever I test a transaction on the development environment.
On the Stripe dashboard I use 2 webhook endpoints, one for local (which is the ngrok live server) and one for the development/staging environment.
I have no explanation for it. Any pointers would be awesome to resolve this strange issue.