#ggmghoul

1 messages · Page 1 of 1 (latest)

bitter turretBOT
somber monolith
#

Hi there!

soft wasp
#

hello

somber monolith
#

"stripe.error.SignatureVerificationError" is a common error. It usually comes from two potential errors:

  • You are using the wrong webhook secret. So please double check you are using the correct one. It should look like whsec_xxx and match the one displayed in your dashboard
  • The payload you pass in the constructEvent function is not the raw payload.
soft wasp
#

yes i already checked i'm using the right key and in the construct event i'm passing the request.data

somber monolith
#

i'm passing the request.data
But is it the raw data? If you try to log it, what do you see?

#

Can you share your code here?

soft wasp
#

i'm sorry i can't because it's really private although i know you can help me better that way

#

but what should i actually find when i log it

somber monolith
#

For example if you see a JSON object, then it's not the raw body.

#

Which programming language are you using? Node + Express?

soft wasp
#

the type is <class 'bytes'>

#

i'm using flask

somber monolith
#

the type is <class 'bytes'>
So that looks okay.

#

What's your webhook endpoint ID (we_xxx)?

soft wasp
#

it's we_1Kw4MmHrKMzhnGvgFYI8tPdV

#

for the test mode

somber monolith
#

Thanks. Can you confirm that your webhook secret looks like whsec_xxx and ends with 5f?

soft wasp
#

yes and to confirm more 65f

#

and if i may

#

can you tell me what's the form of the sig_header

somber monolith
#

It should look something like t=xxx,v1=yyy,v0=zzz

soft wasp
#

exactly ! i'm only getting a hashed something in the header

#

i think i might figured it out can i try something else and get back to you later if you don't mind ?

somber monolith
#

Yes, sure!

soft wasp
#

thank you brb

#

sorry for wasting you time i just figure it out the webhook url was pointing to an old server when i changed it i got exactly what i needed

#

just one more question

#

does it make a difference how i get the header ?

#

on the hosted build for now i'm using get('Stripe-Signature')

#

but earlier i was using request.headers['STRIPE_SIGNATURE']

somber monolith
#

Glad that you managed to solve the issue!

soft wasp
#

yes i'm using it that way the difference is the capital letters instead of 'stripe-signature' it's 'Stripe-Signature'

#

i'll test all the cases anyway just to be 100% sure

#

thank you so much

somber monolith
#

Happy to help 🙂