verifyNfcDocument method
Future<VerificationResponse>
verifyNfcDocument(
- String sessionId,
- String documentType,
- String countryCode,
- File faceVideo,
- PersonDetails documentInfo,
Verify NFC document
Implementation
Future<VerificationResponse> verifyNfcDocument(
String sessionId,
String documentType,
String countryCode,
File faceVideo,
PersonDetails documentInfo,
) async {
try {
final Map<String, dynamic> response = await _plugin.verifyNfcDocument(
sessionId,
{
'document_type': documentType,
'document_country': countryCode,
'face_video': faceVideo,
'document_face_image': documentInfo.faceImageBase64,
'document_infos': documentInfo.toMap(),
},
);
// Add sessionId to the response if it's not already present
final responseWithSessionId = Map<String, dynamic>.from(response);
if (!responseWithSessionId.containsKey('session_id')) {
responseWithSessionId['session_id'] = sessionId;
}
return VerificationResponse.fromJson(responseWithSessionId);
} catch (e) {
throw Exception('Failed to verify NFC document: $e');
}
}