From c30d79138a36e7d7cf6c4af9d2474b461b4cde81 Mon Sep 17 00:00:00 2001 From: Alex Cabal Date: Thu, 5 Dec 2024 10:46:24 -0600 Subject: [PATCH] Fix logic in payment process script --- scripts/process-pending-payments | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/process-pending-payments b/scripts/process-pending-payments index 6be87dbf..0a58c4cd 100755 --- a/scripts/process-pending-payments +++ b/scripts/process-pending-payments @@ -82,7 +82,7 @@ try{ ) ', [$pendingPayment->TransactionId])){ $log->Write('Donation already exists in database.'); - continue 2; // `switch` is considered a "loop" by PHP. + break; } $driver->get('https://fundraising.fracturedatlas.org/admin/donations?query=' . $pendingPayment->TransactionId); @@ -115,7 +115,7 @@ try{ } catch(Exception){ $log->Write('Error: Couldn\'t find donation.'); - continue 2; // `switch` is considered a "loop" by PHP. + break; } $toggleButton->click(); @@ -185,7 +185,7 @@ try{ catch(Exceptions\PaymentExistsException){ // Payment already exists, just continue. $log->Write('Donation already in database.'); - continue 2; // `switch` is considered a "loop" by PHP. + break; } // Does this payment create a new Patron in the Patrons Circle? @@ -290,15 +290,15 @@ try{ $em->Send(); } } - - Db::Query(' - DELETE - from PendingPayments - where TransactionId = ? - ', [$pendingPayment->TransactionId]); - - $log->Write('Donation processed.'); } + + Db::Query(' + DELETE + from PendingPayments + where TransactionId = ? + ', [$pendingPayment->TransactionId]); + + $log->Write('Donation processed.'); } } catch(Exception $ex){