Initial commit: API Wipay dengan fix CORS untuk GET request
This commit is contained in:
250
EXTERNAL_API_PAYLOAD_VERIFICATION.md
Normal file
250
EXTERNAL_API_PAYLOAD_VERIFICATION.md
Normal file
@@ -0,0 +1,250 @@
|
||||
# Verifikasi Payload External API Calls
|
||||
|
||||
Dokumen ini memverifikasi semua external API calls dan memastikan payload sesuai dengan API lama.
|
||||
|
||||
## 1. TIMO API (timo.tirtaintan.co.id)
|
||||
|
||||
### ✅ GET /enquiry/{no_sl}
|
||||
- **URL**: `https://timo.tirtaintan.co.id/enquiry/{no_sl}`
|
||||
- **Method**: GET
|
||||
- **Auth**: Tidak ada
|
||||
- **Payload**: Tidak ada (GET request)
|
||||
- **Status**: ✅ Sudah sesuai
|
||||
- **Lokasi**: `TagihanController::tagihan()`, `PembayaranController::requestPembayaran()`, `FastController::checkBill()`
|
||||
|
||||
### ✅ GET /enquiry-dil/{no_sl}
|
||||
- **URL**: `https://timo.tirtaintan.co.id/enquiry-dil/{no_sl}`
|
||||
- **Method**: GET
|
||||
- **Auth**: Tidak ada
|
||||
- **Payload**: Tidak ada (GET request)
|
||||
- **Status**: ✅ Sudah sesuai
|
||||
- **Lokasi**: `SLController::cekSL()`, `SLController::confirmSL()`
|
||||
|
||||
### ✅ GET /enquiry-his/{sl}/{periode}
|
||||
- **URL**: `https://timo.tirtaintan.co.id/enquiry-his/{sl}/{periode}`
|
||||
- **Method**: GET
|
||||
- **Auth**: Tidak ada
|
||||
- **Payload**: Tidak ada (GET request)
|
||||
- **Status**: ✅ Sudah sesuai
|
||||
- **Lokasi**: `TagihanController::history()`
|
||||
|
||||
### ✅ POST /payment/{token}
|
||||
- **URL**: `https://timo.tirtaintan.co.id/payment/{token}`
|
||||
- **Method**: POST
|
||||
- **Auth**: Tidak ada
|
||||
- **Payload**:
|
||||
```json
|
||||
{
|
||||
"token": "token_value",
|
||||
"data": [
|
||||
{
|
||||
"rek_nomor": "...",
|
||||
"rek_total": 0,
|
||||
"serial": "#TM{timestamp}",
|
||||
"byr_tgl": "YmdHis",
|
||||
"loket": "TIMO"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
- **Headers**:
|
||||
- `Content-Type: application/json`
|
||||
- `Accept-Encoding: gzip, deflate`
|
||||
- `Cache-Control: max-age=0`
|
||||
- `Connection: keep-alive`
|
||||
- `Accept-Language: en-US,en;q=0.8,id;q=0.6`
|
||||
- **Timeout**: 15 detik (connection & request)
|
||||
- **Status**: ✅ Sudah sesuai
|
||||
- **Lokasi**: `SiteController::approve()`
|
||||
|
||||
### ✅ POST /push-registrasi
|
||||
- **URL**: `https://timo.tirtaintan.co.id/push-registrasi`
|
||||
- **Method**: POST
|
||||
- **Auth**: Tidak ada
|
||||
- **Payload**:
|
||||
```json
|
||||
{
|
||||
"data": {
|
||||
"reg_id": "0",
|
||||
"reg_unit": "00",
|
||||
"reg_name": "...",
|
||||
"reg_address": "...",
|
||||
"reg_phone": "...",
|
||||
"reg_email": "...",
|
||||
"reg_identity": "...",
|
||||
"reg_tgl": "Y-m-d H:i:s"
|
||||
}
|
||||
}
|
||||
```
|
||||
- **Headers**:
|
||||
- `Content-Type: application/json`
|
||||
- `Accept-Encoding: gzip, deflate`
|
||||
- `Cache-Control: max-age=0`
|
||||
- `Connection: keep-alive`
|
||||
- `Accept-Language: en-US,en;q=0.8,id;q=0.6`
|
||||
- **Timeout**: 15 detik (connection & request)
|
||||
- **Status**: ✅ Sudah sesuai
|
||||
- **Lokasi**: `UploadController::uploadPasangBaru()`
|
||||
|
||||
### ✅ POST /pengaduan/{no_sl}
|
||||
- **URL**: `https://timo.tirtaintan.co.id/pengaduan/{no_sl}`
|
||||
- **Method**: POST
|
||||
- **Auth**: Tidak ada
|
||||
- **Payload**:
|
||||
```json
|
||||
{
|
||||
"id": id_gangguan,
|
||||
"nama": "...",
|
||||
"alamat": "...",
|
||||
"telepon": "628...",
|
||||
"jenis": "1-7",
|
||||
"judul": "Laporan Gangguan - ...",
|
||||
"uraian": "..."
|
||||
}
|
||||
```
|
||||
- **Headers**:
|
||||
- `Content-Type: application/json`
|
||||
- `Accept: application/json`
|
||||
- `User-Agent: TIMO-External-API/1.0`
|
||||
- **Timeout**: 60 detik (request), 30 detik (connection)
|
||||
- **Status**: ✅ Sudah sesuai
|
||||
- **Lokasi**: `UploadController::sendGangguanToExternalAPI()`
|
||||
|
||||
## 2. Rasamala API (rasamala.tirtaintan.co.id)
|
||||
|
||||
### ✅ POST /timo/upload-catat-meter/{no_sl}
|
||||
- **URL**: `https://rasamala.tirtaintan.co.id/timo/upload-catat-meter/{no_sl}`
|
||||
- **Method**: POST
|
||||
- **Auth**: Tidak ada
|
||||
- **Payload**:
|
||||
```json
|
||||
{
|
||||
"token": "...",
|
||||
"no_sl": "...",
|
||||
"nama_pelanggan": "...",
|
||||
"alamat": "...",
|
||||
"angka_meter": "...",
|
||||
"photo": "filename.jpg",
|
||||
"uploaded_at": "Y-m-d H:i:s"
|
||||
}
|
||||
```
|
||||
- **Headers**:
|
||||
- `Content-Type: application/json`
|
||||
- `Accept: application/json`
|
||||
- `User-Agent: TIMO-External-API/1.0`
|
||||
- **Timeout**: 60 detik (request), 30 detik (connection)
|
||||
- **Status**: ✅ Sudah sesuai
|
||||
- **Lokasi**: `UploadController::sendCatatMeterToExternalAPI()`
|
||||
|
||||
### ✅ POST /timo/order-cater/{no_sl}
|
||||
- **URL**: `https://rasamala.tirtaintan.co.id/timo/order-cater/{no_sl}`
|
||||
- **Method**: POST
|
||||
- **Auth**: Tidak ada
|
||||
- **Payload**: `kar_id=timo` (form-urlencoded)
|
||||
- **Headers**:
|
||||
- `Content-Type: application/x-www-form-urlencoded`
|
||||
- `Accept: application/json`
|
||||
- **Timeout**: 30 detik (request), 10 detik (connection)
|
||||
- **Status**: ✅ Sudah sesuai
|
||||
- **Lokasi**: `OtherController::requestOrderBacaMandiri()`
|
||||
|
||||
### ✅ POST /timo/upload-cater/{wrute_id}
|
||||
- **URL**: `https://rasamala.tirtaintan.co.id/timo/upload-cater/{wrute_id}`
|
||||
- **Method**: POST
|
||||
- **Auth**: Tidak ada
|
||||
- **Payload**: `wmmr_id=...&wmmr_standbaca=...&wmmr_abnormwm=...&wmmr_abnormenv=...&wmmr_note=...&lonkor=...&latkor=...` (form-urlencoded)
|
||||
- **Headers**:
|
||||
- `Content-Type: application/x-www-form-urlencoded`
|
||||
- `Accept: application/json`
|
||||
- **Timeout**: 30 detik (request), 10 detik (connection)
|
||||
- **Status**: ✅ Sudah sesuai
|
||||
- **Lokasi**: `UploadController::uploadBacaMandiri()`
|
||||
|
||||
## 3. BRI API (partner.api.bri.co.id)
|
||||
|
||||
### ✅ POST /oauth/client_credential/accesstoken?grant_type=client_credentials
|
||||
- **URL**: `https://partner.api.bri.co.id/oauth/client_credential/accesstoken?grant_type=client_credentials`
|
||||
- **Method**: POST
|
||||
- **Auth**: `client_id` dan `client_secret` (form-urlencoded)
|
||||
- **Payload**: `client_id={BRI_KEY}&client_secret={BRI_SECRET}`
|
||||
- **Headers**:
|
||||
- `Content-Type: application/x-www-form-urlencoded`
|
||||
- **Timeout**: 0 (no timeout)
|
||||
- **Status**: ✅ Sudah sesuai
|
||||
- **Lokasi**: `SiteController::getBriToken()`
|
||||
|
||||
### ✅ POST /v2.0/statement
|
||||
- **URL**: `https://partner.api.bri.co.id/v2.0/statement`
|
||||
- **Method**: POST
|
||||
- **Auth**: Bearer token
|
||||
- **Payload**: `{"accountNumber":"...", "startDate":"Y-m-d", "endDate":"Y-m-d"}` (string JSON langsung)
|
||||
- **Headers**:
|
||||
- `BRI-Timestamp: Y-m-d\TH:i:s.000\Z`
|
||||
- `BRI-Signature: {signature}`
|
||||
- `Content-Type: application/json`
|
||||
- `BRI-External-Id: 1234`
|
||||
- `Authorization: Bearer {token}`
|
||||
- **Timeout**: 0 (no timeout)
|
||||
- **Status**: ✅ Sudah sesuai
|
||||
- **Lokasi**: `SiteController::getMutasi()`
|
||||
|
||||
## 4. WhatsApp API (app.whappi.biz.id)
|
||||
|
||||
### ✅ POST /api/qr/rest/send_message
|
||||
- **URL**: `https://app.whappi.biz.id/api/qr/rest/send_message`
|
||||
- **Method**: POST
|
||||
- **Auth**: JWT Token (Bearer)
|
||||
- **Payload**:
|
||||
```json
|
||||
{
|
||||
"messageType": "text",
|
||||
"requestType": "POST",
|
||||
"token": "JWT_TOKEN",
|
||||
"from": "6282317383737",
|
||||
"to": "628...",
|
||||
"text": "pesan"
|
||||
}
|
||||
```
|
||||
- **Headers**:
|
||||
- `Content-Type: application/json`
|
||||
- `Authorization: Bearer {JWT_TOKEN}`
|
||||
- **Timeout**: 60 detik (request), 30 detik (connection)
|
||||
- **Retry**: 3 kali
|
||||
- **Status**: ✅ Sudah sesuai
|
||||
- **Lokasi**: `WhatsAppHelper::sendWa()`
|
||||
|
||||
## 5. Telegram API (api.telegram.org)
|
||||
|
||||
### ✅ POST /bot{token}/sendMessage
|
||||
- **URL**: `https://api.telegram.org/bot{token}/sendMessage`
|
||||
- **Method**: POST
|
||||
- **Auth**: Bot token di URL
|
||||
- **Payload**: `chat_id=...&text=...&parse_mode=Markdown` (form-urlencoded)
|
||||
- **Headers**: Tidak ada khusus
|
||||
- **Timeout**: 30 detik (request), 10 detik (connection)
|
||||
- **Status**: ✅ Sudah sesuai
|
||||
- **Lokasi**: `TelegramHelper::sendTelegram()`
|
||||
|
||||
## 6. OpenStreetMap Nominatim API
|
||||
|
||||
### ✅ GET /search
|
||||
- **URL**: `https://nominatim.openstreetmap.org/search?format=json&q={address}&limit=1`
|
||||
- **Method**: GET
|
||||
- **Auth**: Tidak ada
|
||||
- **Headers**:
|
||||
- `Accept: application/json`
|
||||
- `User-Agent: TIMO-APP/1.0`
|
||||
- **Timeout**: 10 detik
|
||||
- **Status**: ✅ Sudah sesuai
|
||||
- **Lokasi**: `GeocodingHelper::getCoordinatesFromAddress()`
|
||||
|
||||
## Summary
|
||||
|
||||
✅ **Semua external API calls sudah sesuai dengan API lama:**
|
||||
- Payload format sama
|
||||
- Headers sama
|
||||
- Timeout settings sama
|
||||
- Authentication method sama
|
||||
- URL endpoints sama
|
||||
|
||||
**Tidak ada yang terlewat!**
|
||||
Reference in New Issue
Block a user