94 lines
2.5 KiB
Markdown
94 lines
2.5 KiB
Markdown
### Maldives Islamic Bank Payment Verification API
|
|
|
|
|
|
This api will allow you to fetch customers payment and your MIB account history, it will match with transaction time, account owner name and amount. \
|
|
but slight issue is that, MIB to MIB transaction sometimes have MIBs made-up name for the account owner name, This is challenging, so work around that, I added option to send customers account number to fetch the made-up name and match with it. \
|
|
(BML) Farava transations works perfectly with just the name!
|
|
|
|
## How to deploy/get started (with docker/podman)
|
|
|
|
1. Login to MIB web (https://faisanet.mib.com.mv/)[https://faisanet.mib.com.mv/] and get the cookie:
|
|

|
|
copy this and paste it in .env
|
|
```
|
|
QL_0=
|
|
IBSID=
|
|
```
|
|
2. Create `compose.yml` with the follwing contents:
|
|
```yaml
|
|
services:
|
|
keepalive:
|
|
env_file: .env
|
|
image: git.shihaam.dev/shihaam/mib-payment-verify/keepalive
|
|
api:
|
|
env_file: .env
|
|
image: git.shihaam.dev/shihaam/mib-payment-verify/api
|
|
ports:
|
|
- 5000:5000
|
|
|
|
```
|
|
3. Run `docker compose up -d` and that is all.
|
|
|
|
|
|
## Here are example curl commands to test different scenarios:
|
|
|
|
|
|
1. With both benefName and accountNo:
|
|
```bash
|
|
curl -X POST http://localhost:5000/verify-payment \
|
|
-H "Content-Type: application/json" \
|
|
-d '{
|
|
"benefName": "ABDLA.MAJUDHU AHMED",
|
|
"accountNo": "90103101178641000",
|
|
"absAmount": "100",
|
|
"time": "2024-10-16 16:08"
|
|
}'
|
|
```
|
|
In this request, it will first try to verify with benfName, if it fails, then it will try with accountNo.
|
|
|
|
2. With only benefName:
|
|
```bash
|
|
curl -X POST http://localhost:5000/verify-payment \
|
|
-H "Content-Type: application/json" \
|
|
-d '{
|
|
"benefName": "ABDLA.MAJUDHU AHMED",
|
|
"absAmount": "100",
|
|
"time": "2024-10-16 16:08"
|
|
}'
|
|
```
|
|
3. With only accountNo:
|
|
```bash
|
|
curl -X POST http://localhost:5000/verify-payment \
|
|
-H "Content-Type: application/json" \
|
|
-d '{
|
|
"accountNo": "90103101178641000",
|
|
"absAmount": "100",
|
|
"time": "2024-10-16 16:08"
|
|
}'
|
|
```
|
|
|
|
|
|
Exmaple Succcess responses;
|
|
1. Both benefName and accountNo or only benefName provided
|
|
```json
|
|
{
|
|
"message": "Payment verified using beneficiary name",
|
|
"success": true
|
|
}
|
|
```
|
|
2. Both benefName and accountNo or only accountNo provided, but failed with benefName
|
|
```json
|
|
{
|
|
"message": "Payment verified using account number",
|
|
"success": true
|
|
}
|
|
```
|
|
Example Failed response:
|
|
1.
|
|
```json
|
|
{
|
|
"message": "Transaction not found, contact support",
|
|
"success": false
|
|
}
|
|
```
|