diff --git a/app/Services/PaymentService.php b/app/Services/PaymentService.php index 41343abbd3be..62fb1bcd88e6 100644 --- a/app/Services/PaymentService.php +++ b/app/Services/PaymentService.php @@ -11,6 +11,7 @@ use App\Ninja\Datatables\PaymentDatatable; use App\Ninja\Repositories\AccountRepository; use App\Ninja\Repositories\PaymentRepository; use Auth; +use App; use Exception; use Utils; @@ -141,7 +142,7 @@ class PaymentService extends BaseService $message = sprintf('%s: %s', ucwords($paymentDriver->providerName()), $exception->getMessage()); //$message .= $exception->getTraceAsString(); Utils::logError($message, 'PHP', true); - if (! Auth::check()) { + if (App::runningInConsole()) { $mailer = app('App\Ninja\Mailers\UserMailer'); $mailer->sendMessage($invoice->user, $subject, $message, [ 'invoice' => $invoice