Ensure we save auto_bill_tries

This commit is contained in:
David Bomba 2022-06-18 17:10:15 +10:00
parent 7b7fbc5c13
commit f014cda4e6

View File

@ -123,6 +123,7 @@ class AutoBillInvoice extends AbstractService
->setPaymentHash($payment_hash)
->tokenBilling($gateway_token, $payment_hash);
} catch (\Exception $e) {
$this->invoice->auto_bill_tries += 1;
if ($this->invoice->auto_bill_tries == 3) {
@ -131,6 +132,8 @@ class AutoBillInvoice extends AbstractService
$this->invoice->save();
}
$this->invoice->save();
nlog("payment NOT captured for " . $this->invoice->number . " with error " . $e->getMessage());
}