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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user