Example #1
0
        private bool ApiAuthenticate()
        {
            try
            {
                CloudScanrApiManager.ApiHelper apiHelper    = new CloudScanrApiManager.ApiHelper(AppSettingsReader.CloudScanr_API);
                CloudScanrModels.CSTokenModel  csTokenModel = apiHelper.GetToken(SessionManager.CloudScanrAuthenticate.AppKey, SessionManager.CloudScanrAuthenticate.AppSecret);
                if (string.IsNullOrEmpty(csTokenModel.Error) && string.IsNullOrEmpty(csTokenModel.ErrorDescription) && !string.IsNullOrEmpty(csTokenModel.AccessToken))
                {
                    SessionManager.CloudScanrAPIToken = csTokenModel.AccessToken;

                    return(true);
                }
                else
                {
                    lblMessage.Visible = true;
                    lblMessage.Text    = "CloudScanr Authentication failed:: Error: " + csTokenModel.Error + " Error_Desc::" + csTokenModel.ErrorDescription;
                }
            }
            catch (Exception ex)
            {
                lblMessage.Visible = true;
                lblMessage.Text    = ex.Message;
            }
            return(false);
        }
        private void FingerPrintCapture(CloudScanrModels.CloudScanrCapture cloudScanrparam)
        {
            try
            {
                CloudScanrApiManager.ApiHelper           apiHelper       = new CloudScanrApiManager.ApiHelper(AppSettingsReader.CloudScanr_API);
                CloudScanrModels.CloudScanrCaptureResult transactionInfo = new CloudScanrModels.CloudScanrCaptureResult();

                transactionInfo = apiHelper.Capture(cloudScanrparam, SessionManager.CloudScanrAPIToken);

                PraseResult(transactionInfo, cloudScanrparam);
            }
            catch (Exception ex)
            {
                lblMessage.Visible = true;
                lblMessage.Text    = "From API Calling:: " + ex.Message;
            }
        }