{{-- 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
{!! $rcptSvg !!}

{{ $rcptTitle }}

Rp {{ number_format($amount ?? 0, 0, ',', '.') }}

@if(!empty($note))

{{ $note }}

@endif
@if(!empty($merchant_name) || !empty($logo_image) || !empty($logo_icon) || !empty($logo_type ?? null))
@php $lt = $logo_type ?? null; @endphp @if(!empty($logo_image)) {{-- Game/product image --}} @elseif($lt === 'qris')
QRIS
@elseif($lt === 'dana')
DANA
@elseif($lt === 'gopay')
GoPay
@elseif($lt === 'ovo')
OVO
@elseif($lt === 'shopeepay')
@elseif($lt === 'bca')
BCA
@elseif($lt === 'bni')
BNI
@elseif($lt === 'bri')
BRI
@elseif($lt === 'mandiri')
mandiri
@elseif($lt === 'permata')
permata
@elseif($lt === 'va')
@else @endif

{{ $merchant_name ?? $logo_text ?? 'Transaksi' }}

{{ $merchant_sub ?? ($logo_text ?? 'KioStore') }}

@endif
@if(!empty($method))
Metode Pembayaran {{ $method }}
@endif
Waktu {{ ($date ?? now())->format('d M Y, H:i') }}
@if(!empty($ref_value))
{{ $ref_label ?? 'ID Transaksi' }}
{{ $ref_value }}
@endif @if(!empty($rows))
@foreach($rows as $row)
{{ $row['label'] }} {{ $row['value'] }}
@endforeach
@endif