[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
Solution:
Api secret key and webhook secret are not the same thing
Jump to solution
6 Replies
jingleberry
jingleberryโ€ข2y ago
Are you providing the correct webhook secret as an environment variable
Aviv
AvivOPโ€ข2y ago
yea, I am using the api secret key given by stripe ๐Ÿ˜ฆ
Solution
jingleberry
jingleberryโ€ข2y ago
Api secret key and webhook secret are not the same thing
Aviv
AvivOPโ€ข2y ago
Sorry my bad, I change this code too much and forgot. Switched to webhook secret as should, thank you. still same error msg ๐Ÿ˜ฆ
Aviv
AvivOPโ€ข2y ago
the charge succeeds, but not the webhook
Aviv
AvivOPโ€ข2y ago
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. ๐Ÿ™ ๐Ÿ™ ๐Ÿ™ ๐Ÿ™ ๐Ÿ™ ๐Ÿ™ ๐Ÿ™ ๐Ÿ™ ๐Ÿ™ ๐Ÿ™ ๐Ÿ™ ๐Ÿ™ ๐Ÿ™ ๐Ÿ™ ๐Ÿ™ ๐Ÿ™ ๐Ÿ™ ๐Ÿ™ ๐Ÿ™ ๐Ÿ™ ๐Ÿ™ ๐Ÿ™
Want results from more Discord servers?
Add your server