Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string sRes = TenPayBuy.TenPaySubmit(Context);

            if (sRes != "0")
            {
                Response.Write(sRes);
            }
        }
Exemplo n.º 2
0
 public void ProcessRequest(HttpContext context)
 {
     if (context.Request.HttpMethod == "POST")
     {
         string sFromHost = context.Request.UrlReferrer.Host;
         context.Response.Cookies["fromhost"].Value   = sFromHost;
         context.Response.Cookies["fromhost"].Expires = DateTime.Now.AddHours(1);
         string sAccount = CYRequest.GetFormString("bankaccount");  //充值账号
         string sPhone   = CYRequest.GetFormString("bankphonenum");
         string sPayNums = CYRequest.GetFormString("bankpayprice"); //充值金额
         int    iUserID  = UserBll.UserIDSel(sAccount);
         if (iUserID < 1000)
         {
             context.Response.Write("<script>alert('充值账号不存在!');</script>");
             return;
         }
         else
         {
             decimal dPrice = 0;
             decimal.TryParse(sPayNums, out dPrice);
             if (dPrice < 10)
             {
                 context.Response.Redirect("PayPErr.aspx?err=204");
                 return;
             }
             string sChannel  = CYRequest.GetFormString("bankchannel");
             string sBankName = string.Empty;
             if (sChannel == "ibank")
             {
                 sBankName = CYRequest.GetFormString("bankname");
             }
             int    iCount     = 1;
             string sPayDirect = string.Empty;
             if (sChannel == "tenpay")
             {
                 sPayDirect = TenPayBuy.PayBegin(sChannel, sPhone, sAccount, dPrice, iCount, context);
             }
             else if (sChannel == "szfphone")
             {
                 string cardTypeCombine = CYRequest.GetString("cardTypeCombine");
                 sPayDirect = SzfPayBuy.PayBegin(sChannel, sPhone, sAccount, dPrice, iCount, "0", cardTypeCombine);
             }
             else
             {
                 sPayDirect = PayAll.CreatePay(sChannel, sPhone, sAccount, dPrice, iCount, sBankName);
             }
             context.Response.Write(sPayDirect);
             return;
         }
     }
 }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string sRes = TenPayBuy.QuickTenPaySubmit(Context);

            //StringBuilder sbText = new StringBuilder();
            //sbText.Append(Server.MapPath("~/Log"));
            //sbText.Append("/Pay");
            //string sPath = sbText.ToString();
            //ProvideCommon pcObject = new ProvideCommon();
            //sbText.Remove(0, sbText.Length);
            //sbText.AppendFormat("{0},{1},{2}", Request.Url.ToString(), DateTime.Now.ToString(), sRes);
            //pcObject.WriteLogFile(sPath, "QuickTenCallback", sbText.ToString());

            StringBuilder sbHtml = new StringBuilder();

            switch (sRes)
            {
            case "0":
                break;

            case "-1":
                sbHtml.Append("<html><head><script language=\"javascript\">");
                sbHtml.Append("alert('支付失败');");
                sbHtml.Append("</script></head><body></body></html>");
                Response.Write(sbHtml.ToString());
                break;

            case "-2":
                sbHtml.Append("<html><head><script language=\"javascript\">");
                sbHtml.Append("alert('认证签名失败');");
                sbHtml.Append("</script></head><body></body></html>");
                Response.Write(sbHtml.ToString());
                break;

            case "-3":
                sbHtml.Append("<html><head><meta name=\"TENCENT_ONLINE_PAYMENT\" content=\"China TENCENT\"><script language=\"javascript\">");
                sbHtml.Append("alert('武林币充值成功!游戏充值失败!请进入武林币兑换页面进行兑换!');");
                sbHtml.AppendFormat("window.location.href='{0}';", "default.aspx");
                sbHtml.Append("</script></head><body></body></html>");
                Response.Write(sbHtml.ToString());
                break;

            default:
                Response.Write(sRes);
                break;
            }
        }
Exemplo n.º 4
0
        public void ProcessRequest(HttpContext context)
        {
            if (context.Request.HttpMethod == "POST")
            {
                string sFromHost = context.Request.UrlReferrer.Host;
                context.Response.Cookies["fromhost"].Value   = sFromHost;
                context.Response.Cookies["fromhost"].Expires = DateTime.Now.AddHours(1);
                string sAccount = CYRequest.GetFormString("quickaccount");//充值账号
                int    iUserID  = UserBll.UserIDSel(sAccount);
                if (iUserID < 1000)
                {
                    context.Response.Write("<script>alert('充值账号不存在!');</script>");
                    return;
                }

                string  sPayNums = CYRequest.GetFormString("quickpayprice");//充值金额
                decimal dPrice   = 0;
                decimal.TryParse(sPayNums, out dPrice);
                if (dPrice < 10)
                {
                    context.Response.Redirect("PayPErr.aspx?err=204");
                    return;
                }

                string sGameAbbre   = CYRequest.GetFormString("quickservername");
                string sGameIsLogin = PayAll.ValUserLoginGame(sGameAbbre, iUserID.ToString());
                if ("1" == sGameIsLogin)
                {
                    context.Response.Redirect("PayGErr.aspx?err=202");
                    return;
                }

                string sGameAbbreC = string.Empty;
                if (sGameAbbre.IndexOf("sq") == -1)
                {
                    sGameAbbreC = sGameAbbre;
                }
                else
                {
                    string sRoleID = CYRequest.GetFormString("quickrole");
                    sGameAbbreC = string.Format("{0}|{1}", sGameAbbre, sRoleID);
                }
                string sPhone    = CYRequest.GetFormString("quickphone");
                string sChannel  = CYRequest.GetFormString("quickchannel");
                int    iCount    = 1;
                string sBankName = string.Empty;
                if (sChannel == "ibank")
                {
                    sBankName = CYRequest.GetFormString("quickbank");
                }
                string sPayDirect = string.Empty;
                if (sChannel == "tenpay")
                {
                    string  sTranIP     = ProvideCommon.GetRealIP();
                    string  sPTranID    = TransPBLL.PointSalesInit(sChannel, sPhone, sAccount, dPrice, iCount, sTranIP);
                    decimal dFeeScale   = ChannelBLL.FeeScaleSel(sChannel);
                    int     iGamePoints = System.Convert.ToInt32(dPrice * 10 * dFeeScale);
                    int     iPayUserID  = UserBll.UserIDSel(sAccount);
                    string  sGTranID    = TransGBLL.GameSalesInit(sGameAbbre, iGamePoints, sAccount, sPhone, iPayUserID, sTranIP);
                    TranQuickBLL.TranQuickAdd(sGTranID, sPTranID);
                    sPayDirect = TenPayBuy.QuickPayBegin(sPTranID, sAccount, dPrice, sGameAbbreC, context);
                }
                else if (sChannel == "szfphone")
                {
                    string  sTranIP     = ProvideCommon.GetRealIP();
                    string  sPTranID    = TransPBLL.PointSalesInit(sChannel, sPhone, sAccount, dPrice, iCount, sTranIP);
                    decimal dFeeScale   = ChannelBLL.FeeScaleSel(sChannel);
                    int     iGamePoints = System.Convert.ToInt32(dPrice * 10 * dFeeScale);
                    int     iPayUserID  = UserBll.UserIDSel(sAccount);
                    string  sGTranID    = TransGBLL.GameSalesInit(sGameAbbre, iGamePoints, sAccount, sPhone, iPayUserID, sTranIP);
                    TranQuickBLL.TranQuickAdd(sGTranID, sPTranID);
                    string cardTypeCombine = CYRequest.GetFormString("quickcardTypeCombine");
                    sPayDirect = SzfPayBuy.QuickPayBegin(sPTranID, sAccount, dPrice, sGameAbbreC, "0", cardTypeCombine);
                }
                else
                {
                    sPayDirect = PayAll.QuickPay(sChannel, sPhone, sAccount, dPrice, iCount, sBankName, sGameAbbreC);
                }
                context.Response.Write(sPayDirect);
            }
        }