Beispiel #1
0
        public static string KycTier3Verification(KycTier3Verification KycTier3Verif)
        {
            var responseString = "";
            var fullUrl        = seamFixBaseUrl + "KYC Tier-3 Verification";

            KycTier3Verif.transactionRef = KycLogic.GenerateTransactionRef();
            var json        = JsonConvert.SerializeObject(KycTier3Verif);
            var requestTime = DateTime.Now;

            try
            {
                using (var client = new HttpClient())
                {
                    Utils.AddCustomHeadersToHttpClient(client);
                    var data = new StringContent(json, Encoding.UTF8, "application/json");
                    requestTime = DateTime.Now;
                    var httpResponseMsg = client.PostAsync(fullUrl, data).Result;

                    if (httpResponseMsg.IsSuccessStatusCode)
                    {
                        responseString = httpResponseMsg.Content.ReadAsStringAsync().Result;
                    }
                }
                var responseTime = DateTime.Now;
                RequestResponseRepository.SaveRequestResponse("POST", json, requestTime, fullUrl, responseString, "", responseTime);
            }
            catch (Exception e)
            {
                ExceptionLogRepository.SaveExceptionLog(e);
            }
            return(responseString);
        }
Beispiel #2
0
        public static string IdServiceValidation(IdValidationRequest idValidation)
        {
            var idType = "";

            switch (idValidation.idType.ToLower())
            {
            case "nin":
                idType = "nin";
                break;

            case "vin":
                idType = "vin";
                break;

            case "passport":
                idType = "passport";
                break;

            case "frsc":
                idType = "frsc";
                break;

            default:
                idType = "";
                break;
            }

            var responseString = "";
            var fullUrl        = seamFixBaseUrl + "id-service/" + idType;

            idValidation.transactionRef = KycLogic.GenerateTransactionRef();
            var json        = JsonConvert.SerializeObject(idValidation);
            var requestTime = DateTime.Now;

            try
            {
                using (var client = new HttpClient())
                {
                    Utils.AddCustomHeadersToHttpClient(client);

                    var data = new StringContent(json, Encoding.UTF8, "application/json");

                    requestTime = DateTime.Now;
                    var httpResponseMsg = client.PostAsync(fullUrl, data).Result;

                    if (httpResponseMsg.IsSuccessStatusCode)
                    {
                        responseString = httpResponseMsg.Content.ReadAsStringAsync().Result;
                    }
                }

                var responseTime = DateTime.Now;
                RequestResponseRepository.SaveRequestResponse("POST", json, requestTime, fullUrl, responseString, "", responseTime);
            }
            catch (Exception e)
            {
                ExceptionLogRepository.SaveExceptionLog(e);
            }
            return(responseString);
        }
Beispiel #3
0
        protected void IdVal()
        {
            try
            {
                using (var client = new WebClient())
                {
                    var fullUrl = "http://localhost:52353/api/kyc/seamfix/v1/id-validation";
                    var values  = new NameValueCollection();
                    values["idNo"]                 = "121290909090";
                    values["idBase64String"]       = "wyueryiew";
                    values["surname"]              = "bayo";
                    values["firstname"]            = "ade";
                    values["dob"]                  = "1990-04-01";
                    values["passportBase64String"] = "";
                    values["idtype"]               = "frsc";
                    values["transactionRef"]       = KycLogic.GenerateTransactionRef();

                    var requestTime    = DateTime.Now;
                    var response       = client.UploadValues(fullUrl, values);
                    var responseTime   = DateTime.Now;
                    var responseString = Encoding.Default.GetString(response);
                }
            }
            catch (Exception e)
            {
            }
        }
Beispiel #4
0
        protected void BvnVal()
        {
            try
            {
                using (var client = new WebClient())
                {
                    var fullUrl = "http://localhost:52353/api/kyc/seamfix/v1/bvn";
                    var values  = new NameValueCollection();
                    //client.Headers.Add("Content-Type", "application/json");
                    //client.Headers.Add("Accept", "application/json");
                    values["bvn"]            = "22222222223";
                    values["transactionRef"] = KycLogic.GenerateTransactionRef();


                    var requestTime = DateTime.Now;
                    var response    = client.UploadValues(fullUrl, values);
                    //var response = client.UploadData(fullUrl, values);
                    var responseTime   = DateTime.Now;
                    var responseString = Encoding.Default.GetString(response);
                }
            }
            catch (Exception e)
            {
            }
        }
Beispiel #5
0
        public static string IdServiceFaceMatch(IdFaceMatchRequest idFaceValidation)
        {
            var responseString = "";
            var idType         = "";

            switch (idFaceValidation.idType.ToLower())
            {
            case "nin":
                idType = "nin";
                break;

            case "vin":
                idType = "vin";
                break;

            case "passport":
                idType = "passport";
                break;

            case "frsc":
                idType = "frsc";
                break;

            default:
                idType = "";
                break;
            }
            try
            {
                using (var client = new WebClient())
                {
                    var fullUrl = seamFixBaseUrl + "id-service/" + idType;
                    var values  = new NameValueCollection();
                    values["idNo"]                  = idFaceValidation.idNo;
                    values["idBase64String"]        = idFaceValidation.idBase64String;
                    values["surname"]               = idFaceValidation.surname;
                    values["firstname"]             = idFaceValidation.firstname;
                    values["dob"]                   = idFaceValidation.dob;
                    values["passportBase64String"]  = idFaceValidation.passportBase64String;
                    idFaceValidation.transactionRef = KycLogic.GenerateTransactionRef();
                    values["transactionRef"]        = idFaceValidation.transactionRef;
                    var requestTime  = DateTime.Now;
                    var response     = client.UploadValues(fullUrl, values);
                    var responseTime = DateTime.Now;
                    responseString = Encoding.Default.GetString(response);

                    RequestResponseRepository.SaveRequestResponse("POST", values.ToString(), requestTime, fullUrl, responseString, "", responseTime);
                }
            }
            catch (Exception e)
            {
                ExceptionLogRepository.SaveExceptionLog(e);
            }
            return(responseString);
        }