From fc276970a05295d167ab8dee86bfc5b9118620a2 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 13 Oct 2021 18:56:10 +1100 Subject: [PATCH] Payment Failure --- app/Mail/Admin/ClientPaymentFailureObject.php | 2 +- app/PaymentDrivers/BaseDriver.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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());