Fix logic in payment process script

This commit is contained in:
Alex Cabal 2024-12-05 10:46:24 -06:00
parent c28cfcda9f
commit c30d79138a

View file

@ -82,7 +82,7 @@ try{
) )
', [$pendingPayment->TransactionId])){ ', [$pendingPayment->TransactionId])){
$log->Write('Donation already exists in database.'); $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); $driver->get('https://fundraising.fracturedatlas.org/admin/donations?query=' . $pendingPayment->TransactionId);
@ -115,7 +115,7 @@ try{
} }
catch(Exception){ catch(Exception){
$log->Write('Error: Couldn\'t find donation.'); $log->Write('Error: Couldn\'t find donation.');
continue 2; // `switch` is considered a "loop" by PHP. break;
} }
$toggleButton->click(); $toggleButton->click();
@ -185,7 +185,7 @@ try{
catch(Exceptions\PaymentExistsException){ catch(Exceptions\PaymentExistsException){
// Payment already exists, just continue. // Payment already exists, just continue.
$log->Write('Donation already in database.'); $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? // Does this payment create a new Patron in the Patrons Circle?
@ -290,6 +290,7 @@ try{
$em->Send(); $em->Send();
} }
} }
}
Db::Query(' Db::Query('
DELETE DELETE
@ -299,7 +300,6 @@ try{
$log->Write('Donation processed.'); $log->Write('Donation processed.');
} }
}
} }
catch(Exception $ex){ catch(Exception $ex){
$exceptionString = vds($ex); $exceptionString = vds($ex);