EmvInfo.fromMap constructor
Implementation
factory EmvInfo.fromMap(Map<String, dynamic>? map) {
if (map == null) return const EmvInfo();
var cType = map['cryptogramType'] as String?;
var cValue = map['cryptogram'] as String?;
// SDK often returns cryptogram as "TYPE VALUE" (e.g., "TC E123...")
if (cType == null && cValue != null && cValue.contains(' ')) {
final parts = cValue.split(' ');
if (parts.length >= 2) {
cType = parts[0];
// cValue = parts.sublist(1).join(' ');
}
}
return EmvInfo(
applicationId: map['applicationId'] as String?,
applicationLabel: map['applicationLabel'] as String?,
cryptogramType: cType,
cryptogram: cValue,
);
}