Beispiel #1
0
        protected void btnVerifyBVN_Click(object sender, EventArgs e)
        {
            formone.Visible = false;
            formtwo.Visible = true;
            if (cardBVN.Text == "" || txtCardNumber.Text == "" || txtCVV.Text == "" || txtPin.Text == "")
            {
                Response.Write("<script language='javascript'>alert('Please Fill All Fields');</script>");
                return;
            }

            try
            {
                NibssRepository nibss          = new NibssRepository();
                string          EndpointUrl    = $"{BaseUrl}/api/nibss/searchbvn?bvn={cardBVN.Text}";
                string          responseString = "";
                // var bvnSearchResponse = await new ApiRequest(EndpointUrl).MakeHttpClientRequest(null, ApiRequest.Verbs.GET, null);
                //if (bvnSearchResponse.StatusCode == System.Net.HttpStatusCode.OK)
                if (true)
                {
                    //  DefaultApiReponse<BvnSearchResp> response = Newtonsoft.Json.JsonConvert.DeserializeObject<DefaultApiReponse<BvnSearchResp>>(responseString);
                    var response = nibss.BvnSearch(cardBVN.Text);
                    //Session["BvnSearchResp"] = response.Object;
                    Session["BvnSearchResp"] = response;
                    Random rnd = new Random();
                    string Otp = rnd.Next(0, 9999).ToString("D4");
                    //string phoneNo = response.Object.PhoneNumber1;
                    string     phoneNo    = response.PhoneNumber2;
                    OtpRequest otpRequest = new OtpRequest
                    {
                        Bvn = cardBVN.Text,
                        Otp = Otp
                    };
                    EndpointUrl = $"{BaseUrl}/api/otp";

                    // var r = await new ApiRequest(EndpointUrl).MakeHttpClientRequest(otpRequest, ApiRequest.Verbs.POST, null);

                    //if (r.StatusCode == System.Net.HttpStatusCode.OK)
                    if (true)
                    {
                        //  responseString = await r.Content.ReadAsStringAsync();

                        //EmailSender.SendMail(response.Email, Otp);
                        mailTrxn.SendMailAlerts(response.Email, "Your otp is" + Otp, "Team Daze OTP");
                    }
                }
                else
                {
                    Alertdiv.InnerText = "Unable To Get BVN From NiBSS";
                    Alertdiv.Visible   = true;
                    return;
                }
            }
            catch (Exception ex)
            {
                //  new ErrorLog();
                TeamDaze.BLL.DAL.ErrorLog loggger = new ErrorLog(ex.ToString());
                Response.Write("<script language='javascript'>alert('an error occured, kindly try again');</script>");
                return;
            }
        }
Beispiel #2
0
        public TeamDaze.BLL.DTO.BvnSearchResp BvnSearch(string bvn)
        {
            NibssRepository restobj = new NibssRepository();
            var             resp    = restobj.BvnSearch(bvn);

            return(resp);
        }
Beispiel #3
0
        public MatchWithBvnResp MatchWithBvn(string Bvn, string Position, string ISOTemplate)
        {
            NibssRepository restobj = new NibssRepository();
            var             resp    = restobj.MatchWithBvn(Bvn, Position, ISOTemplate);

            return(resp);
        }
Beispiel #4
0
        public MatchWithBvnResp MatchWithPhone(string Phone, string Position, string ISOTemplate)
        {
            NibssRepository restobj = new NibssRepository();
            var             resp    = restobj.MatchWithPhonenumber(Phone, Position, ISOTemplate);

            return(resp);
        }
Beispiel #5
0
        public string GenerateCredentials(string bvn)
        {
            NibssRepository restobj = new NibssRepository();
            string          resp    = restobj.GenerateCredentials(bvn);

            return(resp);
        }