forked from shihaam/thijooree
contacts, contact picker and trnasfer account look up ui
This commit is contained in:
@@ -0,0 +1,123 @@
|
||||
# MIB Account Lookup Routing
|
||||
|
||||
Before initiating a transfer, the recipient input must be resolved to a verified account name and
|
||||
account number. Three different endpoints are used depending on the format of the input.
|
||||
|
||||
## Input Format Routing
|
||||
|
||||
| Input format | Endpoint | Body field |
|
||||
|-------------------------------------------|---------------------------------------|-----------------|
|
||||
| Starts with `7`, exactly 13 digits | `AjaxAlias/getIPSAccount` | `benefAccount` |
|
||||
| Starts with `9`, exactly 17 digits | `ajaxBeneficiary/getAccountName` | `accountNo` |
|
||||
| Starts with `7` or `9`, exactly 7 digits | `AjaxAlias/getAlias` | `aliasName` |
|
||||
| Starts with `A` followed by 6 digits | `AjaxAlias/getAlias` | `aliasName` |
|
||||
| Email address (contains `@`) | `AjaxAlias/getAlias` | `aliasName` |
|
||||
|
||||
All endpoints share the same WebView session auth (see `contacts.md` for cookie format) and use
|
||||
`Referer: https://faisamobilex-wv.mib.com.mv/transfer/quick`.
|
||||
|
||||
---
|
||||
|
||||
## Endpoint Details
|
||||
|
||||
### 1. IPS Account Lookup — Local / BML accounts (13 digits, starts with 7)
|
||||
|
||||
**POST** `https://faisamobilex-wv.mib.com.mv/AjaxAlias/getIPSAccount`
|
||||
|
||||
Body: `benefAccount=7700000000000` (13 digits)
|
||||
|
||||
**Success response:**
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"responseCode": "2",
|
||||
"reasonCode": "201",
|
||||
"reasonText": "Request Successful. Account Found",
|
||||
"accountName": "ACCOUNT HOLDER NAME",
|
||||
"bankBic": "MALBMVMV"
|
||||
}
|
||||
```
|
||||
|
||||
Fields used:
|
||||
- `accountName` — account holder name
|
||||
- `bankBic` — bank SWIFT/BIC code
|
||||
|
||||
The account number is already known from the input; it is not returned in the response.
|
||||
|
||||
---
|
||||
|
||||
### 2. MIB Internal Account Name Lookup — MIB accounts (17 digits, starts with 9)
|
||||
|
||||
**POST** `https://faisamobilex-wv.mib.com.mv/ajaxBeneficiary/getAccountName`
|
||||
|
||||
Body: `accountNo=90100000000000000` (17 digits)
|
||||
|
||||
**Success response** (exact structure to be confirmed):
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"responseCode": "1",
|
||||
"reasonText": "Account found",
|
||||
"accountName": "ACCOUNT HOLDER NAME"
|
||||
}
|
||||
```
|
||||
|
||||
Fields used:
|
||||
- `accountName` — account holder name (check at root level or inside `data` object)
|
||||
|
||||
The account number is already known from the input; bank is always MIB (`MADVMVMV`).
|
||||
|
||||
---
|
||||
|
||||
### 3. Favara Alias Lookup — Shortcodes, A-IDs, emails
|
||||
|
||||
**POST** `https://faisamobilex-wv.mib.com.mv/AjaxAlias/getAlias`
|
||||
|
||||
Body: `aliasName=<alias>`
|
||||
|
||||
Accepted alias formats:
|
||||
- `7` or `9` followed by 6 digits → e.g. `7012345`, `9198026`
|
||||
- `A` followed by 6 digits → e.g. `A123456`
|
||||
- Email address → e.g. `user@example.com`
|
||||
|
||||
**Success response:**
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"responseCode": "2",
|
||||
"reasonCode": "203",
|
||||
"reasonText": " Favara ID found",
|
||||
"data": {
|
||||
"TxId": "BANK00001",
|
||||
"CdtrAcct": {
|
||||
"Acct": "90100000000000000",
|
||||
"FinInstnId": "MADVMVMV"
|
||||
},
|
||||
"BfyNm": "Account Holder Name",
|
||||
"RegDtTm": "2023-01-01T00:00:00"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Fields used from `data`:
|
||||
- `BfyNm` — beneficiary name (trim whitespace)
|
||||
- `CdtrAcct.Acct` — resolved account number to use for the transfer
|
||||
- `CdtrAcct.FinInstnId` — bank institution ID
|
||||
|
||||
---
|
||||
|
||||
## Error Handling
|
||||
|
||||
All three endpoints return `"success": false` on failure with a human-readable `reasonText`:
|
||||
|
||||
```json
|
||||
{
|
||||
"success": false,
|
||||
"responseCode": "0",
|
||||
"reasonText": "Account not found"
|
||||
}
|
||||
```
|
||||
|
||||
- Always show `reasonText` directly to the user as the error message.
|
||||
- For non-200 HTTP responses, also attempt to parse `reasonText` from the body before falling back to a generic error.
|
||||
- If the input does not match any known format, reject it client-side before making any request.
|
||||
@@ -0,0 +1,81 @@
|
||||
# MIB Transfer API
|
||||
|
||||
Transfer endpoints are served from the MIB WebView subdomain, using the same session-cookie auth as
|
||||
financing and contacts.
|
||||
|
||||
## Authentication
|
||||
|
||||
```
|
||||
Cookie: mbmodel=IOS-1.0; xxid=<session_xxid>; IBSID=<session_xxid>; mbnonce=<nonceGenerator>; time-tracker=597
|
||||
```
|
||||
|
||||
All AJAX POST requests also require:
|
||||
|
||||
```
|
||||
X-Requested-With: XMLHttpRequest
|
||||
Origin: https://faisamobilex-wv.mib.com.mv
|
||||
Referer: https://faisamobilex-wv.mib.com.mv/transfer/quick
|
||||
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Endpoints
|
||||
|
||||
### 1. Look Up Recipient by Favara Alias
|
||||
|
||||
Resolves a Favara ID (alias) to the account holder name and account number before initiating a transfer.
|
||||
|
||||
**POST** `https://faisamobilex-wv.mib.com.mv/AjaxAlias/getAlias`
|
||||
|
||||
**Request body (form-urlencoded):**
|
||||
|
||||
| Field | Description |
|
||||
|-------------|------------------------------------------|
|
||||
| `aliasName` | The recipient's Favara ID / alias number |
|
||||
|
||||
**Success response (`responseCode: "2"`):**
|
||||
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"responseCode": "2",
|
||||
"reasonCode": "203",
|
||||
"reasonText": " Favara ID found",
|
||||
"data": {
|
||||
"TxId": "BANK00001",
|
||||
"CreDtTm": "...",
|
||||
"Resp": {
|
||||
"Rslt": true,
|
||||
"RsltDtls": null
|
||||
},
|
||||
"CdtrAcct": {
|
||||
"Acct": "90100000000000000",
|
||||
"FinInstnId": "MADVMVMV"
|
||||
},
|
||||
"BfyNm": "Account Holder Name",
|
||||
"RegDtTm": "2023-01-01T00:00:00"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Not found / error response:**
|
||||
|
||||
```json
|
||||
{
|
||||
"success": false,
|
||||
"responseCode": "0",
|
||||
"reasonCode": "400",
|
||||
"reasonText": "Alias not found"
|
||||
}
|
||||
```
|
||||
|
||||
Key fields from `data`:
|
||||
- `BfyNm` — beneficiary full name (trim whitespace)
|
||||
- `CdtrAcct.Acct` — resolved account number to use for the transfer
|
||||
- `CdtrAcct.FinInstnId` — bank institution ID (e.g. `MADVMVMV`, `MALBMVMV`)
|
||||
|
||||
**Notes:**
|
||||
- Use `success` (not `responseCode`) to determine if the lookup succeeded.
|
||||
- Show `BfyNm` + `CdtrAcct.Acct` to the user as confirmation before proceeding.
|
||||
- The `reasonText` from error responses should be shown directly to the user.
|
||||
Reference in New Issue
Block a user