#ColonelBudinca

1 messages · Page 1 of 1 (latest)

vast mauveBOT
grand jolt
#

hi

lucid swan
#

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?

grand jolt
#

i am hosting netlify functions

lucid swan
#

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

Netlify Support Forums

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...

grand jolt
#

i can not use express in my lambda function

lucid swan
#

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

lucid swan
grand jolt
#

ok

#

thank you

grand jolt
lucid swan
#

If you find an answer, please do share. I'd love to know if/how it can be done.

grand jolt
#

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

lucid swan
#

But not sure if that's possibly via Netlify

grand jolt
#

i think it is not possible