-
Notifications
You must be signed in to change notification settings - Fork 387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to verify signature locally with CLI webhooks #505
Comments
Hi @AAverin ! This is usually a result of the body being parsed (e.g. by |
@robz-stripe Hi.
|
The reason for the error was that Firebase Functions do their own parsing of body.
|
@robz-stripe something worth mentioning in the documentation, I suppose |
BUG Getting the exact same problem. StripeSignatureVerificationError when testing locally even though the secret is correct. I am simply passing in request.body:
I really think that Stripe needs to be clever enough to be able to execute stripe.webhooks.constructEvent by being passed in either a string or a json request.body. This is because Firebase Functions already does their own parsing of the body, and that is very convenient. Also it is possible to setup express() to also parse the body. The expected behaviour of stripe.webhooks.constructEvent is that it should not fail because this is not a problem with the signature verification logic. Also see: |
The more information we have the easier it is for us to help. Feel free to remove any sections that might not apply
Issue
Following the Node guide here:https://stripe.com/docs/payments/checkout/fulfill-orders
I am trying to test webhook implementation with locally running CLI
Stripe CLI version is 1.5.1
When running, CLI gives me whsec_ signature that I used in the code to verify incoming payload.
Check results in
Expected Behavior
Signature verification should pass for local tests
Steps to reproduce
What are the steps we can take to reproduce this and verify it's fixed?
Traceback
Share any debug output that was given by the CLI
Environment
MacOS
The text was updated successfully, but these errors were encountered: