Skip to content

Conversation

@pveiga2
Copy link
Contributor

@pveiga2 pveiga2 commented Aug 19, 2021

Property "success" is evaluating wrongly.

Summary

When using JSON for Notifications, the decoded value for property $response["success"] may be a String.
Example for a failed response, { success: "false" }

The method Notification->isSuccess() compares that value with an array of [ true, "true" ] and this fails, because the string "false" is evaluating as true.

Suggestion:

in_array() should be using strict-type checking when comparing an unknown value with a real Boolean, because any String or any Number different than zero will otherwise evaluate as true.

Tested scenarios

Created a Standard notification Webhook in the Adyen Customer Area.
Configured my endpoint for JSON, HTTP Authentication and HMAC signature.
Then generated an AUTHORIZATION test notification, using the "Test configuration" button.

@peterojo
Copy link
Contributor

@pveiga2 thanks for spotting this.

@peterojo peterojo merged commit ac39aed into Adyen:develop Aug 20, 2021
@acampos1916 acampos1916 mentioned this pull request Nov 16, 2021
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

Successfully merging this pull request may close these issues.

3 participants