@extends('admin.layouts.master') @section('title', 'Payment Info') @section('content') @include('admin.partials.page-header', [ 'title' => 'Payment Detail', 'crumbs' => [ ['label' => 'Payments', 'url' => route('admin.payment.index')], ['label' => 'Detail'], ], ]) @php $home = $payment->funeral?->funeralHome; $funeralHomeName = $home ? ($home->funeral_home_name ?: $home->contact_person ?: $home->user_name) : null; if (! $funeralHomeName && $payment->user) { $funeralHomeName = $payment->user->funeral_home_name ?: $payment->user->contact_person ?: $payment->user->user_name; } $amount = number_format((float) ($payment->p_amount ?: 0), 2); $currency = strtoupper(trim((string) ($payment->p_currency ?: 'USD'))) ?: 'USD'; $last4 = preg_replace('/\D+/', '', (string) ($payment->p_card_lastdigit ?: '')); $brand = trim((string) ($payment->p_card ?: '')); $cardLabel = $last4 !== '' ? trim(($brand !== '' ? ucfirst($brand).' ยท ' : '').'XXXX '.$last4) : '---'; @endphp
| Funeral Home | {{ $funeralHomeName ?: '---' }} |
|---|---|
| Memorial | {{ $payment->funeral?->f_name ?: '---' }} |
| Payment ID | {{ $payment->p_payment_id ?: '---' }} |
| Amount | {{ $currency }} ${{ $amount }} |
| Card | {{ $cardLabel }} |
| Date | {{ $payment->p_date ? \Carbon\Carbon::parse($payment->p_date)->format('m-d-Y H:i:s') : '---' }} |
| Status | @if ((string) $payment->p_status === '1') Paid @else Pending @endif |