diff --git a/app/Services/Invoice/AutoBillInvoice.php b/app/Services/Invoice/AutoBillInvoice.php index 4a5c8cafca99..fa0f8f0bea05 100644 --- a/app/Services/Invoice/AutoBillInvoice.php +++ b/app/Services/Invoice/AutoBillInvoice.php @@ -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()); }