Skip to content

Commit 3759bb0

Browse files
authored
Merge pull request #13 from superbrave/check-transaction-reference
Check if we're updating the correct transaction
2 parents e6cb614 + 2515ea0 commit 3759bb0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Message/TransactionStatusRequest.php

+6
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ private function getTransactionStatusFromPostBack(): ?TransactionStatusResponse
7777

7878
$this->setContractProfileId($contentAsStdObj->ContractProfileId);
7979

80+
// Make sure we're updating the correct payment by reference, and not all of them.
81+
// Note: $contentAsArray['Reference'] is not the same as TransactionReference.
82+
if ($this->getTransactionReference() !== trim($contentAsArray['TransactionId'])) {
83+
return null;
84+
}
85+
8086
if ($this->validateSecurityHashMatch($this->httpRequest, $contentAsStdObj) === false) {
8187
return null;
8288
}

0 commit comments

Comments
 (0)