mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Minor fixes for auto billing
This commit is contained in:
parent
d7a505546c
commit
7f1cf9ea30
@ -123,13 +123,14 @@ class AutoBillInvoice extends AbstractService
|
|||||||
->setPaymentHash($payment_hash)
|
->setPaymentHash($payment_hash)
|
||||||
->tokenBilling($gateway_token, $payment_hash);
|
->tokenBilling($gateway_token, $payment_hash);
|
||||||
} catch (\Exception $e) {
|
} 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) {
|
if ($this->invoice->auto_bill_tries == 3) {
|
||||||
$this->invoice->auto_bill_enabled = false;
|
$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->auto_bill_tries = 0; //reset the counter here in case auto billing is turned on again in the future.
|
||||||
$this->invoice->save();
|
$this->invoice->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
nlog("payment NOT captured for " . $this->invoice->number . " with error " . $e->getMessage());
|
nlog("payment NOT captured for " . $this->invoice->number . " with error " . $e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user