checkStatus method

Future<Map<String, dynamic>> checkStatus(
  1. String txnId,
  2. String accessToken
)

Implementation

Future<Map<String, dynamic>> checkStatus(String txnId,String accessToken) async {
  final url = Uri.parse('https://apidev.ioh.co.id/id-auth/api/v1/id-auth/status/$txnId');

  final headers = {
    'Authorization':  'Bearer '+accessToken,
  };

  final response = await http.get(url, headers: headers);

  if (response.statusCode == 200) {
    return jsonDecode(response.body);
  } else {
    throw Exception('Failed to fetch status: ${response.body}');
  }
}