Skip to content

Commit

Permalink
Added hash_hmac() 256 hashing way.
Browse files Browse the repository at this point in the history
  • Loading branch information
sudiptpa committed Dec 7, 2022
1 parent b717158 commit 6d09188
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Message/DirectPostAbstractRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function generateFingerprint(array $data)

$hash = implode('|', $hashable);

return sha1($hash);
return hash_hmac('sha256', $hash, $this->getTransactionPassword());
}

public function getBaseData()
Expand Down
4 changes: 2 additions & 2 deletions src/Message/DirectPostCompletePurchaseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ public function generateResponseFingerprint($data)
$data['summarycode'],
];

$fields = implode('|', $hashable);
$hash = implode('|', $hashable);

return sha1($fields);
return hash_hmac('sha256', $hash, $this->getTransactionPassword());
}

public function sendData($data)
Expand Down
4 changes: 2 additions & 2 deletions src/Message/DirectPostWebhookRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public function generateResponseFingerprint($data)
$data['summarycode'],
];

$fields = implode('|', $hashable);
$hash = implode('|', $hashable);

return sha1($fields);
return hash_hmac('sha256', $hash, $data['txn_password']);
}

public function vefiyFingerPrint($fingerprint)
Expand Down

0 comments on commit 6d09188

Please sign in to comment.