mfaisa recipt (prep) and SmartPay support

This commit is contained in:
2026-06-27 16:18:18 +05:00
parent 51c2dff4b2
commit a90d832dba
15 changed files with 1271 additions and 65 deletions
@@ -43,7 +43,12 @@ object ReceiptStore {
bmlFromName = o.optString("bmlFromName"),
bmlReference = o.optString("bmlReference"),
bmlTimestamp = o.optString("bmlTimestamp"),
bmlMessage = o.optString("bmlMessage")
bmlMessage = o.optString("bmlMessage"),
mfaisaTransactionType = o.optString("mfaisaTransactionType"),
mfaisaFromName = o.optString("mfaisaFromName"),
mfaisaFromMsisdn = o.optString("mfaisaFromMsisdn"),
mfaisaToMsisdn = o.optString("mfaisaToMsisdn"),
mfaisaTimestamp = o.optLong("mfaisaTimestamp", 0L)
),
savedAt = o.optLong("savedAt", 0L)
)
@@ -75,6 +80,11 @@ object ReceiptStore {
put("bmlReference", d.bmlReference)
put("bmlTimestamp", d.bmlTimestamp)
put("bmlMessage", d.bmlMessage)
put("mfaisaTransactionType", d.mfaisaTransactionType)
put("mfaisaFromName", d.mfaisaFromName)
put("mfaisaFromMsisdn", d.mfaisaFromMsisdn)
put("mfaisaToMsisdn", d.mfaisaToMsisdn)
put("mfaisaTimestamp", d.mfaisaTimestamp)
put("savedAt", ts)
})
File(context.filesDir, FILE_NAME).writeText(CacheEncryption.encrypt(arr.toString()))
@@ -10,7 +10,10 @@ data class RecentPick(
val subtitle: String,
val colorHex: String,
val imageHash: String?,
val isProfileImage: Boolean
val isProfileImage: Boolean,
/** Source bank tag for the recent — e.g. "MFAISA". Used by the picker to decide
* per-bank selectability. Null for legacy entries; treated as unspecified. */
val bank: String? = null
)
object RecentsCache {
@@ -34,6 +37,7 @@ object RecentsCache {
put("colorHex", r.colorHex)
if (r.imageHash != null) put("imageHash", r.imageHash)
put("isProfileImage", r.isProfileImage)
if (r.bank != null) put("bank", r.bank)
})
}
context.getSharedPreferences(PREFS, Context.MODE_PRIVATE)
@@ -51,6 +55,7 @@ object RecentsCache {
put("colorHex", r.colorHex)
if (r.imageHash != null) put("imageHash", r.imageHash)
put("isProfileImage", r.isProfileImage)
if (r.bank != null) put("bank", r.bank)
})
}
context.getSharedPreferences(PREFS, Context.MODE_PRIVATE)
@@ -75,7 +80,8 @@ object RecentsCache {
subtitle = o.getString("subtitle"),
colorHex = o.getString("colorHex"),
imageHash = o.optString("imageHash").takeIf { it.isNotBlank() },
isProfileImage = o.optBoolean("isProfileImage", false)
isProfileImage = o.optBoolean("isProfileImage", false),
bank = o.optString("bank").takeIf { it.isNotBlank() }
)
}
} catch (_: Exception) {