diff --git a/app/Jobs/Util/VersionCheck.php b/app/Jobs/Util/VersionCheck.php index 32dc7a2ac6..262d2cec82 100644 --- a/app/Jobs/Util/VersionCheck.php +++ b/app/Jobs/Util/VersionCheck.php @@ -37,7 +37,7 @@ class VersionCheck implements ShouldQueue { $version_file = trim(file_get_contents(config('ninja.version_url'))); - info("latest version = {$version_file}"); + nlog("latest version = {$version_file}"); if ($version_file) { Account::whereNotNull('id')->update(['latest_version' => $version_file]); diff --git a/app/Listeners/Credit/CreditEmailedNotification.php b/app/Listeners/Credit/CreditEmailedNotification.php index c3a1ef17bf..ad259f781e 100644 --- a/app/Listeners/Credit/CreditEmailedNotification.php +++ b/app/Listeners/Credit/CreditEmailedNotification.php @@ -42,7 +42,7 @@ class CreditEmailedNotification implements ShouldQueue $credit = $event->invitation->credit; $credit->last_sent_date = now(); - $credit->save(); + $credit->saveQuietly(); $nmo = new NinjaMailerObject; $nmo->mailable = new NinjaMailer( (new EntitySentObject($event->invitation, 'credit', $event->template))->build() ); diff --git a/app/Listeners/Invoice/InvoiceEmailedNotification.php b/app/Listeners/Invoice/InvoiceEmailedNotification.php index 59ac94e2c3..3918c630f1 100644 --- a/app/Listeners/Invoice/InvoiceEmailedNotification.php +++ b/app/Listeners/Invoice/InvoiceEmailedNotification.php @@ -42,7 +42,7 @@ class InvoiceEmailedNotification implements ShouldQueue $invoice = $event->invitation->invoice; $invoice->last_sent_date = now(); - $invoice->save(); + $invoice->saveQuietly(); $nmo = new NinjaMailerObject; $nmo->mailable = new NinjaMailer( (new EntitySentObject($event->invitation, 'invoice', $event->template))->build() ); diff --git a/app/Listeners/Quote/QuoteEmailedNotification.php b/app/Listeners/Quote/QuoteEmailedNotification.php index c601dbfa18..68d1264c11 100644 --- a/app/Listeners/Quote/QuoteEmailedNotification.php +++ b/app/Listeners/Quote/QuoteEmailedNotification.php @@ -42,7 +42,7 @@ class QuoteEmailedNotification implements ShouldQueue $quote = $event->invitation->quote; $quote->last_sent_date = now(); - $quote->save(); + $quote->saveQuietly(); $nmo = new NinjaMailerObject; $nmo->mailable = new NinjaMailer( (new EntitySentObject($event->invitation, 'quote', $event->template))->build() ); diff --git a/app/PaymentDrivers/BaseDriver.php b/app/PaymentDrivers/BaseDriver.php index 397583bd6e..9c6238c506 100644 --- a/app/PaymentDrivers/BaseDriver.php +++ b/app/PaymentDrivers/BaseDriver.php @@ -405,6 +405,10 @@ class BaseDriver extends AbstractPaymentDriver public function sendFailureMail(string $error) { + if (!is_null($this->payment_hash)) { + $this->unWindGatewayFees($this->payment_hash); + } + PaymentFailedMailer::dispatch( $this->payment_hash, $this->client->company, @@ -419,7 +423,6 @@ class BaseDriver extends AbstractPaymentDriver if ($this->payment_hash && is_array($this->payment_hash->invoices())) { - $nmo = new NinjaMailerObject; $nmo->mailable = new NinjaMailer((new ClientPaymentFailureObject($this->client, $error, $this->client->company, $this->payment_hash))->build()); $nmo->company = $this->client->company; diff --git a/app/PaymentDrivers/PayFastPaymentDriver.php b/app/PaymentDrivers/PayFastPaymentDriver.php index 591c6d3477..30a550e58d 100644 --- a/app/PaymentDrivers/PayFastPaymentDriver.php +++ b/app/PaymentDrivers/PayFastPaymentDriver.php @@ -79,7 +79,7 @@ class PayFastPaymentDriver extends BaseDriver } catch(\Exception $e) { - echo '##PAYFAST## There was an exception: '.$e->getMessage(); + nlog('##PAYFAST## There was an exception: '.$e->getMessage()); } diff --git a/app/Services/Payment/UpdateInvoicePayment.php b/app/Services/Payment/UpdateInvoicePayment.php index 88aa818568..a267d1f41b 100644 --- a/app/Services/Payment/UpdateInvoicePayment.php +++ b/app/Services/Payment/UpdateInvoicePayment.php @@ -89,7 +89,7 @@ class UpdateInvoicePayment event(new InvoiceWasUpdated($invoice, $invoice->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null))); }); - $this->payment->save(); + $this->payment->saveQuietly(); return $this->payment; }