validateOtp method

Future<Response> validateOtp(
  1. String id,
  2. String otp,
  3. String apiKey
)

Implementation

Future<http.Response> validateOtp(
    String id, String otp, String apiKey) async {
  final requestBody = {"otp_code": otp};

  return await http.post(
    Uri.parse(ApiConstants.baseUrl +
        ApiConstants.initiateVerification +
        id +
        ApiConstants.verifyOtp),
    headers: {"API-KEY": apiKey, "Content-Type": "application/json"},
    body: jsonEncode(requestBody),
  );
}