#Swampi995

1 messages · Page 1 of 1 (latest)

zinc cairnBOT
proven sparrow
#

i generate test header using your method const header = stripeAccount.webhooks.generateTestHeaderString({ payload: request.rawBody, secret: endpointSecret });

nova pike
proven sparrow
#

I am getting this

#

our account was blocked for a while, can it be something related to that?

nova pike
#

can you share you account id ?

proven sparrow
#

acct_1JwlGhBXaJQ2WEks

nova pike
#

There must be something changed in your integration that makes the webhook signature verification failed, webhook secret changed, the body request is changed by setting a new middelware for example...

proven sparrow
#

it really can't be, i put the first thing in express this request

nova pike
#

you have app.use(compression())which is global

proven sparrow
#

i did this to all my functions

nova pike
#

You still have something in your result express instance that is modifying the request body of the webhook request then.

proven sparrow
#

but with generateTestHeaderString it works fine, shouldn't it fail since i'm using the exact same body and secret?

#

clearly it's something with that stripe-signature

#

it creates the event correctly, everything works fine

nova pike
#

generateTestHeaderString don't pass throw your Express middlewares.

proven sparrow
#

but I'm passing to it the same body

#

this is the request that is not working

#

and this one is working

#

the only thing that is different is the header, when it's not working im getting it from the request, when its working im generating it, that it

nova pike
#

You are generating a signature for the body you set, so it will work for whater body you set in generateTestHeaderString

#

Try another completly different body and pass it to generateTestHeaderString and the signature verification will work. Again, the. generateTestHeaderString don't pass throw your express middelware. You have something that is updating the body of the request.