From ca37cd268ec2c42577382bcd52409dab900ef607 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 24 Mar 2023 10:54:13 +1100 Subject: [PATCH] Fixes for payment failure mailer --- app/Jobs/Mail/PaymentFailedMailer.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Jobs/Mail/PaymentFailedMailer.php b/app/Jobs/Mail/PaymentFailedMailer.php index 4408637ba2b1..77c70fede9d6 100644 --- a/app/Jobs/Mail/PaymentFailedMailer.php +++ b/app/Jobs/Mail/PaymentFailedMailer.php @@ -79,7 +79,8 @@ class PaymentFailedMailer implements ShouldQueue $invoice = false; if ($this->payment_hash) { - $amount = array_sum(array_column($this->payment_hash->invoices(), 'amount')) + $this->payment_hash->fee_total; + // $amount = array_sum(array_column($this->payment_hash->invoices(), 'amount')) + $this->payment_hash->fee_total; + $amount =$this->payment_hash?->amount_with_fee() ?: 0; $invoice = Invoice::whereIn('id', $this->transformKeys(array_column($this->payment_hash->invoices(), 'invoice_id')))->withTrashed()->first(); }