#Elswell
1 messages · Page 1 of 1 (latest)
Hey, are you available?
hey there, sorry for the delay
Yes can you please share any code snippets you're using for your webhook endpoint?
And what have you learned so far from debugging this?
This is the endpoint code
There is something weird that i came across but for some reason I didn't pay much attention. While I was running stripe listen --forward-to localhost:3000/api/webhook in the stripe cli, and at the same time completing purchases on the vercel deploy, everything was magically working
Or I could have been losing my mind, which is completely possible
Your signature verification was working while testing locally with forwarding?
I think so, because the database was getting updated
when the verification failes, the db doesnt get touched
have you verified the header you extract has a value? ie, logging some samples of signature to confirm it hasn't been wiped at some point
Yes, I was just about to say that
When I log it out locally i can see the timestamp and some more data after it
i had a screenshot somewhere
Yea that sounds like the expected value. What about the live deployment logs?
I will do a quick test on that again, I can't find the console.logs in the live logs on vercel
it only shows me the 400 code errors from the failed verification
You'll need to get access to those logs, but I'm not sure how to do that off the top of my head using vercel
Give me like 5 minutes max
i did try logging req.headers, and there seems to be a weird empty log
Could it be because I am passing the body in a wrong way?
I am currently using raw-body to parse it, and I have also set bodyParser to false in the nextjs config
Ok i got the logs
That seems to be the wrong header value
Hmm not sure but maybe you need to define the header as something to pass through?
https://vercel.com/docs/concepts/edge-network/headers
I can't really help with Vercel config though sadly
but thats the path to pursue
You need that header value