From 0f6b901f4113aa13d5f27a698967d2ed2fcfd583 Mon Sep 17 00:00:00 2001 From: Raymond Date: Tue, 9 Oct 2018 21:35:46 +0200 Subject: [PATCH] Update Webgains transaction status Update transaction status to be only confirmed when payment status is cleared (or payed?). New transactions were getting confirmed right away while they are still within their cancellation period. --- Oara/Network/Publisher/WebGains.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Oara/Network/Publisher/WebGains.php b/Oara/Network/Publisher/WebGains.php index 5bd9fb39..6df3b933 100755 --- a/Oara/Network/Publisher/WebGains.php +++ b/Oara/Network/Publisher/WebGains.php @@ -237,7 +237,11 @@ public function getTransactionList($merchantList = null, \DateTime $dStartDate = $transaction['commission'] = $transactionObject->commission; // Check both for status + paymentStatus if ($transactionObject->status == 'confirmed') { + if ($transactionObject->paymentStatus == 'paid' || $transactionObject->paymentStatus == 'cleared') { $transaction['status'] = \Oara\Utilities::STATUS_CONFIRMED; + } else { + $transaction['status'] = \Oara\Utilities::STATUS_PENDING; + } } elseif ($transactionObject->status == 'delayed') { $transaction['status'] = \Oara\Utilities::STATUS_PENDING; @@ -245,7 +249,7 @@ public function getTransactionList($merchantList = null, \DateTime $dStartDate = elseif ($transactionObject->status == 'cancelled') { $transaction['status'] = \Oara\Utilities::STATUS_DECLINED; } - if ($transactionObject->paymentStatus == 'paid') { + if ($transactionObject->paymentStatus == 'paid' || $transactionObject->paymentStatus == 'cleared') { $transaction['paid'] = true; } else {