#kalioops

1 messages · Page 1 of 1 (latest)

jade steepleBOT
ancient rose
#

Hello! Yeah, the error means that on this line: event = stripe.webhooks.constructEvent(request.body, sig, endpointSecret); the content of request.body is not the raw incoming body of the HTTP request. You should log the value to see what's in it and figure out what changes you need to make to pass the raw, unaltered body of the incoming request there instead.

hoary dew
#

i am aware of the fact that it is not a raw body, however, i tryed multiple solutions to solve that, nothing seems to work, i tryed to import body-parser and use that instead of the express.json, this does not work either

ancient rose
#

Getting the raw body in Node is notoriously difficult, and there isn't a one-size-fits-all solution. Usually the issue is that some middleware reads the body before the part of your code that would extract the raw body, which causes the raw body extraction to fail, so try moving your raw body extraction middleware to run first, before anything else.

hoary dew
#

ok, thanks for the help

ancient rose
#

No problem, good luck with it!

hoary dew
#

thanks!

#

i think i will need it