@php use App\Enums\Wallet\WalletTransactionStatusEnum; $rawStatus = $transaction->payment_status ?? $transaction->status ?? '-'; $txnStatus = is_callable($rawStatus) ? $rawStatus() : ($rawStatus->value ?? (string) $rawStatus); $rawCompleted = $completedStatus ?? 'completed'; $completedVal = is_callable($rawCompleted) ? $rawCompleted() : ($rawCompleted->value ?? (string) $rawCompleted); $rawFailed = $failedStatus ?? 'failed'; $failedVal = is_callable($rawFailed) ? $rawFailed() : ($rawFailed->value ?? (string) $rawFailed); $displayTitle = $paymentContext['title'] ?? 'Payment Summary'; if (\Illuminate\Support\Str::startsWith($displayTitle, 'labels.')) { $displayTitle = \Illuminate\Support\Facades\Lang::has($displayTitle) ? __($displayTitle) : ucwords(str_replace(['labels.', '_'], ['', ' '], $displayTitle)); } $transactionCurrencyCode = strtoupper((string) ($transaction->gateway_currency_code ?? $transaction->currency_code ?? $transaction->currency ?? $systemSettings['currency'] ?? '')); $transactionAmount = $transaction->gateway_amount ?? $transaction->amount ?? 0; $formattedTransactionAmount = \App\Support\Currency\CurrencySnapshotPayload::formatAmount($transactionAmount, $transactionCurrencyCode) ?? trim(($transactionCurrencyCode ?: '') . ' ' . number_format((float) $transactionAmount, 2)); @endphp @extends('layouts.no-head-foot') @section('title', $displayTitle) @section('content')
@if(($systemSettings['demoMode'] ?? false)) {{$systemSettings['appName'] ?? @else {{$systemSettings['appName'] ?? @endif
@if(strtolower($txnStatus) === strtolower($completedVal)) @elseif(strtolower($txnStatus) === strtolower($failedVal)) @else @endif

{{ $txnStatus }}

{{ $displayTitle }}

@foreach(($paymentContext['lineItems'] ?? []) as $item) @php $itemLabel = $item['label'] ?? ''; if (\Illuminate\Support\Str::startsWith($itemLabel, 'labels.')) { $itemLabel = \Illuminate\Support\Facades\Lang::has($itemLabel) ? __($itemLabel) : ucwords(str_replace(['labels.', '_'], ['', ' '], $itemLabel)); } @endphp
{{ $itemLabel }}: {{ $item['value'] }}
@endforeach
{{ \Illuminate\Support\Facades\Lang::has('labels.system_transaction_id') ? __('labels.system_transaction_id') : 'System Transaction ID' }}: #{{ $transaction->id }}
{{ \Illuminate\Support\Facades\Lang::has('labels.payment_id') ? __('labels.payment_id') : 'Payment ID' }}: {{ $transaction->transaction_id ?? $transaction->transaction_reference ?? '-' }}
{{ \Illuminate\Support\Facades\Lang::has('labels.status') ? __('labels.status') : 'Status' }}: {{ $txnStatus }}

{{ \Illuminate\Support\Facades\Lang::has('labels.amount') ? __('labels.amount') : 'Amount' }} {{ $formattedTransactionAmount }}
@endsection