@php
// HITUNG DI TEMPAT: Biar gak ilang-ilangan pas polling
$basePriceForFee = ($rental->subtotal_harga - $rental->potongan_diskon) + $rental->kode_unik_pembayaran;
$displayFee = 0;
$displayLabel = '';
$currentChan = $selectedChannel ?: $rental->metode_pembayaran;
if ($currentChan === 'qris') {
$displayFee = floor($basePriceForFee * 0.007);
$displayLabel = '(0.7%)';
} elseif (in_array($currentChan, ['bca', 'mandiri', 'bni', 'bri', 'permata', 'bsi', 'cimb'])) {
$displayFee = 4000;
$displayLabel = '(Bank Fee)';
}
@endphp
@if($displayFee > 0)
Biaya Layanan {{ $displayLabel }}
+ Rp {{ number_format($displayFee, 0, ',', '.') }}
@endif
Total Tagihan
Rp {{ number_format($basePriceForFee + $displayFee, 0, ',', '.') }}
@endif
@if(!$paymentInfo)
@php
$savedPayment = \App\Models\Setting::getVal('payment_methods', '[]');
$activeMethods = json_decode($savedPayment, true) ?: [];
$banks = [
['id' => 'bca', 'name' => 'BCA', 'sub' => 'Transfer otomatis', 'icon' => 'BCA', 'color' => 'bg-blue-500/10 text-blue-600 border-blue-500/20'],
['id' => 'mandiri', 'name' => 'Mandiri', 'sub' => 'Mandiri bill', 'icon' => 'MDR', 'color' => 'bg-yellow-500/10 text-yellow-600 border-yellow-500/20'],
['id' => 'bni', 'name' => 'BNI', 'sub' => 'Transfer otomatis', 'icon' => 'BNI', 'color' => 'bg-orange-500/10 text-orange-600 border-orange-500/20'],
['id' => 'bri', 'name' => 'BRI', 'sub' => 'Transfer otomatis', 'icon' => 'BRI', 'color' => 'bg-cyan-500/10 text-cyan-600 border-cyan-500/20'],
['id' => 'permata', 'name' => 'Permata', 'sub' => 'Transfer bank', 'icon' => 'PRM', 'color' => 'bg-violet-500/10 text-violet-600 border-violet-500/20'],
['id' => 'bsi', 'name' => 'BSI', 'sub' => 'Transfer otomatis', 'icon' => 'BSI', 'color' => 'bg-teal-500/10 text-teal-600 border-teal-500/20'],
['id' => 'cimb', 'name' => 'CIMB', 'sub' => 'Transfer otomatis', 'icon' => 'CMB', 'color' => 'bg-red-500/10 text-red-600 border-red-500/20'],
['id' => 'qris', 'name' => 'QRIS', 'sub' => 'Gopay / ShopeePay / QR', 'icon' => 'QR', 'color' => 'bg-fuchsia-500/10 text-fuchsia-600 border-fuchsia-500/20'],
['id' => 'cash', 'name' => 'Bayar di Tempat', 'sub' => 'Tunai / Cash di Lokasi', 'icon' => 'CSH', 'color' => 'bg-zinc-500/10 text-zinc-600 border-zinc-500/20'],
];
// Filter hanya bank yang dicentang di Admin Settings
$filteredBanks = collect($banks)->filter(function($bank) use ($activeMethods) {
return isset($activeMethods[$bank['id']]) && $activeMethods[$bank['id']] == true;
})->all();
@endphp
@foreach($filteredBanks as $bank)
@endforeach
@if($selectedChannel === 'qris')
Silakan scan kode QRIS
@php
$qrUrl = null;
if (isset($paymentInfo['actions'])) {
$qrAction = collect($paymentInfo['actions'])->where('name', 'generate-qr-code')->first();
$qrUrl = $qrAction['url'] ?? null;
}
// FALLBACK: Jika action ga ada, tapi ada qr_string, kita pake generator luar
if (!$qrUrl && isset($paymentInfo['qr_string'])) {
$qrUrl = "https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=" . $paymentInfo['qr_string'];
}
@endphp
@if($qrUrl)
{{-- FITUR KOPI UNTUK SIMULATOR (Khusus Sandbox) --}}
@if(!config('midtrans.is_production') && isset($paymentInfo['qr_string']))
Raw QR String (Untuk Simulator)
{{ $paymentInfo['qr_string'] }}
@endif
@else
Gagal memuat Kode QR. Pastikan metode QRIS sudah aktif di Dashboard Midtrans Anda.
@endif
@else
@if(data_get($paymentInfo, 'payment_type') === 'cash')
Bayar Tunai di Lokasi
Silakan datang ke alamat kami untuk melakukan pembayaran.
Lokasi
{{ data_get($paymentInfo, 'address') }}
Unit
{{ $rental->units->pluck('seri')->join(', ') }}
Kode Booking
{{ $rental->booking_code }}
Durasi Sewa
{{ $rental->waktu_mulai->diffInDays($rental->waktu_selesai) }} Hari
Subtotal
{{ number_format($rental->subtotal_harga, 0, ',', '.') }}
@if($rental->potongan_diskon > 0)
Diskon
-{{ number_format($rental->potongan_diskon, 0, ',', '.') }}
@endif
@if($rental->kode_unik_pembayaran > 0)
Kode Unik
+{{ number_format($rental->kode_unik_pembayaran, 0, ',', '.') }}
@endif
Total Tunai
Rp {{ number_format($rental->grand_total, 0, ',', '.') }}
@php
$unitNames = $rental->units->pluck('seri')->join(', ');
$startTime = $rental->waktu_mulai->format('d M Y, H:i');
$endTime = $rental->waktu_selesai ? $rental->waktu_selesai->format('d M Y, H:i') : '-';
$waMessage = "Halo Admin, saya baru saja melakukan pemesanan di RENT SPACE. Berikut rinciannya:\n\n"
. "Kode Booking: " . $rental->booking_code . "\n"
. "Nama: " . $rental->nama . "\n"
. "Unit: " . $unitNames . "\n"
. "Waktu Sewa: " . $startTime . " s/d " . $endTime . "\n"
. "Total Bayar: Rp " . number_format($rental->grand_total, 0, ',', '.') . "\n"
. "Ref: " . ($rental->affiliate_code ?: '-') . "\n\n"
. "Link Detail: " . route('public.payment', $rental->booking_code) . "\n\n"
. "Mohon bantuannya untuk diproses. Terima kasih!";
$waUrl = "https://wa.me/" . \App\Models\Setting::getVal('admin_wa') . "?text=" . urlencode($waMessage);
@endphp
Konfirmasi WhatsApp
@else
{{ $selectedChannel }}
Nomor Virtual Account
@php
$details = $rental->payment_details;
@endphp
@if($va = data_get($details, 'va_numbers.0.va_number'))
{{ $va }}
@elseif($bk = data_get($details, 'bill_key'))
{{ $bk }}
@elseif($pva = data_get($details, 'permata_va_number'))
{{ $pva }}
@else
-
@endif
@endif
@if($selectedChannel === 'mandiri')
Biller Code
{{ data_get($paymentInfo, 'biller_code', '-') }}
@endif
@endif
© {{ date('Y') }} Rent Space • Transaksi Terenkripsi SSL