8000 Merge pull request #198 from Ferrisbane/Ferrisbane-patch-protocol-4-0… · thephpleague/omnipay-sagepay@2a2dd85 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2a2dd85

Browse files
authored
Merge pull request #198 from Ferrisbane/Ferrisbane-patch-protocol-4-0-fields
Fix protocol 4.00 VPSSignature check
2 parents 79bbd99 + 00d54b3 commit 2a2dd85

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/Message/ServerCompleteAuthorizeRequest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ public function getSignature()
5353
$this->httpRequest->request->get('DeclineCode', '').
5454
$this->httpRequest->request->get('ExpiryDate', '').
5555
$this->httpRequest->request->get('FraudResponse', '').
56-
$this->httpRequest->request->get('BankAuthCode', '');
56+
$this->httpRequest->request->get('BankAuthCode', '').
57+
// New for protocol v4.00
58+
// Described in the docs here: https://developer.elavon.com/products/opayo-server/v1/notification-of-transaction-result
59+
$this->httpRequest->request->get('ACSTransID', '').
60+
$this->httpRequest->request->get('DSTransID', '').
61+
$this->httpRequest->request->get('SchemeTraceID', '');
5762

5863
return md5($signature_string);
5964
}

tests/ServerGatewayTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,14 @@ public function testCompleteAuthorizeSuccess()
120120
'DeclineCode' => '00',
121121
'ExpiryDate' => '0722',
122122
'BankAuthCode' => '999777',
123+
// New fields for protocol v4.0
124+
'ACSTransID' => 'abcuuid',
125+
'DSTransID' => '123uuid',
126+
'SchemeTraceID' => 'V123',
123127
'VPSSignature' => md5(
124128
'{F955C22E-F67B-4DA3-8EA3-6DAC68FA59D2}'
125129
. '438791' . 'OK' . 'bexamplecJEUPDN1N7Edefghijklm' . '00' . '0722' . '999777'
130+
. 'abcuuid' . '123uuid' . 'V123'
126131
),
127132
)
128133
);

0 commit comments

Comments
 (0)
0