Skip to content

Commit

Permalink
Merge pull request #198 from Ferrisbane/Ferrisbane-patch-protocol-4-0…
Browse files Browse the repository at this point in the history
…-fields

Fix protocol 4.00 VPSSignature check
  • Loading branch information
judgej authored Mar 25, 2024
2 parents 79bbd99 + 00d54b3 commit 2a2dd85
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Message/ServerCompleteAuthorizeRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
5 changes: 5 additions & 0 deletions tests/ServerGatewayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
),
)
);
Expand Down

0 comments on commit 2a2dd85

Please sign in to comment.