Files
isaaccladandCursor f0bf96b438
Deploy Ladill Mini / deploy (push) Successful in 30s
Strip Mini checkout to amount-only and use vendor email for Paystack.
Customers enter an amount and tap Pay; the merchant's account email (or notifications email from settings) is passed to Paystack instead of asking the payer for details.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 20:22:16 +00:00

55 lines
3.5 KiB
PHP

<x-user-layout>
<x-slot name="title">Payments</x-slot>
@php $fmt = fn ($m) => 'GHS '.number_format($m / 100, 2); @endphp
<div class="space-y-6">
<div>
<h1 class="text-xl font-semibold text-slate-900">Payments</h1>
<p class="mt-1 text-sm text-slate-500">Live feed of incoming customer payments across all your payment QRs.</p>
</div>
<div class="overflow-hidden rounded-2xl border border-slate-200 bg-white">
@if($payments->isEmpty())
<p class="px-6 py-10 text-sm text-slate-500">No payments yet.</p>
@else
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-slate-100 text-sm">
<thead class="bg-slate-50 text-left text-xs font-semibold uppercase tracking-wide text-slate-500">
<tr>
<th class="px-6 py-3">When</th>
<th class="px-6 py-3">Payer</th>
<th class="px-6 py-3">QR / till</th>
<th class="px-6 py-3">Note</th>
<th class="px-6 py-3">Amount</th>
<th class="px-6 py-3">Status</th>
</tr>
</thead>
<tbody class="divide-y divide-slate-100">
@foreach($payments as $payment)
<tr>
<td class="px-6 py-4 text-slate-600">{{ $payment->paid_at?->format('M j, g:i A') ?? $payment->created_at->format('M j, g:i A') }}</td>
<td class="px-6 py-4">
<p class="font-medium text-slate-900">{{ $payment->payer_name ?: 'Walk-in customer' }}</p>
@if($payment->payer_email)
<p class="text-xs text-slate-500">{{ $payment->payer_email }}</p>
@endif
</td>
<td class="px-6 py-4 text-slate-600">{{ $payment->qrCode?->label }}</td>
<td class="px-6 py-4 text-slate-500">{{ $payment->payer_note ?: '—' }}</td>
<td class="px-6 py-4 font-semibold text-slate-900">{{ $fmt($payment->status === \App\Models\MiniPayment::STATUS_PAID ? $payment->merchant_amount_minor : $payment->amount_minor) }}</td>
<td class="px-6 py-4">
<span class="inline-flex rounded-full px-2.5 py-0.5 text-xs font-medium {{ $payment->status === \App\Models\MiniPayment::STATUS_PAID ? 'bg-emerald-50 text-emerald-700' : ($payment->status === \App\Models\MiniPayment::STATUS_FAILED ? 'bg-red-50 text-red-700' : 'bg-amber-50 text-amber-700') }}">
{{ ucfirst($payment->status) }}
</span>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@if($payments->hasPages())
<div class="border-t border-slate-100 px-6 py-4">{{ $payments->links() }}</div>
@endif
@endif
</div>
</div>
</x-user-layout>