From 2515ea0a8117dca9f87ac39142ed32930220dc87 Mon Sep 17 00:00:00 2001 From: Krijn Date: Wed, 4 Mar 2020 16:07:18 +0100 Subject: [PATCH] Check if we're updating the correct transaction by checking the TransactionReference to the TransactionId as sent by icepay --- src/Message/TransactionStatusRequest.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Message/TransactionStatusRequest.php b/src/Message/TransactionStatusRequest.php index ef28af1..1fc2c21 100755 --- a/src/Message/TransactionStatusRequest.php +++ b/src/Message/TransactionStatusRequest.php @@ -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; }