Ejemplo n.º 1
0
        public static string BvnServiceFaceMatchRequest(BvnServiceFaceMatch bvnFaceMatchValidation)
        {
            var responseString = "";
            var fullUrl        = seamFixBaseBvnUrl + "bvn";

            bvnFaceMatchValidation.transactionRef = KycLogic.GenerateTransactionRef();
            var json        = JsonConvert.SerializeObject(bvnFaceMatchValidation);
            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);
        }
Ejemplo n.º 2
0
        public static BvnFacematchResponse BvnFacematchProcessor(BvnServiceFaceMatch bvnFacematchReq)
        {
            var resp = new BvnFacematchResponse();

            try
            {
                string jsonResponse = KycService.BvnServiceFaceMatchRequest(bvnFacematchReq);
                resp = JsonConvert.DeserializeObject <BvnFacematchResponse>(jsonResponse);
            }
            catch (Exception e)
            {
                ExceptionLogRepository.SaveExceptionLog(e);
            }
            return(resp);
        }
Ejemplo n.º 3
0
 public BvnFacematchResponse DoBvnFacematch(BvnServiceFaceMatch bvnFaceMatchReq)
 {
     return(KycLogic.BvnFacematchProcessor(bvnFaceMatchReq));
 }