1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 16:31:33 +02:00

Merge pull request #6923 from turbo124/v5-develop

Fix for double Update Entity Webhook call
This commit is contained in:
David Bomba 2021-10-30 08:31:24 +11:00 committed by GitHub
commit aaf5cfb7cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 10 additions and 7 deletions

View File

@ -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]);

View File

@ -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() );

View File

@ -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() );

View File

@ -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() );

View File

@ -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;

View File

@ -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());
}

View File

@ -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;
}