validateFaceLiveness function
Valida una sesión de Face Liveness y retorna su estado. status posibles (por errores mapeados): waitingForScan, rejected, processing, expired
Implementation
Future<ApacuanaSuccess<Map<String, dynamic>>> validateFaceLiveness({
required String sessionId,
}) {
if (sessionId.isEmpty) {
throw ApacuanaAPIError(
'sessionId is a required parameter.',
statusCode: 400,
errorCode: 'INVALID_PARAMETER',
);
}
final cfg = getConfig();
final typeStr = cfg.integrationType;
final typeEnum = IntegrationType.fromValue(typeStr);
if (typeEnum == IntegrationType.onboarding ||
typeStr == INTEGRATION_TYPE['ONBOARDING']) {
return _validateFaceLivenessOnBoarding(sessionId);
}
if (typeEnum == IntegrationType.onPremise ||
typeStr == INTEGRATION_TYPE['ONPREMISE']) {
return _validateFaceLivenessOnPremise();
}
throw ApacuanaAPIError(
'Unsupported integration type: $typeStr',
statusCode: 400,
errorCode: 'UNSUPPORTED_INTEGRATION_TYPE',
);
}