Payment receipt
@php // ---------- Data hygiene & fallbacks ---------- // Amount is expected in cents. Prefer the explicit param, then Payment fields. $amountCents = (int) ( ($amount ?? null) !== null ? $amount : ($amount_cents ?? null) ?? ($amountCents ?? null) ?? ($payment->amount_cents ?? $payment->amount ?? 0) ); // Ensure non-negative $amountCents = max(0, (int) $amountCents); // Currency code $code = strtoupper($currency ?? $payment->currency ?? 'NZD'); // Simple symbol map $symbols = ['NZD'=>'$','USD'=>'$','AUD'=>'$','EUR'=>'€','GBP'=>'£','CAD'=>'$']; $sym = $symbols[$code] ?? null; // Human display: prefer symbol + code (so it’s unambiguous) $amountDisplay = ($sym ? $sym : '') . number_format($amountCents/100, 2) . ' ' . $code; // Paid/created date try { $tz = config('app.timezone', 'UTC'); $date = \Illuminate\Support\Carbon::parse($payment->paid_at ?? $payment->created_at ?? now())->timezone($tz)->format('j M Y, g:i a'); } catch (\Throwable $e) { $date = ''; } @endphp@if(!empty($job?->id)) Job #{{ $job->id }} • @endif @if($date) {{ $date }} @endif
Amount
{{ $amountDisplay }}
@if(!empty($job?->customer_name))
Customer
{{ $job->customer_name }}
@endif
@if(!empty($job?->customer_email))
{{ $job->customer_name }}
Email
{{ $job->customer_email }}
@endif
@if(!empty($payment?->reference))
{{ $job->customer_email }}
Reference
@endif
@php $chargeId = $payment->stripe_charge ?? $payment->stripe_charge_id ?? null; @endphp
@if($chargeId)
{{ $payment->reference }}Stripe charge
@endif
{{ $chargeId }}Thank you for your payment.