예제 #1
0
        protected bool AadhaarSendOTP()
        {
            //AadhaarHistoryLog("OTP", "1", "1", "1");

            RequestObject request = new RequestObject();

            request.setAadhaarNumber(ADSE.AadhaarNumber);
            request.setTransaction(Util.generateTransactionId(TypeOfRequest.Others));
            request.setOtpRequestType(OTPRequestType.AADHAAR);
            request.setTimeStamp(Util.getTimeStamp());

            krdh.connector.KRDHConnectorImpl krdhConnector = new KRDHConnectorImpl();
            ResponseObject response = krdhConnector.RequestOTP(request);

            if (response.getStatus().Equals("N"))
            {
                //Response.Write("Failed to generate the request.");
                //Response.Write(response.getError());
                //Response.Write(response.getErrorMessage());
                Response.Write(response.getUIDToken());
                ADSE.SendOTPErrorMessage = response.getErrorMessage();
                ADSE.SendOTPErrorCode    = response.getError();
                //DisplayAlert(response.getErrorMessage(),this);
                AadhaarHistoryLog("OTP", response.getStatus(), response.getTransaction(), response.getTimeStamp().ToString());
                return(false);
            }
            else
            {
                if (response.getResponseStatus().ToLower().Equals("y"))
                {
                    Response.Write(response.getTimeStamp());
                    ADSE.AadhaarOTPResponseTransactionID = response.getTransaction();

                    Response.Write("SUCCESS");
                    Response.Write("OTP Sent: " + response.getTransaction() + "\n");

                    Response.Write("Var OTP Sent: " + ADSE.AadhaarOTPResponseTransactionID + "\n");
                    AadhaarHistoryLog("OTP", response.getStatus(), response.getTransaction(), response.getTimeStamp().ToString());

                    return(true);
                }
                else
                {
                    Response.Write(response.getError());
                    Response.Write(response.getErrorMessage());
                    DisplayAlert(response.getErrorMessage(), this);
                    ADSE.SendOTPErrorMessage = response.getErrorMessage();
                    ADSE.SendOTPErrorCode    = response.getError();
                    AadhaarHistoryLog("OTP", response.getStatus(), response.getTransaction(), response.getTimeStamp().ToString());

                    return(false);
                }
            }
        }
예제 #2
0
        public bool VerifyAadhaarOTP(string ipaddress, string PageName, string path)
        {
            KYCRequest kYCRequest = new KYCRequest();

            kYCRequest.setAuthenticationType(ResidentAuthenticationType.OTP);
            kYCRequest.setDecryptionRequired(false);
            kYCRequest.setLocalLanguageRequired(false);
            kYCRequest.setPrintFormatRequired(false);

            RequestObject request = new RequestObject();

            request.setAadhaarNumber(ADSER.AadhaarNumber);
            request.setVersion("2.5");                                               //ex
            request.setUdc(ConfigurationSettings.AppSettings["UDCCode"].ToString()); //ex
            //request.setUdc("ASBD20171013100000");
            request.setTimeStamp(Util.getTimeStamp());
            request.setResidentConsent(true);

            request.setKycRequest(kYCRequest);

            PinValue pv = new PinValue();

            pv.setOtp(ADSER.AadhaarApplicantOTP);

            request.setTransaction(ADSER.AadhaarOTPResponseTransactionID);
            //Response.Write("Verifying OTP(var): " + ADSER.AadhaarOTPResponseTransactionID + "\n");
            //request.setTransaction(UUID.randomUUID().toString());
            request.setPinValue(pv);


            KRDHConnectorImpl krdhConnector = new KRDHConnectorImpl();

            ResponseObject response = krdhConnector.requestKYC(request);

            //Response.Write("Got Response\n");
            ADLOG.AadhaarHistoryLog("KYC", response.getStatus(), response.getTransaction(), response.getTimeStamp().ToString());

            //Response.Write(response.getInfo());
            if (response.getStatus().Equals("N"))
            {
                //Response.Write("Failed to generate the request.\n");
                //Response.Write(response.getError() + "\n");
                //Response.Write(response.getErrorMessage() + "\n");
                //Response.Write("Var : " + ADSER.AadhaarOTPResponseTransactionID + "\n");
                ADSER.OTPErrorCode    = response.getError();
                ADSER.OTPErrorMessage = response.getErrorMessage();
                DL.WriteErrorLog(ADSER.OTPErrorCode, ADSER.OTPErrorMessage, ipaddress, PageName, path);
                return(false);
            }
            else
            {
                if (response.getResponseStatus().ToLower().Equals("y"))
                {
                    //Response.Write(response.getTimeStamp() + "\n");
                    //Response.Write(response.getTransaction() + "\n");
                    //Response.Write("SUCCESS" + "\n");

                    //lblToken.Text = ADSER.AadhaarVaultToken;
                    if (AADENC.GetAadhaarToken(ADSER.AadhaarNumber))
                    {
                        ADSER.DOB    = response.GetKycRes().UidData.Poi.dob;
                        ADSER.Gender = response.GetKycRes().UidData.Poi.gender;
                        ADSER.Name   = response.GetKycRes().UidData.Poi.name;

                        ADSER.State = response.GetKycRes().UidData.Poa.state;

                        ADSER.Photo   = response.GetKycRes().UidData.Pht;
                        ADSER.Pincode = response.GetKycRes().UidData.Poa.pc;

                        ADSER.District = response.GetKycRes().UidData.Poa.dist;
                        File.WriteAllBytes(HttpContext.Current.Server.MapPath("~/DownloadFiles/AadhaarLogImage/" + ADSER.AadhaarVaultToken + ".png"), ADSER.Photo);

                        ADStore.StoreAadhaar(
                            response.getTransaction(),
                            ADSER.AadhaarNumber, ADSER.AadhaarVaultToken, response.GetKycRes().UidData.uid, ADSER.Name, ADSER.DOB, ADSER.Gender,
                            response.GetKycRes().UidData.Poa.co,
                            response.GetKycRes().UidData.Poa.house,
                            response.GetKycRes().UidData.Poa.street,
                            response.GetKycRes().UidData.Poa.lm,
                            response.GetKycRes().UidData.Poa.loc,
                            response.GetKycRes().UidData.Poa.vtc,
                            response.GetKycRes().UidData.Poa.subdist,
                            response.GetKycRes().UidData.Poa.dist,
                            response.GetKycRes().UidData.Poa.state,
                            response.GetKycRes().UidData.Poa.pc,
                            response.GetKycRes().UidData.Poa.po,

                            response.GetKycRes().UidData.LData.name,
                            response.GetKycRes().UidData.LData.co,
                            response.GetKycRes().UidData.LData.house,
                            response.GetKycRes().UidData.LData.street,
                            response.GetKycRes().UidData.LData.lm,
                            response.GetKycRes().UidData.LData.loc,
                            response.GetKycRes().UidData.LData.vtc,
                            response.GetKycRes().UidData.LData.subdist,
                            response.GetKycRes().UidData.LData.dist,
                            response.GetKycRes().UidData.LData.state,
                            response.GetKycRes().UidData.LData.pc,
                            response.GetKycRes().UidData.LData.po);
                        //Response.Write("___" + ADSER.Name + "___" + ADSER.DOB + "_" + ADSER.Gender + "_" + ADSER.District + "_" + ADSER.State);
                        //string fileName = Path.Combine(Server.MapPath("C:\inetpub\wwwroot\AadhaarApplicantPhoto"));

                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
                else
                {
                    //Response.Write(response.getError() + "\n");
                    //Response.Write(response.getErrorMessage() + "\n");
                    ADSER.OTPErrorCode    = response.getError();
                    ADSER.OTPErrorMessage = response.getErrorMessage();
                    DL.WriteErrorLog(ADSER.OTPErrorCode, ADSER.OTPErrorMessage, ipaddress, PageName, path);

                    return(false);
                }
            }
        }
예제 #3
0
        private bool VerifyAadhaarOTP()
        {
            KYCRequest kYCRequest = new KYCRequest();

            kYCRequest.setAuthenticationType(ResidentAuthenticationType.OTP);
            kYCRequest.setDecryptionRequired(false);
            kYCRequest.setLocalLanguageRequired(false);
            kYCRequest.setPrintFormatRequired(false);
            RequestObject request = new RequestObject();

            request.setAadhaarNumber(ADSE.AadhaarNumber);
            request.setVersion("2.5");
            //request.setUdc(UDCCode);
            request.setTimeStamp(Util.getTimeStamp());
            request.setResidentConsent(true);
            request.setKycRequest(kYCRequest);
            PinValue pv = new PinValue();

            pv.setOtp(ADSE.AadhaarApplicantOTP);
            request.setTransaction(ADSE.AadhaarOTPResponseTransactionID);
            Response.Write("Verifying OTP(var): " + ADSE.AadhaarOTPResponseTransactionID + "\n");
            request.setPinValue(pv);
            KRDHConnectorImpl krdhConnector = new KRDHConnectorImpl();
            ResponseObject    response      = krdhConnector.requestKYC(request);

            Response.Write("Response Received\n");
            Response.Write(response.getInfo());
            if (response.getStatus().Equals("N"))
            {
                Response.Write("Failed to generate the request.\n");
                Response.Write(response.getError() + "\n");
                Response.Write(response.getErrorMessage() + "\n");
                Response.Write("Var : " + ADSE.AadhaarOTPResponseTransactionID + "\n");
                ADSE.OTPErrorCode    = response.getError();
                ADSE.OTPErrorMessage = response.getErrorMessage();
                return(false);
            }
            else
            {
                if (response.getResponseStatus().ToLower().Equals("y"))
                {
                    Response.Write(response.getTimeStamp() + "\n");
                    Response.Write(response.getTransaction() + "\n");
                    Response.Write("SUCCESS" + "\n");
                    lblToken.Text = ADSE.AadhaarVaultToken;
                    ADSE.DOB      = response.GetKycRes().UidData.Poi.dob;
                    ADSE.Gender   = response.GetKycRes().UidData.Poi.gender;
                    ADSE.Name     = response.GetKycRes().UidData.Poi.name;
                    ADSE.State    = response.GetKycRes().UidData.Poa.state;
                    ADSE.District = response.GetKycRes().UidData.Poa.state;
                    ADSE.Photo    = response.GetKycRes().UidData.Pht;
                    ADSE.Pincode  = response.GetKycRes().UidData.Poa.pc;
                    Response.Write("___" + ADSE.Name + "___" + ADSE.DOB + "_" + ADSE.Gender + "_" + ADSE.District + "_" + ADSE.State);
                    return(true);
                }
                else
                {
                    Response.Write(response.getError() + "\n");
                    Response.Write(response.getErrorMessage() + "\n");
                    ADSE.OTPErrorCode    = response.getError();
                    ADSE.OTPErrorMessage = response.getErrorMessage();
                    return(false);
                }
            }
        }
예제 #4
0
        private bool VerifyAadhaarOTP()
        {
            KYCRequest kYCRequest = new KYCRequest();

            kYCRequest.setAuthenticationType(ResidentAuthenticationType.OTP);
            kYCRequest.setDecryptionRequired(false);
            kYCRequest.setLocalLanguageRequired(false);
            kYCRequest.setPrintFormatRequired(false);

            RequestObject request = new RequestObject();

            request.setAadhaarNumber(ADSE.AadhaarNumber);
            request.setVersion("2.5");
            request.setUdc(ConfigurationSettings.AppSettings["UDCCode"].ToString());
            //request.setUdc("ASBD20171013100000");
            request.setTimeStamp(Util.getTimeStamp());
            request.setResidentConsent(true);

            request.setKycRequest(kYCRequest);

            PinValue pv = new PinValue();

            pv.setOtp(ADSE.AadhaarApplicantOTP);

            request.setTransaction(ADSE.AadhaarOTPResponseTransactionID);
            Response.Write("Verifying OTP(var): " + ADSE.AadhaarOTPResponseTransactionID + "\n");
            //request.setTransaction(UUID.randomUUID().toString());
            request.setPinValue(pv);


            KRDHConnectorImpl krdhConnector = new KRDHConnectorImpl();

            ResponseObject response = krdhConnector.requestKYC(request);

            Response.Write("Got Response\n");

            Response.Write(response.getInfo());
            if (response.getStatus().Equals("N"))
            {
                Response.Write("Failed to generate the request.\n");
                Response.Write(response.getError() + "\n");
                Response.Write(response.getErrorMessage() + "\n");
                Response.Write("Var : " + ADSE.AadhaarOTPResponseTransactionID + "\n");
                ADSE.OTPErrorCode    = response.getError();
                ADSE.OTPErrorMessage = response.getErrorMessage();
                WriteErrorLog(ADSE.OTPErrorCode, ADSE.OTPErrorMessage);
                return(false);
            }
            else
            {
                if (response.getResponseStatus().ToLower().Equals("y"))
                {
                    Response.Write(response.getTimeStamp() + "\n");
                    Response.Write(response.getTransaction() + "\n");
                    Response.Write("SUCCESS" + "\n");


                    lblToken.Text = ADSE.AadhaarVaultToken;

                    ADSE.DOB    = response.GetKycRes().UidData.Poi.dob;
                    ADSE.Gender = response.GetKycRes().UidData.Poi.gender;
                    ADSE.Name   = response.GetKycRes().UidData.Poi.name;

                    ADSE.State    = response.GetKycRes().UidData.Poa.state;
                    ADSE.District = response.GetKycRes().UidData.Poa.state;

                    ADSE.Photo   = response.GetKycRes().UidData.Pht;
                    ADSE.Pincode = response.GetKycRes().UidData.Poa.pc;
                    Response.Write("___" + ADSE.Name + "___" + ADSE.DOB + "_" + ADSE.Gender + "_" + ADSE.District + "_" + ADSE.State);
                    //string fileName = Path.Combine(Server.MapPath("C:\inetpub\wwwroot\AadhaarApplicantPhoto"));

                    return(true);
                }
                else
                {
                    Response.Write(response.getError() + "\n");
                    Response.Write(response.getErrorMessage() + "\n");
                    ADSE.OTPErrorCode    = response.getError();
                    ADSE.OTPErrorMessage = response.getErrorMessage();
                    WriteErrorLog(ADSE.OTPErrorCode, ADSE.OTPErrorMessage);

                    return(false);
                }
            }
        }