#dino_pephanis-webhook-signatures

1 messages ยท Page 1 of 1 (latest)

median canopy
#

Hi there ๐Ÿ‘‹

Typically I see that error encountered for one of two reasons.

gilded remnant
#

Hello

median canopy
#

I would recommend double checking that you're using the correct signing secret for the webhook endpoint that you're using.

#

If that checks out, then I would recommend looking at your code to see if it is doing anything to alter the request body before passing it into the function to construct the event.

#

Our function is expecting the original unaltered request body, any change will impact the hash calculation.

gilded remnant
#

does the $endpoint_secret in the code have to equal Signing secret in the dasboard

median canopy
#

Yes, that is correct

gilded remnant
#

changed it but still get SignatureVerificationException

#

event id evt_3LZwpm2aLST0XUg81grHCX9D

median canopy
#

Thank you for the ID, but we won't have any insight into the signature verification results as that process all happens locally. How are you passing the body of the request to the event construction function?

gilded remnant
#

we use Laravel so...

#

$payload = $request->all(); to get the posted data

#

$sig_header = $_SERVER['HTTP_STRIPE_SIGNATURE'];

#
                $payload, $sig_header, $endpoint_secret
            );```
#

$endpoint_secret copied from Signing secret in control panel

median canopy
#

Do you know what that all() function is doing? (I'm trying to find it on the side, but if you could point me to the ref for that I would appreciate it)

gilded remnant
#

just asked my colleague $request->all() get key value pairs on a post from a form. changed it to $request->getContent() and it works. Sorry to trouble you

median canopy
#

No worries, I'm glad you were able to get to the bottom of it!

gilded remnant
#

thanks, enjoy the rest of yoru day

median canopy
#

Hope you do the same ๐Ÿ‘‹