Convert some constants to enums

This commit is contained in:
Alex Cabal 2024-05-11 13:23:15 -05:00
parent 06425d3dd6
commit ee7c8343dd
52 changed files with 282 additions and 268 deletions

View file

@ -65,12 +65,12 @@ function InsertTransaction($transactionId){
if(!$exists){
Db::Query('INSERT into PendingPayments
(Created,
ChannelId,
Processor,
TransactionId)
values (utc_timestamp(),
?,
?)',
[PAYMENT_CHANNEL_FA, $transactionId]);
[PaymentProcessor::FracturedAtlas, $transactionId]);
return true;
}

View file

@ -69,7 +69,8 @@ try{
$driver = FirefoxDriver::start($capabilities);
foreach($pendingPayments as $pendingPayment){
if($pendingPayment->ChannelId == PAYMENT_CHANNEL_FA){
$pendingPayment->Processor = PaymentProcessor::from($pendingPayment->Processor);
if($pendingPayment->Processor == PaymentProcessor::FracturedAtlas){
$log->Write('Processing donation ' . $pendingPayment->TransactionId . ' ...');
if(Db::QueryInt('
@ -121,7 +122,7 @@ try{
$payment = new Payment();
$payment->User = new User();
$payment->ChannelId = $pendingPayment->ChannelId;
$payment->Processor = $pendingPayment->Processor;
try{
// If the donation is via a foundation (like American Online Giving Foundation) then there will be a 'soft credit' <th> element.
if(sizeof($detailsRow->findElements(WebDriverBy::xpath('//th[normalize-space(.) = "Soft Credit Donor Info"]'))) > 0){