Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.

PHP Webhook snippet produces wrong query string #780

Open
ghost opened this issue Jul 28, 2019 · 0 comments
Open

PHP Webhook snippet produces wrong query string #780

ghost opened this issue Jul 28, 2019 · 0 comments

Comments

@ghost
Copy link

ghost commented Jul 28, 2019

The PHP snippet provided to verify the signature of an incoming webhook payload uses http_build_query to generate a query string, which ignores any null value in an array.
This returns a query string that is missing some keys that were provided in the payload, generating a wrong signature down the line.

I lost a few hours trying to find out why my signatures were not matching. I eventually found out by running the Node.js snippet and comparing the generated parameter strings.

The workaround is to implement http_build_query yourself. I ended up using this https://stackoverflow.com/a/16451823/11178709

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants