From 623ed2d3210f3fcd7b5e9f0e54c30af1dc6b44bd Mon Sep 17 00:00:00 2001 From: nidjo Date: Fri, 23 Dec 2022 12:49:48 +0100 Subject: [PATCH] change in signature --- src/Gateway.php | 2 +- src/Message/PurchaseRequest.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Gateway.php b/src/Gateway.php index d2113f0..5e267b7 100644 --- a/src/Gateway.php +++ b/src/Gateway.php @@ -81,7 +81,7 @@ public function getSignature() public function setSignature(string $shopId, string $secretKey, string $shoppingCartId, string $amount) { $formatedAmount = $this->getFormatedPrice($amount); - $signature = md5($shopId . $secretKey . $shoppingCartId . $secretKey . $formatedAmount . $secretKey); + $signature = hash('sha512', $shopId . $secretKey . $shoppingCartId . $secretKey . $formatedAmount . $secretKey); return $this->setParameter('Signature', $signature); } diff --git a/src/Message/PurchaseRequest.php b/src/Message/PurchaseRequest.php index b7092e7..cb09ce2 100644 --- a/src/Message/PurchaseRequest.php +++ b/src/Message/PurchaseRequest.php @@ -23,7 +23,8 @@ public function getData() $data['CustomerEmail'] = $this->getCustomerEmail(); $data['CustomerPhone'] = $this->getCustomerPhone(); $data['CustomerCountry'] = $this->getCustomerCountry(); - return $data; + $data['Version'] = '2.0'; + return $data; } public function sendData($data)