{{-- components/receipt.blade.php Struk reusable — dipakai di invoice top-up, detail deposit, bayar QRIS. Usage: @include('components.receipt', [ 'status' => 'success' | 'pending' | 'failed', 'logo_type' => 'qris'|'dana'|'gopay'|'ovo'|'shopeepay'|'bca'|'bni'|'bri'|'mandiri'|'permata'|'va', // ATAU: 'logo_image' => $game->image ?? null, // URL gambar (game icon) — diprioritaskan 'logo_icon' => 'fa-store', // FontAwesome fallback jika logo_image/logo_type tidak ada 'merchant_name' => 'QRIS2', 'merchant_sub' => 'Deposit Saldo', 'date' => $tx->created_at, 'ref_label' => 'No. Invoice', 'ref_value' => $tx->invoice_number, 'amount' => $tx->price, 'amount_label' => 'Total Bayar', 'method' => 'Saldo KioStore', 'rows' => [ ['label' => 'Nominal', 'value' => 'Rp 10.000'], ['label' => 'Biaya Admin', 'value' => 'Rp 0'], ], 'note' => 'Teks kecil di bawah nominal.', 'full_bleed' => true, ]) --}} @php $rcptStatus = $status ?? 'pending'; $rcptSvg = match(true) { $rcptStatus === 'success' => '', in_array($rcptStatus, ['failed','cancel','cancelled']) => '', $rcptStatus === 'waiting_payment' => '', default => '', }; $rcptIconBg = match($rcptStatus) { 'success' => 'var(--success-l)', 'failed' => 'var(--danger-l)', default => 'var(--warning-l)', }; $rcptIconColor = match($rcptStatus) { 'success' => 'var(--success)', 'failed' => 'var(--danger)', default => 'var(--warning)', }; $rcptIconGlyph = match($rcptStatus) { 'success' => 'fa-check', 'failed' => 'fa-xmark', default => 'fa-clock', }; $rcptTitle = $title ?? match($rcptStatus) { 'success' => 'Pembayaran Berhasil', 'failed' => 'Pembayaran Gagal', default => 'Menunggu Pembayaran', }; $rcptAmountColor = match($rcptStatus) { 'failed' => 'var(--danger)', default => 'var(--text)', }; $rid = 'rcpt' . substr(md5(($ref_value ?? '') . microtime()), 0, 8); @endphp
{{ $rcptTitle }}
{{ $note }}
@endif{{ $merchant_sub ?? ($logo_text ?? 'KioStore') }}