# 🚀 Quick Reference - Advanced Features

## WhatsApp Commands (New)

```
TOPUP 100000          → Request topup saldo
LAPORAN TODAY         → Sales report hari ini
LAPORAN WEEK          → Sales report minggu ini
LAPORAN MONTH         → Sales report bulan ini
BROADCAST <message>   → Kirim pesan ke semua customer
```

## PHP Usage

### WhatsApp Notifications
```php
$notif = new WhatsAppNotification();
$notif->notifyLowBalance($agentId, $balance, $threshold);
$notif->notifyTopupRequest($agentId, $amount);
$notif->sendSalesReport($agentId, 'today');
$notif->broadcastToCustomers($agentId, $message);
```

### QR Code
```php
$qr = new QRCodeGenerator();
$qrUrl = $qr->generateVoucherQR($username, $password);
$dataUrl = $qr->generateQRDataURL($username, $password);
```

### Payment Gateway
```php
$payment = new PaymentGateway('midtrans');
$result = $payment->createTopupPayment($agentId, $amount);
$payment->handleCallback($data);
```

## Features Checklist

- ✅ WhatsApp Notifications
- ✅ Topup Request via WA
- ✅ Sales Report via WA
- ✅ Broadcast Message
- ✅ QR Code in Modal
- ✅ QR Code in Print
- ✅ Payment Gateway (Skeleton)

## Files

**New:**
- `lib/WhatsAppNotification.class.php`
- `lib/QRCodeGenerator.class.php`
- `lib/PaymentGateway.class.php`
- `database/payment_gateway_tables.sql`

**Modified:**
- `api/whatsapp_agent_webhook.php`
- `agent/dashboard.php`
- `agent/agent.css`

## Quick Test

```bash
# Test WhatsApp
Kirim: TOPUP 100000
Kirim: LAPORAN TODAY
Kirim: BROADCAST Test

# Test QR Code
Generate voucher → Check modal → Print

# Test Payment (need config)
Configure API keys → Create payment → Test callback
```

---

**Ready to use!** 🎉
