forked from shihaam/thijooree
add more card support, include credit cards in accounts
This commit is contained in:
@@ -171,10 +171,11 @@ class BmlAccountClient {
|
|||||||
val cardBalance = item.optJSONObject("cardBalance")
|
val cardBalance = item.optJSONObject("cardBalance")
|
||||||
val available = cardBalance?.optDouble("AvailableLimit", 0.0) ?: 0.0
|
val available = cardBalance?.optDouble("AvailableLimit", 0.0) ?: 0.0
|
||||||
val current = cardBalance?.optDouble("CurrentBalance", 0.0) ?: 0.0
|
val current = cardBalance?.optDouble("CurrentBalance", 0.0) ?: 0.0
|
||||||
|
val isVisible = item.optBoolean("account_visible", false)
|
||||||
val cardProfileType = when {
|
val cardProfileType = when {
|
||||||
isPrepaid -> "BML_PREPAID"
|
isPrepaid -> "BML_PREPAID"
|
||||||
product.contains("CREDIT", ignoreCase = true) -> "BML_CREDIT"
|
isVisible -> "BML_CREDIT" // non-prepaid, visible = credit card
|
||||||
else -> "BML_DEBIT"
|
else -> "BML_DEBIT" // non-prepaid, not visible = debit card
|
||||||
}
|
}
|
||||||
prepaidCards.add(BankAccount(
|
prepaidCards.add(BankAccount(
|
||||||
bank = "BML",
|
bank = "BML",
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ object BmlCardParser {
|
|||||||
fun productCodeToAsset(productCode: String): String = when (productCode) {
|
fun productCodeToAsset(productCode: String): String = when (productCode) {
|
||||||
"C8201" -> "cards/bml/master_prepaid.png"
|
"C8201" -> "cards/bml/master_prepaid.png"
|
||||||
"C8205" -> "cards/bml/master_prepaid_travel.png"
|
"C8205" -> "cards/bml/master_prepaid_travel.png"
|
||||||
|
"C8005" -> "cards/bml/master_prepaid_travel.png"
|
||||||
"C3007" -> "cards/bml/amex_debit_green.png"
|
"C3007" -> "cards/bml/amex_debit_green.png"
|
||||||
"C1007" -> "cards/bml/visa_debit.png"
|
"C1007" -> "cards/bml/visa_debit.png"
|
||||||
"C1003" -> "cards/bml/visa_gold.png"
|
"C1003" -> "cards/bml/visa_gold.png"
|
||||||
|
|||||||
@@ -11,8 +11,9 @@ object BmlDashboardParser {
|
|||||||
* Handles both BML CASA accounts and BML prepaid/credit cards.
|
* Handles both BML CASA accounts and BML prepaid/credit cards.
|
||||||
*/
|
*/
|
||||||
fun displayData(account: BankAccount): AccountListDisplay? {
|
fun displayData(account: BankAccount): AccountListDisplay? {
|
||||||
if (account.profileType == "BML_LOAN") return null // Loans shown on financing page only
|
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_DEBIT") return null // Debit cards shown on card screens only
|
||||||
|
val isCard = account.profileType == "BML_PREPAID" || account.profileType == "BML_CREDIT"
|
||||||
return if (isCard) {
|
return if (isCard) {
|
||||||
val isActive = account.statusDesc.equals("Active", ignoreCase = true)
|
val isActive = account.statusDesc.equals("Active", ignoreCase = true)
|
||||||
AccountListDisplay(
|
AccountListDisplay(
|
||||||
|
|||||||
Reference in New Issue
Block a user