Skip to content

Commit

Permalink
Only remove merchant sig param from payload
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaslorentsen committed Aug 31, 2017
1 parent e555fb6 commit c0251eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "thomaslorentsen/adyen-hpp-hmac",
"description": "HMAC Generator for Adyen Hosted Payment Pages",
"version": "0.2.0",
"version": "0.2.1",
"type": "library",
"license": "MIT",
"authors": [
Expand Down
7 changes: 3 additions & 4 deletions src/Signature.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,9 @@ public function validate($signature, $params)
*/
private function filterParams($params)
{
if (array_key_exists('merchantSig', $params)) {
$params['merchantSig'] = null;
if (!array_key_exists('merchantSig', $params)) {
return $params;
}

return array_filter($params);
return array_filter($params, function($key) { return 'merchantSig' !== $key; }, ARRAY_FILTER_USE_KEY);
}
}

0 comments on commit c0251eb

Please sign in to comment.