[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β€’15mo ago
Are you providing the correct webhook secret as an environment variable
Aviv
Avivβ€’15mo ago
yea, I am using the api secret key given by stripe 😦
Solution
jingleberry
jingleberryβ€’15mo ago
Api secret key and webhook secret are not the same thing
Aviv
Avivβ€’15mo 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
Avivβ€’15mo ago
the charge succeeds, but not the webhook
Aviv
Avivβ€’15mo 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
More Posts