-
Notifications
You must be signed in to change notification settings - Fork 450
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
Deployed functions rawBody failing Stripe validation #2099
Comments
I'd suggest you to console.log locally and in the cloud and compare if there are any differences. |
To test locally with Stripe I set up the local forwarder. Here's the output of initializing and when making successful round trip requests to my nhost function that it forwards to:
Below are the logs from the function printing the following lines locally:
This looks correctly formatted and is output across multiple lines. This is different than the output from the nhost cloud logs tab (obviously ids will be different for another request):
If I strip the @dbarrosop I'm not sure what else to verify, so let me know if you have any other suggestions! |
I had an idea to validate the content can be parsed as json. Here's the local output:
And here's cloud output:
So formatting differences are definitely just from console and it should be valid. That means the rawBody is fine and this is a red herring for stripe failure. The only other input to that validate function is the secret which I've pasted back in a few different times. So I finally just logged my stripe secret (for the test mode), and now it's working? Maybe I had some weird step where the secret was wrong, but I don't know what a good way to validate when it's set correctly because the nhost console doesn't show the value. Closing this issue, but hopefully anyone running into this in the future will see this and triple check secret values. |
Even though this is closed, I wonder @dbarrosop is there any way to verify that secret changes are picked up by just setting them in the console? Or does a full deploy need to be triggered? |
I'm working on setting up a stripe integration which requires access to the raw body of the request. I've followed the steps outlined in #770
These steps work locally. However, once deployed, the stripe signature validation fails.
To Reproduce
Steps to reproduce the behavior:
stripe.webhooks.constructEvent
functionExpected behavior
The webhook parses
rawBody
correctly when deployedAdditional context
I've added full body examples here: #770 (reply in thread)
The text was updated successfully, but these errors were encountered: