#theproofficial

1 messages ยท Page 1 of 1 (latest)

astral surgeBOT
#

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.

frail rain
#

Hello

#

What is the error that you are seeing returned?

#

Is the webhook signature verification failing?

crimson haven
#

All I get is 400 (Bad Request)

#

I can share the event: evt_1OD6IsC0RbkXAFsA56uWkZvi

#

Local webhook works, the server does not

frail rain
#

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.

crimson haven
#

the code is the same in both, so it doesn't make sense why one works and the other one doesn't

frail rain
#

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

#

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.

crimson haven
#

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" }

frail rain
#

Yep perfect

#

That's what we needed

crimson haven
#

Which I still do not understand why, since I use the same signature in both codes and one works.

frail rain
#

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?

crimson haven
#

yes

frail rain
#

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?

crimson haven
#

I use different secrets for both local and the server yes

frail rain
#

And you have double checked that you have the correct secret in place in your server code, yes?

crimson haven
#

oh lol somewhere along the road I made a mistake and put the old one back

#

Thanks for the help ๐Ÿ˜…

frail rain
#

๐Ÿ‘

crimson haven
#

I think I changed my local secret instead of the server ๐Ÿ˜…

frail rain
#

Yep that happens