Ejemplo n.º 1
0
        public static BankBvnResponse GetCustomerBvnDetails(BankBvnRequest bankBvnRequest)
        {
            var resp = new BankBvnResponse();

            try
            {
                if (bankBvnRequest != null)
                {
                    if (!string.IsNullOrEmpty(bankBvnRequest.bvn) && !string.IsNullOrEmpty(bankBvnRequest.bankCode))
                    {
                        resp = BvnService.getBvn(bankBvnRequest.bvn, bankBvnRequest.bankCode);
                    }
                    else
                    {
                        resp.ResponseCode = "99"; resp.ResponseDescription = "missing  required field in request";
                    }
                }
                else
                {
                    resp.ResponseCode = "99"; resp.ResponseDescription = "null request";
                }
            }
            catch (Exception e)
            {
                ExceptionLogRepository.SaveExceptionLog(e);
            }
            return(resp);
        }
Ejemplo n.º 2
0
        public static string AddressVerificationStatus(string referenceNo)
        {
            var responseString = "";
            var fullUrl        = seamFixBaseUrl + "/sfx-verify/v2/query/" + referenceNo;
            var requestTime    = DateTime.Now;

            try

            {
                using (var client = new HttpClient())
                {
                    Utils.AddCustomHeadersToHttpClient(client);
                    requestTime = DateTime.Now;
                    var httpResponseMsg = client.GetAsync(fullUrl).Result;

                    if (httpResponseMsg.IsSuccessStatusCode)
                    {
                        responseString = httpResponseMsg.Content.ReadAsStringAsync().Result;
                    }
                }
                var responseTime = DateTime.Now;
                RequestResponseRepository.SaveRequestResponse("GET", "", requestTime, fullUrl, responseString, "", responseTime);
            }
            catch (Exception e)
            {
                ExceptionLogRepository.SaveExceptionLog(e);
            }
            return(responseString);
        }
Ejemplo n.º 3
0
        public static string AddressVerificationRequest(AddressVerificationRequest AddressVerifReq)
        {
            var responseString = "";
            var fullUrl        = seamFixBaseUrl + "/sfx-verify/v2/address";
            var json           = JsonConvert.SerializeObject(AddressVerifReq);
            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.º 4
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);
        }
Ejemplo n.º 5
0
        public static string DocumentServiceRequest(DocumentServiceRequest documentsValidation)
        {
            var responseString = "";
            var fullUrl        = seamFixBaseDocUrl + "document/check/";

            documentsValidation.transactionRef = KycLogic.GenerateTransactionRef();
            var json        = JsonConvert.SerializeObject(documentsValidation);
            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.º 6
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);
        }
Ejemplo n.º 7
0
        public static StatusResponse StatusResponseProcessor(StatusServiceRequest statusReq)
        {
            var resp = new StatusResponse();

            try
            {
                string jsonResponse = KycService.StatusServiceRequest(statusReq);
                resp = JsonConvert.DeserializeObject <StatusResponse>(jsonResponse);
            }
            catch (Exception e)
            {
                ExceptionLogRepository.SaveExceptionLog(e);
            }
            return(resp);
        }
Ejemplo n.º 8
0
        public static DocumentServiceResponse DocumentServiceProcessor(DocumentServiceRequest documentReq)
        {
            var resp = new DocumentServiceResponse();

            try
            {
                string jsonResponse = KycService.DocumentServiceRequest(documentReq);
                resp = JsonConvert.DeserializeObject <DocumentServiceResponse>(jsonResponse);
            }
            catch (Exception e)
            {
                ExceptionLogRepository.SaveExceptionLog(e);
            }
            return(resp);
        }
Ejemplo n.º 9
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.º 10
0
        public static AddressVerificationStatusResponse AddressVerificationStatusResponseProcessor(string referenceNo)
        {
            var resp = new AddressVerificationStatusResponse();

            try
            {
                string jsonResponse = KycService.AddressVerificationStatus(referenceNo);
                resp = JsonConvert.DeserializeObject <AddressVerificationStatusResponse>(jsonResponse);
            }
            catch (Exception e)
            {
                ExceptionLogRepository.SaveExceptionLog(e);
            }
            return(resp);
        }
Ejemplo n.º 11
0
        public static KycTier3VerifResponse KycTier3VerifResponseProcessor(KycTier3Verification KycTier3Req)
        {
            var resp = new KycTier3VerifResponse();

            try
            {
                string jsonResponse = KycService.KycTier3Verification(KycTier3Req);
                resp = JsonConvert.DeserializeObject <KycTier3VerifResponse>(jsonResponse);
            }
            catch (Exception e)
            {
                ExceptionLogRepository.SaveExceptionLog(e);
            }
            return(resp);
        }
Ejemplo n.º 12
0
        public static IdValidationResponse IdValidationProcessor(IdValidationRequest idValidationRequest)
        {
            var resp = new IdValidationResponse();

            try
            {
                string jsonResponse = KycService.IdServiceValidation(idValidationRequest);

                resp = JsonConvert.DeserializeObject <IdValidationResponse>(jsonResponse);
            }
            catch (Exception e)
            {
                ExceptionLogRepository.SaveExceptionLog(e);
            }
            return(resp);
        }
Ejemplo n.º 13
0
        public static BankBvnResponse getBvn(string bvn, string bankCode)
        {
            var bankBvnResponse = new BankBvnResponse();

            try
            {
                //str1 = o2.ResponseCode + "|" + o2.FirstName + "|" + o2.MiddleName + "|" + o2.LastName + "|" + o2.DateOfBirth + "|" + o2.ImageBase64
                BankBvnService.BVNProcessorSoapClient client = new BankBvnService.BVNProcessorSoapClient();
                var requestTime  = DateTime.Now;
                var response     = client.VerifySingleBVN(bvn, bankCode);
                var responseTime = DateTime.Now;
                RequestResponseRepository.SaveRequestResponse("ASMX", "bvn : " + bvn + "; bankcode :" + bankCode, requestTime, "bankBvnService", response, "", responseTime);
                bankBvnResponse = kyc.bridge.api.BusinessLogic.KycLogic.RetrieveBvnDetailsFromResponse(response);
            }
            catch (Exception e)
            {
                ExceptionLogRepository.SaveExceptionLog(e);
            }
            return(bankBvnResponse);
        }