#pavlos_elpidorou

1 messages · Page 1 of 1 (latest)

summer nightBOT
tropic canyon
#

Can you share an example evt_xxx ID that is failing the signature check? Also your webhook handler code

keen breach
#

Yes of course.

#

evt_3Oh46DCG5LI7m2080L1NMYDl

tropic canyon
#

Taking a look

#

Yeah your endpoint is returning a 500 error. Can you share the code?

keen breach
#

basically we are using this PHP package to handle the webhook request, including verifying if the signature matches

tropic canyon
#

Then I recommend you file an issue with that third-party library. They write and maintain that codebase

#

Otherwise: ensure that the whsec_xxx you're using in your code is the correct one for the webhook endpoint from your Dashboard

keen breach
#

Hm ok. I see.

#

So there is no way to manually verify the signature from the webhook request against the whsec_xxx to verify that they match?

tropic canyon
#

Our SDKs have this tooling built in, which is what I assume that Larvael library wraps (the PHP SDK)

keen breach
#

Yes. the package internally uses the stripe-php package

tropic canyon
#

Yeah then if you're sure that the whsec_xxx secret in your code definitely matches the one from the Dashboard for the endpoint then the likelihood is the issue lies in the code

#

And unfortunately, as you've not written the code yourself, it's hard for us to help

keen breach
#

After having a look at the package's code, on the controller which handles the webhook request, it creates a new WebhookConfig instance and then passes it to the WebhookProcessor along with the request

#

which then calls this isValid method

tropic canyon
#

No idea what either of those classes are. They're not native Stripe code so I guess it's specific to that lib

keen breach
#

and internally it calls Webhook::constructEvent which is the native stripe-php library code

tropic canyon
#

Yeah the common issues with invalid secret signing is:

  • The wrong whsec_xxx being used
  • The request payload is being parse/malformed by some logic before it's passed to constructEvent. That function expects the raw request body
#

If it doesn't match the signature from the headers, then it'll error

#

I suspect the issue is the latter, but you'd need to figure that out really as it's a third-party lib

keen breach
#

is it possible for you to provide me with the raw request body for the specific event i've sent you - evt_3Oh46DCG5LI7m2080L1NMYDl - so i can do some investigation?

tropic canyon
keen breach
#

ok thank you very much