#ggmghoul
1 messages · Page 1 of 1 (latest)
Hi there!
hello
"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_xxxand match the one displayed in your dashboard - The payload you pass in the
constructEventfunction is not the raw payload.
yes i already checked i'm using the right key and in the construct event i'm passing the request.data
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?
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
For example if you see a JSON object, then it's not the raw body.
Which programming language are you using? Node + Express?
the type is <class 'bytes'>
So that looks okay.
What's your webhook endpoint ID (we_xxx)?
Thanks. Can you confirm that your webhook secret looks like whsec_xxx and ends with 5f?
yes and to confirm more 65f
and if i may
can you tell me what's the form of the sig_header
It should look something like t=xxx,v1=yyy,v0=zzz
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 ?
Yes, sure!
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']
Glad that you managed to solve the issue!
I'm not sure. But in our official tutorial for Python we use sig_header = request.headers.get('stripe-signature'), so I would recommend using the same if it work.
https://stripe.com/docs/webhooks/quickstart?lang=python
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
Happy to help 🙂