Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                logger.Debug("------------- wapPayment4APP Vietnamobile ------------------");
                DesSecurity des = new DesSecurity();
                try
                {
                    string cipher     = ConvertUtility.ToString(Request.QueryString["link"]);
                    string price      = string.Empty;
                    string msisdn     = string.Empty;
                    string itemid     = string.Empty;
                    string itemtype   = string.Empty;
                    string itemdetail = string.Empty;
                    string partnerid  = string.Empty;
                    MobileUtils.GetDetailAppUrl(des.Des3Decrypt(cipher, ConfigurationSettings.AppSettings.Get("msisdnkey")), ref partnerid, ref price, ref itemid, ref itemtype, ref itemdetail);

                    //Kiểm tra Vinaphone
                    string alertMessage = string.Empty;

                    int is3g = 0;
                    //string msisdn = MobileUtils.GetMSISDN(out is3g);
                    msisdn = MobileUtils.GetMSISDN(out is3g);

                    logger.Debug("msisdn=" + msisdn);
                    //Nhận diện được MSISDN >> form xác thực yêu cầu thanh toán
                    if (!string.IsNullOrEmpty(msisdn) && MobileUtils.CheckOperator(msisdn, "vietnammobile"))
                    {
                        Session["_price"]      = price;
                        Session["_msisdn"]     = msisdn;
                        Session["_itemid"]     = itemid;
                        Session["_itemtype"]   = itemtype;
                        Session["_itemdetail"] = itemdetail;
                        Session["_partnerid"]  = partnerid;
                        ltrMSISDN.Text         = "Xin chào " + msisdn + "<br /><b>Nạp VKIM</b>";
                        ltrTB.Text             = "Phí nạp VKIM là " + price + " đồng. Vui lòng xác nhận để thực hiện giao dịch.";
                        pnlXacnhan.Visible     = true;
                    }
                    else
                    {
                        Response.Redirect("http://payment.xzone.vn/atc.aspx?link=END", false);
                        HttpContext.Current.ApplicationInstance.CompleteRequest();
                    }
                }
                catch (Exception ex)
                {
                    logger.Debug("Exception=" + ex.ToString());
                    Response.Redirect("http://payment.xzone.vn/atc.aspx?link=END", false);
                    HttpContext.Current.ApplicationInstance.CompleteRequest();
                }
            }
        }