Fixes for payment failure mailer

This commit is contained in:
David Bomba 2023-03-24 10:54:13 +11:00
parent 0caba1fdf6
commit ca37cd268e

View File

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