#Charmon
1 messages · Page 1 of 1 (latest)
It means that we couldn't calculate the webhook signature again given the secret and request body that you passed in to the constructEvent function
The two most common causes for this are having an incorrect webhook secret or modifying the request body before passing it in to that function
Have you double checked that your webhookSecret is the exact value that you are expecting?
It's seems like its fixed now, but I just want to know what was wrong.
So firstly, I need to call this:
stripe listen --forward-to localhost:3000/api/webhooks --skip-verify
Then it gives me the new webhook secret each time and I need to hardcode that webhooksecret value instead of whatever I got in my webhooks like this:
// const webhookSecret =
// process.env.STRIPE_WEBHOOK_SECRET_LIVE ??
// process.env.STRIPE_WEBHOOK_SECRET;
// Will have to change this to live!
const webhookSecret =
'whsec_0ee3e604fasdjioasd0be2ad565e1d63bf4332bddce4d4d76efe31da2f';
So, what happened is most likely I called stripe listen it gave me a new webhook secret and I forgot to hardcode that into my webhooks file?
Yep yep, sounds like it. Glad you could solve!