@php $txn = $transaction; $order = $txn->order; $user = $order?->user; $customer = $user?->customer; $address = $order?->shippingAddress; $items = $order?->items ?? collect(); $state = strtoupper($txn->verified_state ?? 'UNKNOWN'); $pillClass = match($state) { 'COMPLETED' => 'success', 'FAILED' => 'failed', default => 'pending', }; $pillIcon = match($state) { 'COMPLETED' => '✓', 'FAILED' => '✕', default => '⏳', }; $pillLabel = match($state) { 'COMPLETED' => 'Payment Successful', 'FAILED' => 'Payment Failed', default => 'Payment Pending', }; $subtotal = $items->sum(fn($i) => ($i->price ?? 0) * ($i->quantity ?? 1)); $shipping = $order?->shipping_charge ?? 0; $discount = $order?->discount_amount ?? 0; $total = $order?->total_amount ?? $txn->amount ?? 0; @endphp {{-- ACTION BAR --}}
← Back
{{-- RECEIPT --}}
{{-- HEADER --}}
Pe
PhonePe
Payment Receipt
Amount Paid
₹{{ number_format($txn->amount ?? 0, 2) }}
{{ $pillIcon }} {{ $pillLabel }} Ref: {{ $txn->transaction_id ?? $txn->merchant_transaction_id ?? 'N/A' }}
{{-- BODY --}}
{{-- FAILURE REASON --}} @if($state === 'FAILED' && $txn->response_code)
⚠ Failure Reason: {{ $txn->response_code }}
@endif {{-- TRANSACTION DETAILS --}}
Transaction Details
Transaction ID
{{ $txn->transaction_id ?? '—' }}
Merchant Transaction ID
{{ $txn->merchant_transaction_id ?? '—' }}
UTR Number
{{ $txn->utr ?? '—' }}
Payment Reference No
{{ $txn->payment_reference_no ?? '—' }}
Payment Mode
{{ $txn->payment_mode ?? 'UPI' }}
Payment Method
{{ $txn->payment_method ?? '—' }}
Currency
{{ $txn->currency ?? 'INR' }}
Payment Date
{{ $txn->payment_date ? \Carbon\Carbon::parse($txn->payment_date)->format('d-m-Y h:i A') : $txn->created_at->format('d-m-Y h:i A') }}
{{-- ORDER DETAILS --}} @if($order)
Order Details
Order Number
#{{ $order->order_number }}
Order Status
{{ ucfirst(str_replace('_', ' ', $order->order_status ?? '—')) }}
Payment Status
{{ ucfirst($order->payment_status ?? '—') }}
Order Date
{{ $order->created_at->format('d-m-Y h:i A') }}
@endif {{-- CUSTOMER DETAILS --}} @if($user)
Customer Details
Name
{{ $user->name ?? '—' }}
Mobile
{{ $user->mobile ?? $customer?->phone ?? '—' }}
Email
{{ $user->email ?? '—' }}
@if($address)
Delivery Address
{{ implode(', ', array_filter([ $address->address_line1 ?? null, $address->city ?? null, $address->state ?? null, $address->pincode ?? null, ])) }}
@endif
@endif {{-- ORDER ITEMS --}} @if($items->count())
Items Ordered
@foreach($items as $item) @endforeach
Item Qty Price Total
{{ $item->product_name ?? $item->name ?? 'Item' }}
@if($item->variant ?? null)
{{ $item->variant }}
@endif
{{ $item->quantity ?? 1 }} ₹{{ number_format($item->price ?? 0, 2) }} ₹{{ number_format(($item->price ?? 0) * ($item->quantity ?? 1), 2) }}
{{-- TOTALS --}}
Subtotal ₹{{ number_format($subtotal, 2) }}
@if($shipping > 0)
Shipping ₹{{ number_format($shipping, 2) }}
@endif @if($discount > 0)
Discount −₹{{ number_format($discount, 2) }}
@endif
Total Paid ₹{{ number_format($total, 2) }}
@endif
{{-- /receipt-body --}} {{-- FOOTER --}}
{{-- /receipt --}}