#ColonelBudinca
1 messages · Page 1 of 1 (latest)
hi
I'm not familiar with building lambda functions, but generally speaking you'll need to preserve the raw request body in order to pass in to signature verification
Are you able to access this on the request to the lambda?
i am hosting netlify functions
Similar for a node/express endpoints, say: https://github.com/stripe-samples/accept-a-payment/blob/main/custom-payment-flow/server/node/server.js#L18-L28
I don't think that's possible based on this netlify post i was reading:
https://answers.netlify.com/t/how-do-i-get-raw-body-in-my-lambda/5439/14
Thanks for sharing your manual verification code, unfortunately it is not working for me. I see 3 different hashes for v0, v1 and hmac. One thing I don’t understand is how the generation of signedPayload in step 2 can work? const signedPayload = {timestamp}.{event.body}; When I log this out I see: 1590179791.{ "id": "evt_1GlhbVHypXujNqlR6...
i can not use express in my lambda function
But i'd suggest reaching out to them for guidance to see if thats changed
If you can't get the raw body, you'll be unable to verify the signature
i know, i meant as an example of access the raw request body before parsing, not sure how lambdas do this
😦 I am trying this for 4 days
If you find an answer, please do share. I'd love to know if/how it can be done.
but if i am pressing the green button many times it works as like i would use the raw body which is very strange
And also i am getting 2 diffrent errors. in my webhook terminal in vscode i am getting "{\"error\":\"webhook error Unable to extract timestamp and signatures from header\"}", and on stripe website when i am checking the same request i see "{\"error\":\"webhook error No signatures found matching the expected signature for payload. Are you passing the raw request body you received from Stripe?"}"
If you have access to the AWS config you might be able to set up something like this:
https://github.com/stripe/stripe-node/issues/356#issuecomment-583567354
But not sure if that's possibly via Netlify
i think it is not possible