diff --git a/app/Services/Invoice/AutoBillInvoice.php b/app/Services/Invoice/AutoBillInvoice.php index 6ae012e3282f..4a5c8cafca99 100644 --- a/app/Services/Invoice/AutoBillInvoice.php +++ b/app/Services/Invoice/AutoBillInvoice.php @@ -123,13 +123,14 @@ class AutoBillInvoice extends AbstractService ->setPaymentHash($payment_hash) ->tokenBilling($gateway_token, $payment_hash); } catch (\Exception $e) { - $this->invoice->auto_bill_tries = $number_of_retries + 1; + $this->invoice->auto_bill_tries += 1; if ($this->invoice->auto_bill_tries == 3) { $this->invoice->auto_bill_enabled = false; $this->invoice->auto_bill_tries = 0; //reset the counter here in case auto billing is turned on again in the future. $this->invoice->save(); } + nlog("payment NOT captured for " . $this->invoice->number . " with error " . $e->getMessage()); }