private callVerificationApi()

in client/src/js/RemoteVerifier.ts [128:153]


  private callVerificationApi(
    requestData: VerifyRequestData,
    successCallback: (result: boolean) => void,
    errorCallback: (error: Error) => void
  ): void {
    const verifyEndpoint: string = Utils.getConfig().API_VERIFY_ENDPOINT_PATTERN.replace(
      "{challengeId}",
      this.challengeId
    );
    const url: string = Utils.getConfig().API_URL + verifyEndpoint;

    Logger.info(`calling ${url}`);
    Logger.info(requestData);
    const promise = axios.post(url, requestData);
    promise
      .then(function(response: any) {
        Logger.info(response);
        const verifyResponseData: VerifyResponseData = response.data;
        Logger.info(verifyResponseData);
        successCallback(verifyResponseData.success);
      })
      .catch(function(error: any) {
        Logger.error(error);
        errorCallback(error);
      });
  }