Refactor process_payment_record into reusable payment_processor.php helper

Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-10-29 01:42:24 +00:00
parent c9e5e6d18a
commit 4e73997a4b
4 changed files with 196 additions and 187 deletions

View file

@ -148,10 +148,12 @@ if (in_array($type, ['PAYMENT.CAPTURE.COMPLETED','PAYMENT.SALE.COMPLETED'], true
$status = 'WROTE_FILE';
// Attempt to mark order paid in DB
$ps = __DIR__ . '/payment_success.php';
if (is_file($ps)) {
require_once($ps);
try { process_payment_record($record); } catch (Exception $e) { if (function_exists('site_log_error')) site_log_error('process_payment_fail',['err'=>$e->getMessage()]); else log_line('PROC_FAIL '.$e->getMessage()); }
require_once(__DIR__ . '/includes/payment_processor.php');
try {
process_payment_record($record);
} catch (Exception $e) {
if (function_exists('site_log_error')) site_log_error('process_payment_fail',['err'=>$e->getMessage()]);
else log_line('PROC_FAIL '.$e->getMessage());
}
}