Add Tap to Pay feature and misc fixes

Adds BML contactless token fetching, APDU emulation utility, TapToPayViewModel, and TapToPayView with NFC animation. Also updates QR scanner, transfer flow, dashboard, and home views.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-08 01:27:27 +05:00
co-authored by Claude Sonnet 4.6
parent 160ef97e68
commit 2bbb280380
10 changed files with 1080 additions and 49 deletions
+12 -1
View File
@@ -1,6 +1,6 @@
import Foundation
struct PaymvQrResult {
struct PaymvQrResult: Equatable {
let account: String
let amount: String?
let merchantName: String?
@@ -8,6 +8,17 @@ struct PaymvQrResult {
}
enum PaymvQrParser {
static func extractBmlGatewayUrl(_ raw: String) -> String? {
if raw.hasPrefix("https://pay.bml.com.mv/app/") { return raw }
let root = parseTLV(raw)
guard let bmlMerchantInfo = root["35"].flatMap({ parseTLV($0) }),
let inner = bmlMerchantInfo["20"].flatMap({ parseTLV($0) }),
let url = inner["01"],
url.hasPrefix("https://pay.bml.com.mv/app/") else { return nil }
return url
}
static func parse(_ qr: String) -> PaymvQrResult? {
let tlvs = parseTLV(qr)