Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants