[next 12] Stripe webhook doesn't work
Hey, I'm using the Taxonomy stripe webhook file as an example for my next 12 project that is deployed on vercel, and whenever I trigger a webhook, it fails with the following error:
"Webhook Error: No signatures found matching the expected signature for payload. Are you passing the raw request body you received from Stripe? "
This is the Texonomy file i'm using:
https://github.com/shadcn/taxonomy/blob/main/pages/api/webhooks/stripe.ts
The only things i've changed is the code that runs on my DB, like creating or updating my db, not the stripe code itself
GitHub
taxonomy/stripe.ts at main ยท shadcn/taxonomy
An open source application built using the new router, server components and everything new in Next.js 13. - taxonomy/stripe.ts at main ยท shadcn/taxonomy
6 Replies
Are you providing the correct webhook secret as an environment variable
yea, I am using the api secret key given by stripe ๐ฆ
Solution
Api secret key and webhook secret are not the same thing
Sorry my bad, I change this code too much and forgot. Switched to webhook secret as should, thank you. still same error msg ๐ฆ
the charge succeeds, but not the webhook
omg it worked for the first time, maybe the last commit didn't update yet or somthing. It's very probable that it was the api key problem.
๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐