Exemple #1
0
        /// <summary>
        /// Handles the Click event of the btnEnter control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        /// <remarks></remarks>
        protected void btnEnter_Click(object sender, EventArgs e)
        {
            if (IsValidInfo())
            {
                string Appnum = txtAppNumber.Text.Trim();

                if (!string.IsNullOrEmpty(Appnum))
                {
                    string fn             = string.Format(queryString, Appnum);
                    string urlQueryString = EncryptDecryptQueryString.Encrypt(fn, qsk);

                    ScriptManager.RegisterStartupScript(this, GetType(), "DisplayApp", "DisplayApplication('" + urlQueryString + "');", true);

                    //btnEnter.Attributes.Add("OnClick", "return DisplayApplication('" + urlQueryString + "');");
                }
                else
                {
                    lblerror.Text = "Please enter application number";
                }
            }
            else
            {
                lblerror.Text        = Constants.InvalidCaptcha;
                txtCaptchaFirst.Text = string.Empty;
            }
        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string Appnum = Convert.ToString(Session["AppHashNum"]);

            if (!string.IsNullOrEmpty(Appnum))
            {
                divbtn.Visible  = true;
                successMsg.Text = "An email with given application number has been sent to your email id. Please save that for future reference";
                lblMessage.Text = Constants.AppSuccess + "Your application number is: " + Appnum.Decrypt();

                string fn             = string.Format(queryString, Appnum.Decrypt());
                string urlQueryString = EncryptDecryptQueryString.Encrypt(fn, qsk);
                btnprintform.Attributes.Add("OnClick", "return DisplayApplication('" + urlQueryString + "');");
                Session["AppHashNum"] = null;
            }
            else
            {
                Response.Redirect("Login.aspx", true);
            }
        }
Exemple #3
0
        /// <summary>
        /// Handles the RowDataBound event of the grdCardStatement control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Web.UI.WebControls.GridViewRowEventArgs"/> instance containing the event data.</param>
        /// <remarks></remarks>
        //protected void grdCardStatement_RowDataBound(object sender, GridViewRowEventArgs e)
        protected void lstViewCardStatement_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            if (e.Item.ItemType == ListViewItemType.DataItem)
            {
                bool   IsAccHavePdf  = false;
                string FileName      = "";
                string AccountNumber = CardHolderManager.GetLoggedInUser().creditcard_acc_number.Decrypt();
                Label  LblNoPdf      = (Label)e.Item.FindControl(LblNoPDfId);
                Label  LblNoPrint    = (Label)e.Item.FindControl(lblnoPrintId);
                Label  lblPDFName    = (Label)e.Item.FindControl(lblPDFNameControlId);
                if (lblPDFName.Text.Trim() != "")
                {
                    FileName = Convert.ToString(lblPDFName.Text.Trim());
                }

                //CH_EVG_EVENTS_QUEUEDTO objPDF = new CardManager().GetCardStatementPDFFileName(cardNumber, Convert.ToDateTime(lblStatementDate.Text));
                //if (objPDF != null && objPDF.EVE_OUT_FILENAME != string.Empty)
                //    FileName = Convert.ToString(objPDF.EVE_OUT_FILENAME);

                LinkButton ibtnPrint    = (LinkButton)e.Item.FindControl(printControlId);
                LinkButton ibtnDownload = (LinkButton)e.Item.FindControl(downloadControlId);
                string     pdfPath      = "";
                if (Session[sessionFilePath] == null)
                {
                    pdfPath = GetFilePath();
                    Session[sessionFilePath] = pdfPath;
                }
                else if (Session[sessionFilePath] != null)
                {
                    pdfPath = Convert.ToString(Session[sessionFilePath]);
                }
                if (!string.IsNullOrEmpty(FileName))
                {
                    IsAccHavePdf = CardManager.GetPDFnames(AccountNumber, FileName);
                    if (IsAccHavePdf == true)
                    {
                        if (File.Exists(pdfPath + FileName))
                        {
                            LblNoPdf.Visible     = false;
                            LblNoPrint.Visible   = false;
                            ibtnPrint.Enabled    = true;
                            ibtnDownload.Enabled = true;
                            ibtnPrint.ToolTip    = printPDFToolTip;
                            ibtnDownload.ToolTip = downloadPDFToolTip;
                            string fn             = string.Format(queryString, FileName);
                            string urlQueryString = EncryptDecryptQueryString.Encrypt(fn, qsk);
                            ibtnPrint.Attributes.Add("OnClick", "return DisplayPDF('" + urlQueryString + "');");
                            ibtnDownload.Attributes.Add("OnClick", "return DwnloadPDF('" + urlQueryString + "');");
                        }
                        else
                        {
                            LblNoPdf.Visible     = true;
                            LblNoPrint.Visible   = true;
                            ibtnDownload.Visible = false;
                            ibtnPrint.Visible    = false;
                            LblNoPdf.ToolTip     = Constants.fileNotFound;
                            LblNoPrint.ToolTip   = Constants.fileNotFound;
                        }
                    }
                    else
                    {
                        LblNoPdf.Visible     = true;
                        LblNoPrint.Visible   = true;
                        ibtnDownload.Visible = false;
                        ibtnPrint.Visible    = false;
                        LblNoPdf.ToolTip     = Constants.fileNotFound;
                        LblNoPrint.ToolTip   = Constants.fileNotFound;
                    }
                }
                else
                {
                    LblNoPdf.Visible     = true;
                    LblNoPrint.Visible   = true;
                    ibtnDownload.Visible = false;
                    ibtnPrint.Visible    = false;
                    LblNoPdf.ToolTip     = Constants.fileNotFound;
                    LblNoPrint.ToolTip   = Constants.fileNotFound;
                }
            }
        }
Exemple #4
0
    public string EncryptQueryString(string strQueryString)
    {
        EncryptDecryptQueryString objEDQueryString = new EncryptDecryptQueryString();

        return(objEDQueryString.Encrypt(strQueryString, "r0b1nr0y"));
    }
Exemple #5
0
        /// <summary>
        /// Processes the response.
        /// </summary>
        /// <param name="msgResponse">The MSG response.</param>
        /// <remarks></remarks>
        private void ProcessResponseFromBillDesk(string msgResponse)
        {
            string           msg = msgResponse;
            BillDeskResponse BillDeskResponse = new BillDeskResponse(msg);

            try
            {
                string StartCardnumber1  = "";
                string EndCardnumber1    = "";
                string EncCardNumber     = "";
                string tranactionNumber  = "";
                double transactionAmount = 0;
                // string accountNumber = "";
                string BillDeskOnlineID        = "";
                string TxnRefrenceNo           = "";
                string retVal                  = "";
                bool   transactionUpdateStatus = false;
                string cardnumber              = CreditCardNumber.Decrypt(); // Added by Sahil on 22'Dec14
                if (cardnumber != "")
                {
                    // cardnumber = cardnumber.Decrypt();
                    StartCardnumber1 = cardnumber.Substring(0, 4);
                    if (cardnumber.Length == 16)
                    {
                        EndCardnumber1 = cardnumber.Substring(13, 3);
                    }
                }

                EncCardNumber = StartCardnumber1 + "XXXXXXXXX" + EndCardnumber1;



                string paymentStatus = BillDeskResponse.IsTransactionValid();
                tranactionNumber  = BillDeskResponse.CustomerID;
                transactionAmount = Convert.ToDouble(BillDeskResponse.TxtAmount);
                //accountNumber = BillDeskResponse.AdditionalInfo1; // Updated on 20-Jan-2015
                BillDeskOnlineID = BillDeskResponse.AdditionalInfo1;
                TxnRefrenceNo    = BillDeskResponse.TxnRefrenceNo;
                string BankRefNo  = BillDeskResponse.BankReferenceNo;
                string BankId     = BillDeskResponse.BankID;
                string AuthStatus = BillDeskResponse.AuthStatus;

                retVal = SaveCardHolderPaymentStatus(null, tranactionNumber, BillDeskOnlineID, transactionAmount,
                                                     TxnRefrenceNo, 2, paymentStatus, BankRefNo, BankId, AuthStatus); // Update the transaction in sql
                if (retVal != "")
                {
                    transactionUpdateStatus = true;
                }

                //if (paymentStatus.ToLower() != success)
                //{
                //    LoadPage();
                //    DisplayMessage(Constants.Error4, true);
                //    return;

                //}
                if (paymentStatus.ToLower() == success && transactionUpdateStatus == true)
                {
                    DisplayMessage("The payment of Rs." + transactionAmount + " for card number " + EncCardNumber + "has been processed successfully. The transaction reference number is " + tranactionNumber + ".Thank you for payment.", true);
                    divDisplayAll.Visible = false;
                    lkbRedirectToCardStatement.Visible = true;

                    btnPrint.Visible         = false;
                    btnPrintBillDesk.Visible = true;
                    string   dt        = DateTime.Now.ToString();
                    string   amt       = Convert.ToString(transactionAmount);
                    string   mode      = "Other Bank Net Banking";
                    string[] objParams = { tranactionNumber, dt, EncCardNumber, CardHolderName, amt, mode };

                    string fn             = string.Format(queryString, objParams);
                    string urlQueryString = EncryptDecryptQueryString.Encrypt(fn, qsk);
                    btnPrintBillDesk.Attributes.Add("OnClick", "return DisplaySlip('" + urlQueryString + "');");
                }
                else if (paymentStatus.ToLower() == success && transactionUpdateStatus == false)
                {
                    DisplayMessage(Constants.Error5 + " Your transaction number for further reference is : " + tranactionNumber, true);
                    divDisplayAll.Visible = false;
                    lkbRedirectToCardStatement.Visible = true;

                    btnPrint.Visible         = false;
                    btnPrintBillDesk.Visible = true;
                    string   dt        = DateTime.Now.ToString();
                    string   amt       = Convert.ToString(transactionAmount);
                    string   mode      = "Other Bank Net Banking";
                    string[] objParams = { tranactionNumber, dt, EncCardNumber, CardHolderName, amt, mode };

                    string fn             = string.Format(queryString, objParams);
                    string urlQueryString = EncryptDecryptQueryString.Encrypt(fn, qsk);
                    btnPrintBillDesk.Attributes.Add("OnClick", "return DisplaySlip('" + urlQueryString + "');");
                }
                else
                {
                    LoadPage();
                    DisplayMessage(paymentStatus, true);
                    lkbRedirectToCardStatement.Visible = false;
                    return;
                }
            }
            catch (Exception)
            {
                LoadPage();
                DisplayMessage(Constants.GeneralErrorMessage, true);
                //divDisplayAll.Visible = true;
                lkbRedirectToCardStatement.Visible = false;
                return;
            }
        }
Exemple #6
0
        /// <summary>
        /// Processes the response from bobibanking.
        /// </summary>
        /// <param name="msgResponse">The MSG response.</param>
        /// <remarks></remarks>
        //private void ProcessResponseFromBobibanking(string msgResponse)
        //{
        //    string rootFilePath = GetBobibankingKeyPath();
        //    string bobKeyFilePath = rootFilePath + Constants.bobibankingFileName.Trim();
        //    string msg = BobibankingEncryptionDecryption.Decrypt(msgResponse, bobKeyFilePath);
        //    var bobibankingResponse = new BobibankingResponse(msg);

        //    try
        //    {
        //        string StartCardnumber1 = "";
        //        string EndCardnumber1 = "";
        //        string EncCardNumber = "";
        //        double amount = 0;
        //        string PRN = string.Empty;
        //        string bid = string.Empty;
        //        string debtAccountNo = string.Empty;
        //        string itc = string.Empty;
        //        string retVal = string.Empty;
        //        bool transactionUpdateStatus = false;
        //        string accountNumber = CreditAccNumber; //changes by Sahil on 22'Dec14
        //        string cardnumber = CreditCardNumber.Decrypt(); // Added by Sahil on 22'Dec14
        //        if (cardnumber != "")
        //        {
        //            // cardnumber = cardnumber.Decrypt();
        //            StartCardnumber1 = cardnumber.Substring(0, 4);
        //            if (cardnumber.Length == 16)
        //                EndCardnumber1 = cardnumber.Substring(13, 3);
        //        }

        //        EncCardNumber = StartCardnumber1 + "XXXXXXXXX" + EndCardnumber1;


        //        string paymentStatus = bobibankingResponse.IsTransactionValid();
        //        amount = Convert.ToDouble(bobibankingResponse.AMT);
        //        if (bobibankingResponse.BID != null) bid = bobibankingResponse.BID;

        //        PRN = bobibankingResponse.PRN;
        //        debtAccountNo = bobibankingResponse.ACNT_NUM;
        //        itc = bobibankingResponse.ITC;


        //        retVal = SaveCardHolderPaymentStatusForBobibanking(null, PRN, accountNumber, amount, PID, bid, debtAccountNo, 2, paymentStatus);
        //        if (retVal != "")
        //            transactionUpdateStatus = true;

        //        //if (paymentStatus.ToLower() != success)
        //        //{
        //        //    LoadPage();
        //        //    //DisplayMessage(Constants.Error4, true);
        //        //    DisplayMessage(paymentStatus, true);
        //        //    return;
        //        //}

        //        if (paymentStatus.ToLower() == success && transactionUpdateStatus == true)
        //        {
        //            //DisplayMessage("For your card " + EncCardNumber + " having account number " + accountNumber.Decrypt() + ", Payment of Rs." + amount + " executed successfully.Your transaction number for further reference is : " + PRN + ".Thank you for payment.", true);
        //            DisplayMessage("The payment of Rs." + amount + " for card number " + EncCardNumber + "has been processed successfully. The transaction reference number is " + PRN + ".Thank you for payment.", true);
        //            divDisplayAll.Visible = false;
        //            lkbRedirectToCardStatement.Visible = true;
        //            btnPrint.Visible = true;
        //            btnPrintBillDesk.Visible = false;
        //            string dt = DateTime.Now.ToString();
        //            string amt = Convert.ToString(amount);
        //            string mode = "Bank of Baroda Net Banking";
        //            string[] objParams = { PRN, dt, EncCardNumber, CardHolderName, amt, mode };

        //            string fn = string.Format(queryString, objParams);
        //            string urlQueryString = EncryptDecryptQueryString.Encrypt(fn, qsk);
        //            btnPrint.Attributes.Add("OnClick", "return DisplaySlip('" + urlQueryString + "');");

        //        }
        //        else if (paymentStatus.ToLower() == success && transactionUpdateStatus == false)
        //        {
        //            DisplayMessage(Constants.Error5 + " Your transaction number for further reference is: " + PRN, true);
        //            divDisplayAll.Visible = false;
        //            lkbRedirectToCardStatement.Visible = true;
        //            btnPrint.Visible = true;
        //            btnPrintBillDesk.Visible = false;
        //            string dt = DateTime.Now.ToString();
        //            string amt = Convert.ToString(amount);
        //            string mode = "Bank of Baroda Net Banking";
        //            string[] objParams = { PRN, dt, EncCardNumber, CardHolderName, amt, mode };

        //            string fn = string.Format(queryString, objParams);
        //            string urlQueryString = EncryptDecryptQueryString.Encrypt(fn, qsk);
        //            btnPrint.Attributes.Add("OnClick", "return DisplaySlip('" + urlQueryString + "');");
        //        }
        //        else
        //        {
        //            LoadPage();
        //            DisplayMessage(paymentStatus, true);
        //            lkbRedirectToCardStatement.Visible = false;
        //            return;
        //        }

        //        //if (paymentStatus.ToLower() == success && retVal != "")
        //        //{
        //        //    System.Threading.Thread.Sleep(10000);
        //        //    CreateRequest(amount, "B");
        //        //}
        //    }
        //    catch (Exception)
        //    {
        //        LoadPage();
        //        DisplayMessage(Constants.GeneralErrorMessage, true);
        //        lkbRedirectToCardStatement.Visible = false;
        //        return;
        //    }
        //}


        private void ProcessResponseFromBobibankingNew(string msgResponse)
        {
            BOBSymmetricCipherHelper sch = new BOBSymmetricCipherHelper();
            string incom_data            = sch.getURLDecoded(msgResponse);
            string key = "29304E875832789229304E8758327892";

            try
            {
                string StartCardnumber1 = "";
                string EndCardnumber1   = "";
                string EncCardNumber    = "";
                double amount           = 0;
                string PRN                     = string.Empty;
                string bid                     = string.Empty;
                string PID                     = string.Empty;
                string debtAccountNo           = string.Empty;
                string ITC                     = string.Empty;
                string retVal                  = string.Empty;
                bool   transactionUpdateStatus = false;
                string BRN                     = string.Empty;
                string accountNumber           = CreditAccNumber; //changes by Sahil on 22'Dec14

                string cardnumber = CreditCardNumber.Decrypt();   // Added by Sahil on 22'Dec14

                if (cardnumber != "")
                {
                    // cardnumber = cardnumber.Decrypt();
                    StartCardnumber1 = cardnumber.Substring(0, 4);
                    if (cardnumber.Length == 16)
                    {
                        EndCardnumber1 = cardnumber.Substring(13, 3);
                    }
                }

                EncCardNumber = StartCardnumber1 + "XXXXXXXXX" + EndCardnumber1;


                byte[] inputStrBytes          = sch.decode(incom_data);
                String outp                   = Encoding.UTF8.GetString(Decrypt(inputStrBytes, GetRijndaelManaged(key)));
                var    bobibankingResponseNew = new BobibankingResponseNew(outp);

                string[] data        = outp.Split('&');
                string   strCheckSum = data[data.Length - 1].Split('=')[1];

                string hashgendata = data[0] + "&" + data[1] + "&" + data[2] + "&" + data[3] + "&" + data[4] + "&" + data[5] + "&" + data[6];

                string paymentStatus = bobibankingResponseNew.IsTransactionValidNew();



                amount        = Convert.ToDouble(bobibankingResponseNew.AMT);
                PRN           = data[2].Split('=')[1];
                debtAccountNo = data[6].Split('=')[1];
                ITC           = data[3].Split('=')[1];
                PID           = Constants.PID;
                BRN           = data[1].Split('=')[1];

                /// this is for Payment verification
                if (paymentStatus == "Success")
                {
                    paymentStatus = VerifyTranscation(bobibankingResponseNew.AMT, PRN, ITC, PID, BRN);
                }

                retVal = SaveCardHolderPaymentStatusForBobibanking(null, PRN, accountNumber, amount, PID, bid, debtAccountNo, 2, paymentStatus);
                if (retVal != "")
                {
                    transactionUpdateStatus = true;
                }

                if (paymentStatus.ToString() == "Success" && transactionUpdateStatus == true)
                {
                    DisplayMessage("The payment of Rs." + amount + " for card number " + EncCardNumber + "has been processed successfully. The transaction reference number is " + PRN + ".Thank you for payment.", true);
                    divDisplayAll.Visible = false;
                    lkbRedirectToCardStatement.Visible = true;
                    btnPrint.Visible         = true;
                    btnPrintBillDesk.Visible = false;
                    string   dt        = DateTime.Now.ToString();
                    string   amt       = Convert.ToString(amount);
                    string   mode      = "Bank of Baroda Net Banking";
                    string[] objParams = { PRN, dt, EncCardNumber, CardHolderName, amt, mode };

                    string fn             = string.Format(queryString, objParams);
                    string urlQueryString = EncryptDecryptQueryString.Encrypt(fn, qsk);
                    btnPrint.Attributes.Add("OnClick", "return DisplaySlip('" + urlQueryString + "');");
                }
                else if (paymentStatus.ToLower() == "Success" && transactionUpdateStatus == false)

                {
                    DisplayMessage(Constants.Error5 + " Your transaction number for further reference is: " + PRN, true);
                    divDisplayAll.Visible = false;
                    lkbRedirectToCardStatement.Visible = true;
                    btnPrint.Visible         = true;
                    btnPrintBillDesk.Visible = false;
                    string   dt        = DateTime.Now.ToString();
                    string   amt       = Convert.ToString(amount);
                    string   mode      = "Bank of Baroda Net Banking";
                    string[] objParams = { PRN, dt, EncCardNumber, CardHolderName, amt, mode };

                    string fn             = string.Format(queryString, objParams);
                    string urlQueryString = EncryptDecryptQueryString.Encrypt(fn, qsk);
                    btnPrint.Attributes.Add("OnClick", "return DisplaySlip('" + urlQueryString + "');");
                }
                else
                {
                    LoadPage();
                    if (paymentStatus == "InValidEmptyString")
                    {
                        paymentStatus = "InValid: Bobibanking Response Has Empty String. Please try again or contact Bank.";
                    }
                    else if (paymentStatus == "Invalidchecksum")
                    {
                        paymentStatus = "Invalid: " + "Payment not successful. Please try again or contact Bank.";
                    }
                    else if (paymentStatus == "Cancelled")
                    {
                        paymentStatus = "Bobibanking transaction is cancelled due to some reason.Please try again or contact Bank.";
                    }
                    DisplayMessage(paymentStatus, true);
                    lkbRedirectToCardStatement.Visible = false;
                    return;
                }
            }



            catch (Exception ex)
            { }
        }
 public string EncryptQueryString(string strQueryString)
 {
     EncryptDecryptQueryString objEDQueryString = new EncryptDecryptQueryString();
     return objEDQueryString.Encrypt(strQueryString, "r0b1nr0y");
 }