add more card support, include credit cards in accounts
All checks were successful
Auto Tag on Version Change / check-version (push) Successful in 4s

This commit is contained in:
2026-05-23 21:21:01 +05:00
parent e9f0cec698
commit 219ca9bf00
3 changed files with 7 additions and 4 deletions

View File

@@ -171,10 +171,11 @@ class BmlAccountClient {
val cardBalance = item.optJSONObject("cardBalance")
val available = cardBalance?.optDouble("AvailableLimit", 0.0) ?: 0.0
val current = cardBalance?.optDouble("CurrentBalance", 0.0) ?: 0.0
val isVisible = item.optBoolean("account_visible", false)
val cardProfileType = when {
isPrepaid -> "BML_PREPAID"
product.contains("CREDIT", ignoreCase = true) -> "BML_CREDIT"
else -> "BML_DEBIT"
isVisible -> "BML_CREDIT" // non-prepaid, visible = credit card
else -> "BML_DEBIT" // non-prepaid, not visible = debit card
}
prepaidCards.add(BankAccount(
bank = "BML",

View File

@@ -14,6 +14,7 @@ object BmlCardParser {
fun productCodeToAsset(productCode: String): String = when (productCode) {
"C8201" -> "cards/bml/master_prepaid.png"
"C8205" -> "cards/bml/master_prepaid_travel.png"
"C8005" -> "cards/bml/master_prepaid_travel.png"
"C3007" -> "cards/bml/amex_debit_green.png"
"C1007" -> "cards/bml/visa_debit.png"
"C1003" -> "cards/bml/visa_gold.png"

View File

@@ -11,8 +11,9 @@ object BmlDashboardParser {
* Handles both BML CASA accounts and BML prepaid/credit cards.
*/
fun displayData(account: BankAccount): AccountListDisplay? {
if (account.profileType == "BML_LOAN") return null // Loans shown on financing page only
val isCard = account.profileType == "BML_PREPAID" || account.profileType == "BML_CREDIT" || account.profileType == "BML_DEBIT"
if (account.profileType == "BML_LOAN") return null // Loans shown on financing page only
if (account.profileType == "BML_DEBIT") return null // Debit cards shown on card screens only
val isCard = account.profileType == "BML_PREPAID" || account.profileType == "BML_CREDIT"
return if (isCard) {
val isActive = account.statusDesc.equals("Active", ignoreCase = true)
AccountListDisplay(