Skip to content

Commit

Permalink
Merge pull request #13 from superbrave/check-transaction-reference
Browse files Browse the repository at this point in the history
Check if we're updating the correct transaction
  • Loading branch information
krijn-sb authored Mar 5, 2020
2 parents e6cb614 + 2515ea0 commit 3759bb0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Message/TransactionStatusRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ private function getTransactionStatusFromPostBack(): ?TransactionStatusResponse

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

// Make sure we're updating the correct payment by reference, and not all of them.
// Note: $contentAsArray['Reference'] is not the same as TransactionReference.
if ($this->getTransactionReference() !== trim($contentAsArray['TransactionId'])) {
return null;
}

if ($this->validateSecurityHashMatch($this->httpRequest, $contentAsStdObj) === false) {
return null;
}
Expand Down

0 comments on commit 3759bb0

Please sign in to comment.