getPartnerHVStatus method

Future<VerificationFlowResponse?> getPartnerHVStatus()

Implementation

Future<VerificationFlowResponse?> getPartnerHVStatus() async {
  final baseUrl = ConfigManager.current.baseUrl;
  final url = Uri.parse('$baseUrl$_healthVerificationStatusEndpoint');
  final token = await storage.getTokenOrThrow();

  final headers = {
    'Authorization': 'Bearer $token',
  };


  try {
    final response = await http.get(
      url,
      headers: headers,
    );
    final responseDataReady = await _checkResponseData(response, 'Failed to get Healt Verification Status');
    if (responseDataReady) {
      final Map<String, dynamic> jsonResponse = jsonDecode(response.body);
      return VerificationFlowResponse.fromJson(jsonResponse);
    }
    return null;
  } on SDKException {
    rethrow;
  } catch (e) {
    throw SDKException.withMessage(
      'PlumCheck SDK Exeption - Failed to get Healt Verification Status, Description: ${e.toString()}');
  }
}