From 3e035410ddbae57125fccabce19c9ae665268fc0 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 24 Jul 2018 17:23:22 +0300 Subject: [PATCH] Fix for auto-bill failure emails --- app/Services/PaymentService.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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