Handle deleted account when charging renewals
This commit is contained in:
parent
8bc3d6c937
commit
fa18feb8e5
1 changed files with 4 additions and 1 deletions
|
|
@ -70,8 +70,11 @@ class ChargeRenewalInvoices extends Command
|
|||
|
||||
foreach ($invoices as $invoice) {
|
||||
|
||||
// check if account has switched to free since the invoice was created
|
||||
// check if account has switched to free since the invoice was created
|
||||
$account = Account::find($invoice->client->public_id);
|
||||
if ( ! $account) {
|
||||
continue;
|
||||
}
|
||||
$company = $account->company;
|
||||
if ( ! $company->plan || $company->plan == PLAN_FREE) {
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue