diff --git a/app/Mail/Admin/ClientPaymentFailureObject.php b/app/Mail/Admin/ClientPaymentFailureObject.php index 3489274ba1da..c18101b2edae 100644 --- a/app/Mail/Admin/ClientPaymentFailureObject.php +++ b/app/Mail/Admin/ClientPaymentFailureObject.php @@ -62,7 +62,7 @@ class ClientPaymentFailureObject /* Init a new copy of the translator*/ $t = app('translator'); /* Set the locale*/ - App::setLocale($this->company->getLocale()); + App::setLocale($this->client->locale()); /* Set customized translations _NOW_ */ $t->replace(Ninja::transformTranslations($this->company->settings)); diff --git a/app/PaymentDrivers/BaseDriver.php b/app/PaymentDrivers/BaseDriver.php index ecb74e416af5..f6ed9c223bec 100644 --- a/app/PaymentDrivers/BaseDriver.php +++ b/app/PaymentDrivers/BaseDriver.php @@ -378,7 +378,7 @@ class BaseDriver extends AbstractPaymentDriver $this->payment_hash ); - if (!is_null($this->payment_hash)) { + if ($this->payment_hash && is_array($this->payment_hash->invoices())) { $nmo = new NinjaMailerObject; $nmo->mailable = new NinjaMailer((new ClientPaymentFailureObject($gateway->client, $error, $gateway->client->company, $this->payment_hash))->build());