From 9f426acfcb897a5f8be49504815f87bd84794799 Mon Sep 17 00:00:00 2001 From: Ferrisbane Date: Mon, 25 Mar 2024 17:04:08 +0000 Subject: [PATCH 1/2] Update VPS Signature to include protocol 4.0 new fields Updated VPS Signature to check new fields introduced in protocol 4.0 --- src/Message/ServerCompleteAuthorizeRequest.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Message/ServerCompleteAuthorizeRequest.php b/src/Message/ServerCompleteAuthorizeRequest.php index 118ddfb..799a323 100644 --- a/src/Message/ServerCompleteAuthorizeRequest.php +++ b/src/Message/ServerCompleteAuthorizeRequest.php @@ -53,7 +53,12 @@ public function getSignature() $this->httpRequest->request->get('DeclineCode', ''). $this->httpRequest->request->get('ExpiryDate', ''). $this->httpRequest->request->get('FraudResponse', ''). - $this->httpRequest->request->get('BankAuthCode', ''); + $this->httpRequest->request->get('BankAuthCode', ''). + // New for protocol v4.00 + // Described in the docs here: https://developer.elavon.com/products/opayo-server/v1/notification-of-transaction-result + $this->httpRequest->request->get('ACSTransID', ''). + $this->httpRequest->request->get('DSTransID', ''). + $this->httpRequest->request->get('SchemeTraceID', ''); return md5($signature_string); } From 00d54b3e4a56fd6b281516be75ef1838ec6f4610 Mon Sep 17 00:00:00 2001 From: Ferrisbane Date: Mon, 25 Mar 2024 17:12:44 +0000 Subject: [PATCH 2/2] Updated server gateway test to check protocol 4.00 fields --- tests/ServerGatewayTest.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/ServerGatewayTest.php b/tests/ServerGatewayTest.php index 468eedb..c762e4d 100644 --- a/tests/ServerGatewayTest.php +++ b/tests/ServerGatewayTest.php @@ -120,9 +120,14 @@ public function testCompleteAuthorizeSuccess() 'DeclineCode' => '00', 'ExpiryDate' => '0722', 'BankAuthCode' => '999777', + // New fields for protocol v4.0 + 'ACSTransID' => 'abcuuid', + 'DSTransID' => '123uuid', + 'SchemeTraceID' => 'V123', 'VPSSignature' => md5( '{F955C22E-F67B-4DA3-8EA3-6DAC68FA59D2}' . '438791' . 'OK' . 'bexamplecJEUPDN1N7Edefghijklm' . '00' . '0722' . '999777' + . 'abcuuid' . '123uuid' . 'V123' ), ) );