Payment receipt
@php // Amount + currency (robust) $amountCents = isset($amountCents) ? (int) $amountCents : (int) ($payment->amount_cents ?? $payment->amount ?? 0); $code = strtoupper($currency ?? $payment->currency ?? $job->currency ?? 'NZD'); $symbols = ['NZD'=>'NZ$', 'USD'=>'$', 'AUD'=>'A$', 'EUR'=>'€', 'GBP'=>'£', 'CAD'=>'C$']; $sym = $symbols[$code] ?? $code; $formatted = number_format($amountCents / 100, 2); // Date formatter $fmtDate = function($v) { try { if ($v instanceof \Carbon\Carbon || $v instanceof \Illuminate\Support\Carbon) { $c = $v; } else { $c = \Carbon\Carbon::parse($v); } return $c->format('D d M Y, h:ia'); } catch (\Throwable $e) { return $v ?: null; } }; $startText = isset($startAt) ? $fmtDate($startAt) : null; $endText = isset($endAt) ? $fmtDate($endAt) : null; @endphp>Amount:
{{ $sym }} {{ $formatted }} {{ $code }}
Booking reference:
{{ $bookingRef }}Hire dates:
@if($startText && $endText)
{{ $startText }} – {{ $endText }}
@elseif($startText)
{{ $startText }}
@elseif($endText)
{{ $endText }}
@endif
Reference:
{{ $payment->reference }}Charge:
{{ $payment->stripe_charge ?? $payment->stripe_charge_id }}Customer:
{{ $job->customer_name }}
Thank you for your payment.