#theproofficial
1 messages ยท Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- theproofficial, 39 minutes ago, 28 messages
Hello
What is the error that you are seeing returned?
Is the webhook signature verification failing?
All I get is 400 (Bad Request)
I can share the event: evt_1OD6IsC0RbkXAFsA56uWkZvi
Local webhook works, the server does not
Alright well you are going to need to add more logs here to your server then, that 400 is the response that we receive from your server.
the code is the same in both, so it doesn't make sense why one works and the other one doesn't
It makes perfect sense. There are many reasons that it could be failing in different environments.
But the only way to figure it out is to actually identify the error itself
Right now your code is just returning a generic error message
You need to log out or return the err.message itself
You can look at https://stripe.com/docs/webhooks/quickstart which has examples in each language for how we recommend catching the error and returning a helpful response
Otherwise, it is very possible that the error is just coming from some functionality in your webhook handler that is failing, and isn't about receiving the webhook at all.
But impossible for me to say.
Well
After taking your advice, I get { "error": "No signatures found matching the expected signature for payload. Are you passing the raw request body you received from Stripe? \n\nLearn more about webhook signing and explore webhook integration examples for various frameworks at https://github.com/stripe/stripe-node#webhook-signing\n" }
Which I still do not understand why, since I use the same signature in both codes and one works.
Well the error gives you one specific reason why it could be failing
But first, when you tested locally, were you forwarding via the CLI?
yes
Okay
So the CLI gives you a specific webhook secret to use. Did you change to using the one from your webhook endpoint that you created?
I use different secrets for both local and the server yes
And you have double checked that you have the correct secret in place in your server code, yes?
oh lol somewhere along the road I made a mistake and put the old one back
Thanks for the help ๐
๐
I think I changed my local secret instead of the server ๐
Yep that happens