I am trying to set up the webhooks in Stripe to work with Laravel Cashier but get the following error when the request is received by my app
'No signatures found matching the expected signature for payload'
I've checked the docs and I have already added the Stripe webhook secret key to my .env file under the STRIPE_WEBHOOK_SECRET variable and I've added 'stripe/*' to the csrf exceptions array in my config.
I've been searching google and reading the docs for more things I need to do but can't seem to find anything else to work with.
For anyone encountering this error, in my case it was because I was using the incorrect STRIPE_WEBHOOK_SECRET signature in my .env. To verify, go to stripe dashboard > developers > webhooks, select the endpoint you're testing and reveal/copy the "Signing secret" to your .env
For anyone scratching their heads with this one just also be aware that if you manually set up the webhooks in Stripe like @77trombones mentions or run php artisan cashier:webhook the signing secret is different for each webhook config setup.
I was wondering why the secret I copy-pasted from local dev to stage was not working and finally figured this out!
@martinbean Thank you for the advice. I have a job which checks for a hash of the frontend (separete ReactJS project) and writes to a frontend config in Laravel. The job clears and re-caches the configs, which I'll want in production. I've now disabled the caching in the development environment. Thanks for the prompt.