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:
parent
c9e5e6d18a
commit
4e73997a4b
4 changed files with 196 additions and 187 deletions
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue