From 7f1cf9ea30ae626dffb33e32773facb38280107e Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 18 May 2022 14:37:11 +1000 Subject: [PATCH] Minor fixes for auto billing --- app/Services/Invoice/AutoBillInvoice.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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()); }