mirror of
https://github.com/hotspotbilling/phpnuxbill.git
synced 2025-08-29 14:28:13 +02:00
add try catch to handle invalid value
This commit is contained in:
parent
97296abf06
commit
234e5e3967
2 changed files with 21 additions and 5 deletions
|
@ -333,10 +333,25 @@ $unpaid = ORM::for_table('tbl_payment_gateway')
|
|||
->find_one();
|
||||
|
||||
// check expired payments
|
||||
if($unpaid && (strtotime($unpaid['expired_date']) < time() || strtotime($unpaid['created_date'], "+24 HOUR") < time())){
|
||||
$unpaid->status = 4;
|
||||
$unpaid->save();
|
||||
$unpaid = [];
|
||||
if ($unpaid) {
|
||||
try {
|
||||
if (strtotime($unpaid['expired_date']) < time()) {
|
||||
$unpaid->status = 4;
|
||||
$unpaid->save();
|
||||
$unpaid = [];
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
try {
|
||||
if (strtotime($unpaid['created_date'], "+24 HOUR") < time()) {
|
||||
$unpaid->status = 4;
|
||||
$unpaid->save();
|
||||
$unpaid = [];
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
}
|
||||
|
||||
$ui->assign('unpaid', $unpaids);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue