forked from thijooree/android
140 lines
3.4 KiB
Markdown
140 lines
3.4 KiB
Markdown
# Cards
|
|
|
|
Fetch debit card information for the authenticated session.
|
|
|
|
---
|
|
|
|
## Endpoint
|
|
|
|
```
|
|
POST https://faisamobilex-wv-v2.mib.com.mv/ajaxDebitCard/fetchCardInfos
|
|
```
|
|
|
|
---
|
|
|
|
## Authentication
|
|
|
|
See [README](README.md) for cookie and AJAX header format.
|
|
|
|
```
|
|
Referer: https://faisamobilex-wv-v2.mib.com.mv/debitCards
|
|
```
|
|
|
|
---
|
|
|
|
## Request Body (form-urlencoded)
|
|
|
|
| Field | Value | Description |
|
|
|---|---|---|
|
|
| `name` | `` | Card name filter (empty = all) |
|
|
| `start` | `1` | Start index (1-based) |
|
|
| `end` | `50` | End index |
|
|
| `includeCount` | `1` | Include total count |
|
|
|
|
---
|
|
|
|
## Response
|
|
|
|
```json
|
|
{
|
|
"success": true,
|
|
"responseCode": "1",
|
|
"reasonCode": "101",
|
|
"reasonText": "Single Debit card fetch success!",
|
|
"total_count": "1",
|
|
"pos": "1",
|
|
"data": [
|
|
{
|
|
"cardId": "100000000001",
|
|
"maskedCardNumber": "4023XXXXXXXX1234",
|
|
"cardStatus": "CHST0",
|
|
"cardType": "70",
|
|
"contractId": "552",
|
|
"cardTypeDesc": "VISA EMV Corporate",
|
|
"customerId": "40000001",
|
|
"phoneNumber": "009609600001",
|
|
"cardHolderName": "MOHAMED ALI"
|
|
}
|
|
]
|
|
}
|
|
```
|
|
|
|
| Field | Type | Description |
|
|
|---|---|---|
|
|
| `success` | `bool` | `true` on success |
|
|
| `data` | `array` | List of card objects |
|
|
|
|
### Card Object
|
|
|
|
| Field | Type | Description |
|
|
|---|---|---|
|
|
| `cardId` | `string` | Internal card identifier |
|
|
| `maskedCardNumber` | `string` | Partially masked card number for display |
|
|
| `cardStatus` | `string` | Card status code (`CHST0` = valid, `CHST20` = temporarily blocked by client) |
|
|
| `cardType` | `string` | Numeric card type code (e.g. `"70"`) |
|
|
| `contractId` | `string` | Card contract ID (not consumed) |
|
|
| `cardTypeDesc` | `string` | Human-readable card type (e.g. `"VISA EMV Corporate"`) |
|
|
| `customerId` | `string` | Customer ID |
|
|
| `phoneNumber` | `string` | Registered phone number |
|
|
| `cardHolderName` | `string` | Name on card |
|
|
|
|
> The app's `MibCard` model adds two **app-internal** fields not present on the server payload: `loginTag` (e.g. `"mib_<username>"`) and `profileId` (the active profile that fetched the card). They are populated by the client (`MibCardsClient.kt:66-67`) and used by the UI to map a card back to its owning login.
|
|
|
|
### Failure
|
|
|
|
```json
|
|
{ "success": false }
|
|
```
|
|
|
|
---
|
|
|
|
## Freeze / Unfreeze Card
|
|
|
|
```
|
|
POST https://faisamobilex-wv-v2.mib.com.mv/ajaxDebitCard/freeze
|
|
POST https://faisamobilex-wv-v2.mib.com.mv/ajaxDebitCard/unfreeze
|
|
```
|
|
|
|
Two endpoints — same shape. Pick by intent. Source: `MibCardsClient.kt:74-103`.
|
|
|
|
```
|
|
Referer: https://faisamobilex-wv-v2.mib.com.mv/debitCards/manage?cardId=<cardId>
|
|
```
|
|
|
|
### Request Body (form-urlencoded)
|
|
|
|
| Field | Description |
|
|
|---|---|
|
|
| `cardId` | Card identifier from `fetchCardInfos` |
|
|
| `comments` | User-supplied reason (free text; may be empty) |
|
|
|
|
### Response
|
|
|
|
```json
|
|
{
|
|
"success": true,
|
|
"responseCode": "1",
|
|
"reasonCode": "502",
|
|
"reasonText": "Card Frozen",
|
|
"currentStatus": "TEMPRORY BLOCKED BY CLIENT",
|
|
"currentStatusCode": "CHST20"
|
|
}
|
|
```
|
|
|
|
Unfreeze returns `reasonText: "Card Activated"`, `currentStatus: "VALID CARD"`, `currentStatusCode: "CHST0"`.
|
|
|
|
| Field | Description |
|
|
|---|---|
|
|
| `success` | `true` on success |
|
|
| `reasonText` | Human-readable message (also returned on failure — show to user) |
|
|
| `currentStatus` | Human-readable status after the action |
|
|
| `currentStatusCode` | New card status code (`"CHST20"` = frozen, `"CHST0"` = active) |
|
|
|
|
---
|
|
|
|
|
|
|
|
---
|
|
|
|
[← Transaction History](04-history.md) **Next →** [Financing](06-financing.md)
|