#kalioops
1 messages · Page 1 of 1 (latest)
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.
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
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.
If that doesn't work there are a myriad of possible solutions in in the replies here: https://github.com/stripe/stripe-node/issues/341
ok, thanks for the help
No problem, good luck with it!