Initial commit: API Wipay dengan fix CORS untuk GET request
This commit is contained in:
136
EXTERNAL_API_ANALYSIS.md
Normal file
136
EXTERNAL_API_ANALYSIS.md
Normal file
@@ -0,0 +1,136 @@
|
||||
# Analisis External API di timo.wipay.id
|
||||
|
||||
## External API yang Ditemukan
|
||||
|
||||
### 1. Api_fast_wipay.php (`/api_fast_wipay/`)
|
||||
|
||||
**Purpose:** API untuk integrasi Fast WIPAY dengan autentikasi API Key
|
||||
|
||||
**Authentication:**
|
||||
|
||||
- Header: `X-Client-ID` dan `X-Client-Secret`
|
||||
- CORS enabled
|
||||
|
||||
**Endpoints:**
|
||||
|
||||
- `GET /api_fast_wipay/test` - Health check (tidak perlu auth)
|
||||
- `POST /api_fast_wipay/check_bill` - Cek tagihan PDAM
|
||||
- `POST /api_fast_wipay/process_payment` - Proses pembayaran PDAM
|
||||
- `GET /api_fast_wipay/payment_status/{pembayaran_id}` - Cek status pembayaran
|
||||
|
||||
**Features:**
|
||||
|
||||
- API Key validation via `api_keys_model`
|
||||
- API usage logging
|
||||
- CORS support
|
||||
- Error handling
|
||||
|
||||
---
|
||||
|
||||
### 2. Api.php (`/api/`)
|
||||
|
||||
**Purpose:** API sederhana untuk data Mandiri
|
||||
|
||||
**Authentication:** Tidak ada (public)
|
||||
|
||||
**Endpoints:**
|
||||
|
||||
- `GET /api/mandiri/{tanggal}` - Data catat meter Mandiri berdasarkan tanggal
|
||||
- Format tanggal: ddmmyyyy (contoh: 10112024)
|
||||
- Response: `{status: 1, date: "tanggal", data: [...]}`
|
||||
|
||||
**Features:**
|
||||
|
||||
- Simple endpoint tanpa authentication
|
||||
- Format response khusus (status: 1, bukan 200)
|
||||
|
||||
---
|
||||
|
||||
### 3. Fast.php (`/fast/`)
|
||||
|
||||
**Purpose:** API alternatif untuk Fast WIPAY dengan routing khusus
|
||||
|
||||
**Authentication:** API Key (X-Client-ID dan X-Client-Secret)
|
||||
|
||||
**Endpoints:**
|
||||
|
||||
- `GET /fast/test` - Test endpoint
|
||||
- `POST /fast/check_bill` - Cek tagihan
|
||||
- `POST /fast/process_payment` - Proses pembayaran
|
||||
- `GET /fast/process_payment_get` - Proses pembayaran via GET
|
||||
- `GET /fast/payment_status` - Cek status pembayaran
|
||||
- `GET /fast/check_wipay_saldo` - Cek saldo WIPAY
|
||||
- `GET /fast/check_wipay_saldo_get` - Cek saldo WIPAY via GET
|
||||
- `GET /fast/mandiri` - Data Mandiri
|
||||
|
||||
**Features:**
|
||||
|
||||
- Mirip dengan Api_fast_wipay tapi dengan routing berbeda
|
||||
- Support GET dan POST
|
||||
- CORS support
|
||||
|
||||
---
|
||||
|
||||
### 4. Site.php (`/site/`)
|
||||
|
||||
**Purpose:** API untuk verifikasi dan approval (untuk admin)
|
||||
|
||||
**Authentication:** Session-based (Ion Auth)
|
||||
|
||||
**Endpoints:**
|
||||
|
||||
- `POST /site/verify_bri` - Verifikasi pembayaran BRI
|
||||
- `POST /site/approve/{id_trx}` - Approve transaksi
|
||||
|
||||
**Features:**
|
||||
|
||||
- Admin-only endpoints
|
||||
- BRI integration
|
||||
- Payment notification
|
||||
|
||||
---
|
||||
|
||||
## Perbandingan
|
||||
|
||||
| Controller | Base URL | Auth | Purpose | Endpoints |
|
||||
| -------------- | ------------------ | ------- | ---------------------- | ------------ |
|
||||
| Api_fast_wipay | `/api_fast_wipay/` | API Key | Fast WIPAY Integration | 4 endpoints |
|
||||
| Api | `/api/` | None | Data Mandiri | 1 endpoint |
|
||||
| Fast | `/fast/` | API Key | Fast WIPAY Alternative | 9+ endpoints |
|
||||
| Site | `/site/` | Session | Admin Verification | 2 endpoints |
|
||||
|
||||
---
|
||||
|
||||
## Rekomendasi Migrasi
|
||||
|
||||
### Prioritas Tinggi
|
||||
|
||||
1. **Api_fast_wipay** - API utama untuk integrasi Fast WIPAY
|
||||
2. **Api (mandiri)** - Simple endpoint, mudah dimigrasikan
|
||||
|
||||
### Prioritas Sedang
|
||||
|
||||
3. **Fast** - Mirip dengan Api_fast_wipay, bisa digabung atau dipertahankan terpisah
|
||||
|
||||
### Prioritas Rendah
|
||||
|
||||
4. **Site** - Admin endpoints, bisa tetap di CodeIgniter atau dipisah
|
||||
|
||||
---
|
||||
|
||||
## Catatan Penting
|
||||
|
||||
1. **API Key Management:** Perlu model `api_keys_model` untuk validasi
|
||||
2. **CORS:** Semua external API perlu CORS support
|
||||
3. **Response Format:** Api.php menggunakan format khusus (status: 1)
|
||||
4. **Database:** Semua menggunakan database `timo` yang sama
|
||||
5. **External API:** Beberapa endpoint memanggil external API (timo.tirtaintan.co.id)
|
||||
|
||||
---
|
||||
|
||||
## Pertanyaan untuk User
|
||||
|
||||
1. Apakah external API ini masih digunakan?
|
||||
2. Apakah perlu dimigrasikan ke Slim 4?
|
||||
3. Atau tetap di CodeIgniter?
|
||||
4. Apakah ada client yang menggunakan API ini?
|
||||
Reference in New Issue
Block a user