Initial commit: API Wipay dengan fix CORS untuk GET request
This commit is contained in:
148
BUSINESS_LOGIC_COMPARISON.md
Normal file
148
BUSINESS_LOGIC_COMPARISON.md
Normal file
@@ -0,0 +1,148 @@
|
||||
# Perbandingan Business Logic: timo.wipay.id vs timo.wipay.id_api
|
||||
|
||||
## ✅ Status: Sudah Sesuai
|
||||
|
||||
### 1. Flow Pembayaran BRI ✅
|
||||
|
||||
**Backend Lama (timo.wipay.id):**
|
||||
|
||||
1. User request pembayaran → status `DIBUAT`
|
||||
2. User upload bukti transfer → status `MENUNGGU VERIFIKASI`
|
||||
3. Admin/System cek via `/site/verify_bri` → cek mutasi BRI
|
||||
4. Jika cocok → auto approve → status `DIBAYAR`
|
||||
5. Kirim WhatsApp ke user ✅
|
||||
|
||||
**Backend Baru (timo.wipay.id_api):**
|
||||
|
||||
1. User request pembayaran → status `DIBUAT` ✅
|
||||
2. User upload bukti transfer → status `MENUNGGU VERIFIKASI` ✅
|
||||
3. Admin/System cek via `/site/verify_bri` → cek mutasi BRI ✅
|
||||
4. Jika cocok → auto approve → status `DIBAYAR` ✅
|
||||
5. Kirim WhatsApp ke user ✅ (sudah ditambahkan)
|
||||
|
||||
### 2. Flow Pembayaran QRIS ✅
|
||||
|
||||
**Backend Baru (timo.wipay.id_api):**
|
||||
|
||||
1. User request pembayaran QRIS (< 70rb) → generate QR code ✅
|
||||
2. User scan QR code → bayar via e-wallet ✅
|
||||
3. User click "Cek Status" → check status QRIS API ✅
|
||||
4. Jika paid → auto approve → status `DIBAYAR` ✅
|
||||
5. Kirim WhatsApp ke user ✅
|
||||
|
||||
**Note:** QRIS adalah fitur baru, tidak ada di backend lama.
|
||||
|
||||
### 3. Notifikasi Telegram ✅
|
||||
|
||||
**Backend Lama:**
|
||||
|
||||
- Kirim Telegram ke admin saat ada transaksi baru (BRI)
|
||||
|
||||
**Backend Baru:**
|
||||
|
||||
- ✅ Kirim Telegram ke admin saat user upload bukti transfer (BRI)
|
||||
- ✅ Kirim Telegram ke admin gangguan saat ada laporan gangguan
|
||||
|
||||
### 4. Notifikasi WhatsApp ✅
|
||||
|
||||
**Backend Lama:**
|
||||
|
||||
- Kirim WhatsApp ke user setelah pembayaran BRI berhasil
|
||||
- Format: "_PEMBAYARAN BERHASIL_" dengan detail transaksi
|
||||
|
||||
**Backend Baru:**
|
||||
|
||||
- ✅ Kirim WhatsApp ke user setelah pembayaran BRI berhasil (via `SiteController::approve()`)
|
||||
- ✅ Kirim WhatsApp ke user setelah pembayaran QRIS berhasil (via `PembayaranController::autoApproveQris()`)
|
||||
- ✅ Format sama dengan backend lama
|
||||
|
||||
### 5. Auto Approve Flow ✅
|
||||
|
||||
**BRI:**
|
||||
|
||||
- ✅ Cek mutasi BRI → jika cocok → approve → kirim WhatsApp
|
||||
|
||||
**QRIS:**
|
||||
|
||||
- ✅ Cek status QRIS → jika paid → approve → kirim WhatsApp
|
||||
|
||||
### 6. Kode Unik ✅
|
||||
|
||||
**Backend Lama:**
|
||||
|
||||
- BRI/Manual: pakai kode unik
|
||||
- WIPAY: tidak pakai kode unik
|
||||
|
||||
**Backend Baru:**
|
||||
|
||||
- ✅ BRI/Manual: pakai kode unik (via `KodeHelper::generateKodeUnikPrioritas()`)
|
||||
- ✅ QRIS: tidak pakai kode unik
|
||||
- ✅ WIPAY: tidak pakai kode unik
|
||||
|
||||
### 7. Status Pembayaran ✅
|
||||
|
||||
**Backend Lama:**
|
||||
|
||||
- `DIBUAT` → `MENUNGGU VERIFIKASI` → `DIBAYAR`
|
||||
- `DIBUAT` → `DIBATALKAN` / `EXPIRED`
|
||||
|
||||
**Backend Baru:**
|
||||
|
||||
- ✅ `DIBUAT` → `MENUNGGU VERIFIKASI` → `DIBAYAR` (BRI/Manual)
|
||||
- ✅ `DIBUAT` → `DIBAYAR` (QRIS - auto approve)
|
||||
- ✅ `DIBUAT` → `DIBATALKAN` / `EXPIRED`
|
||||
|
||||
### 8. Expired Policy ✅
|
||||
|
||||
**Backend Lama:**
|
||||
|
||||
- Pembayaran expired setelah 1 hari
|
||||
|
||||
**Backend Baru:**
|
||||
|
||||
- ✅ Pembayaran BRI/Manual: expired setelah 1 hari
|
||||
- ✅ Pembayaran QRIS: expired setelah 30 menit
|
||||
|
||||
### 9. Validasi Pembayaran ✅
|
||||
|
||||
**Backend Lama:**
|
||||
|
||||
- Satu SL hanya boleh punya 1 pembayaran aktif (`DIBUAT`)
|
||||
|
||||
**Backend Baru:**
|
||||
|
||||
- ✅ Satu SL hanya boleh punya 1 pembayaran aktif (`DIBUAT`)
|
||||
- ✅ Cek pembayaran expired sebelum buat baru
|
||||
|
||||
### 10. Payment to PDAM ✅
|
||||
|
||||
**Backend Lama:**
|
||||
|
||||
- Format: `{token, data: [{rek_nomor, rek_total, serial, byr_tgl, loket}]}`
|
||||
- Headers: Content-Type, Accept-Encoding, Cache-Control, Connection, Accept-Language
|
||||
|
||||
**Backend Baru:**
|
||||
|
||||
- ✅ Format sama dengan backend lama
|
||||
- ✅ Headers sama dengan backend lama
|
||||
- ✅ URL: `https://timo.tirtaintan.co.id/payment/{token}`
|
||||
|
||||
## 📋 Summary
|
||||
|
||||
**Semua business logic sudah sesuai dengan backend lama (timo.wipay.id):**
|
||||
|
||||
1. ✅ Flow pembayaran BRI (auto verify + WhatsApp)
|
||||
2. ✅ Flow pembayaran QRIS (auto approve + WhatsApp)
|
||||
3. ✅ Notifikasi Telegram ke admin
|
||||
4. ✅ Notifikasi WhatsApp ke user
|
||||
5. ✅ Kode unik untuk BRI/Manual
|
||||
6. ✅ Status pembayaran
|
||||
7. ✅ Expired policy
|
||||
8. ✅ Validasi pembayaran
|
||||
9. ✅ Payment to PDAM format
|
||||
|
||||
**Fitur Baru (tidak ada di backend lama):**
|
||||
|
||||
- ✅ QRIS payment method (< 70rb)
|
||||
- ✅ QRIS status check dengan retry mechanism
|
||||
- ✅ QRIS expired 30 menit
|
||||
Reference in New Issue
Block a user