#aldale

1 messages ยท Page 1 of 1 (latest)

heavy basaltBOT
timid ether
trim lava
#

Hey there, first thing to do is verify your constructEvent args all have values as expected: req.body, sig, webhookSecret

timid ether
#

everything i try i get no intent payment sucessful log or i get the error mentioned in the first post

trim lava
#

Let's focus on one error at a time

#

But if you get past the verification step, it sounds like something else is failing

timid ether
#

i added loggins, i get in te console Raw Body: undefined Webhook signature verification failed. No webhook payload was provided.

trim lava
#

Where did you add that?

#

But it seem like the req.body is empty for some reason? Can you share the logging you added?

timid ether
#

console.log('Raw Body:', req.rawBody);
console.log('Received Signature:', sig);
console.log('Webhook Secret:', webhookSecret);

trim lava
#

console.log('Raw Body:', req.rawBody);
Are you populated rawBody somewhere first? What made you use that?

#

I don't see this being set in your code anywhere

timid ether
#

no, only in stripewebhook.js

#

Raw Body: undefined
Received Signature: t=1697055297,v1=d59389a86cf62103c5e3976fc10e0b717edbb915d3fdae334a2c538195e65b3b,v0=530ea2f3a845f6a0b04f194757856c3f43c275e3d5b0c487107dceda82f6cff1
Webhook Secret: whsec_EDITED_NOT_REAL_sECRET_X5LOpUna0NUcIV6W55oMAoG8
Webhook signature verification failed. No webhook payload was provided.

trim lava
#

That seems expected if req.rawBody is undefined

#

If you use req.body what happens?

#

If that has a value but cannot be verified, then it suggest this might be getting mutated higher up in your stack

#

Is there a higher level express app initialization?

timid ether
#

i made the change to reflect the last snippet you showed me, but i still get raw body: undefined

#

starting at line 22

trim lava
#

Looks like the line above is already parsing the json

#

app.use(express.json());

#

You can probably comment that out with the new addition

#

Or you might need to move it before that

#

You should add logging to verify that function is running to set rawBody

timid ether
#

i commented out the line you told me earlier and it work now, you can close the chat, thanks synthrider