From 89ce2b443eb8b4d30319d7b873a8e93e5a4a9b20 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 6 Jan 2022 21:06:46 +1100 Subject: [PATCH] Fixes for mollie payment driver --- app/PaymentDrivers/BaseDriver.php | 4 ++-- app/Services/Invoice/TriggeredActions.php | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/PaymentDrivers/BaseDriver.php b/app/PaymentDrivers/BaseDriver.php index c9031daaeae0..a85229956014 100644 --- a/app/PaymentDrivers/BaseDriver.php +++ b/app/PaymentDrivers/BaseDriver.php @@ -256,13 +256,13 @@ class BaseDriver extends AbstractPaymentDriver $this->payment_hash->payment_id = $payment->id; $this->payment_hash->save(); + $this->attachInvoices($payment, $this->payment_hash); + if($this->payment_hash->credits_total() > 0) $payment = $payment->service()->applyCredits($this->payment_hash)->save(); $payment->service()->updateInvoicePayment($this->payment_hash); - $this->attachInvoices($payment, $this->payment_hash); - event('eloquent.created: App\Models\Payment', $payment); if ($this->client->getSetting('client_online_payment_notification') && in_array($status, [Payment::STATUS_COMPLETED, Payment::STATUS_PENDING])) diff --git a/app/Services/Invoice/TriggeredActions.php b/app/Services/Invoice/TriggeredActions.php index b2f2ee395b53..f9b19f4b1b5c 100644 --- a/app/Services/Invoice/TriggeredActions.php +++ b/app/Services/Invoice/TriggeredActions.php @@ -49,6 +49,7 @@ class TriggeredActions extends AbstractService } if ($this->request->has('send_email') && $this->request->input('send_email') == 'true') { + $this->invoice->service()->touchPdf()->save(); $this->sendEmail(); }