protected void Page_Load(object sender, EventArgs e) { //直接跳转游戏 if (!Page.IsPostBack) { string sGameName = CYRequest.GetString("gn"); if (sGameName.Length < 2) { Response.Redirect(string.Format("http://www.dao50.com/yxzx/?gn={0}", sGameName), false); } else if (LoginSessionVal() || isLoginCookie()) { int iUserID = GetUserID(); string sUserID = string.Empty; string sAccount = GetAccount(); if (!ValUserState(iUserID, sAccount)) { iUserID = UserBll.UserIDSel(sAccount); if (iUserID < 1000 || (!ValUserState(iUserID, sAccount))) { //Response.Write(string.Format("<script>alert('用户名:{2}与数字ID:{3}不一致,请重新登录!谢谢!');location.href='{0}/Default.aspx?gn={1}';</script>", sRootUrl, sGameName, sAccount, iUserID)); ClearUsersInfo(); return; } } string sUserIP = ProvideCommon.GetRealIP(); if (!ProvideCommon.GameIPVal(sUserIP)) { return; } string sStartTime = DateTime.Now.ToString(); string sEndTime = ServerBLL.ServerTimeSel(sGameName); string sGame = GameInfoBLL.GameInfoAbbreSel(sGameName).TrimEnd(); sUserID = iUserID.ToString(); if (!ProvideCommon.valTime(sStartTime, sEndTime)) { if (!UserBll.AdminUserVal(iUserID)) { string sWUrl = WebConfig.BaseConfig.sWUrl; Response.Redirect(string.Format("{0}/jjkf", sWUrl), true); return; } } else if (sGame == "dxz") { int iAddDay = 15;//过期时间 if (!ProvideCommon.SeverTimeVal(sEndTime, iAddDay) && !TransPBLL.UserIsTranVal(iUserID) && !dxzGame.GameisLoginVal(sUserID, sGameName)) { //Response.Write(dxzGame.GameisLoginTest(sUserID,sGameName)); return; } } switch (sGame) { case "lj": sUrl = ljGame.Login(sUserID, sGameName); break; case "yjxy": sUrl = yjxyGame.Login(sUserID, sGameName); break; case "sq": sUrl = sqGame.Login(sUserID, sGameName, false); break; case "dxz": sUrl = dxzGame.Login(sUserID, sGameName); break; case "djj": sUrl = djjGame.Login(sUserID, sGameName); break; case "txj": sUrl = txjGame.Login(sUserID, sGameName); break; case "sjsg": sUrl = sjsgGame.Login(sUserID, sGameName); break; case "tzcq": sUrl = tzcqGame.Login(sUserID, sGameName); break; case "by": sUrl = byGame.Login(sUserID, sGameName); break; case "swjt": sUrl = swjtGame.Login(sUserID, sGameName); break; case "gcld": sUrl = gcldGame.Login(sUserID, sGameName); break; case "khbd": sUrl = khbdGame.Login(sUserID, sGameName); break; case "hyjft": sUrl = hyjftGame.Login(sUserID, sGameName); break; case "nslm": sUrl = nslmGame.Login(sUserID, sGameName); break; case "dtgzt": sUrl = tgztGame.Login(sUserID, sGameName); break; case "mhxy": sUrl = mhxyGame.Login(sUserID, sGameName); break; case "qxz": sUrl = qxzGame.Login(sUserID, sGameName); break; case "qszg": sUrl = qszgGame.Login(sUserID, sGameName); break; case "wwsg": sUrl = wwsgGame.Login(sUserID, sGameName); break; case "dntg": sUrl = dntgGame.Login(sUserID, sGameName, ""); break; case "jy": sUrl = jyGame.Login(sUserID, sGameName, ""); break; case "sskc": sUrl = sskcGame.Login(sUserID, sGameName, ""); break; case "ktpd": sUrl = ktpdGame.Login(sUserID, sGameName, "", ""); break; case "mhtj": sUrl = mhtjGame.Login(sUserID, sGameName, ""); break; case "jjp": sUrl = jjpGame.Login(sUserID, sGameName); break; case "sgyjz": if (sAccount.IndexOf("banhaotest") < 0 && sGameName == "sgyjz999") { sUrl = ""; } else { string fcm = string.Empty; string sfcmAccount = "banhaotest1|banhaotest2|banhaotest3|banhaotest9|banhaotest10"; if (sfcmAccount.IndexOf(sAccount) > -1) { fcm = "0"; } else { fcm = "2"; } sUrl = sgyjzGame.Login(sUserID, sGameName, fcm); } break; case "dtgzter": sUrl = tgzt2Game.Login(sUserID, sGameName); break; case "zwx": sUrl = zwxGame.Login(sUserID, sGameName); break; default: sUrl = string.Format("{0}|{1}|{2}", sGameName, sGame, sUserID); break; } if (sUrl.Length > 5 && sUrl.IndexOf("http") > -1) { if (GameLogin(sGameName)) { GameLoginBLL.GameLoginAdd(iUserID, sGameName, ProvideCommon.GetRealIP(), sUrl); } Response.Redirect(sUrl, true); } else { Response.Redirect(string.Format("http://www.dao50.com/fwqwh/?url={0}", Server.UrlEncode(sUrl)), true); } } } }
protected void Page_Load(object sender, EventArgs e) { SortedDictionary <string, string> sPara = GetRequestGet(); if (sPara.Count > 0)//判断是否有带返回参数 { Notify aliNotify = new Notify(); bool verifyResult = aliNotify.Verify(sPara, Request.QueryString["notify_id"], Request.QueryString["sign"]); if (verifyResult)//验证成功 { ///////////////////////////////////////////////////////////////////////////////////////////////////////////// //请在这里加上商户的业务逻辑程序代码 //——请根据您的业务逻辑来编写程序(以下代码仅作参考)—— //获取支付宝的通知返回参数,可参考技术文档中页面跳转同步通知参数列表 //string subject = Request.QueryString["subject"]; //商品名称、订单名称 //string trade_no = Request.QueryString["trade_no"]; //支付宝交易号 //string buyer_email = Request.QueryString["buyer_email"]; //买家支付宝账号 string order_no = Request.QueryString["out_trade_no"]; //获取订单号 string total_fee = Request.QueryString["total_fee"]; //获取总金额 string body = Request.QueryString["body"]; //商品描述、订单备注、描述 string trade_status = Request.QueryString["trade_status"]; //交易状态 string extra_common_param = Request.QueryString["extra_common_param"]; //商户回传参数 string sTranIP = ProvideCommon.GetRealIP(); string sFromUrl = Request.Url.ToString(); char cTranFrom = 't'; LastOfPayPointBLL.Add(sTranIP, cTranFrom, sFromUrl, order_no); if (trade_status == "TRADE_FINISHED" || trade_status == "TRADE_SUCCESS") { int iLen = extra_common_param.Split('|').Length; string sAccount = extra_common_param.Split('|')[0];//获取充值人账户 decimal dPrice = Convert.ToDecimal(total_fee); int j = TransPBLL.PointSalesCommit(order_no, sAccount, dPrice); //确认返回信息无误后提交此定单 if (j == 0) { //游戏直冲 if (iLen > 1) { TranQuickBLL.TranQuickUpdateP(order_no); string sGTranID = TranQuickBLL.TranQuickGTranIDSel(order_no); string sGame = extra_common_param.Split('|')[1]; string sGTRes = string.Empty; if (sGame.IndexOf("sq") == -1) { sGTRes = PayAll.GameQuickPay(sGame, sAccount, dPrice, sGTranID); } else { string sRoleID = extra_common_param.Split('|')[2]; sGTRes = PayAll.sqQuickPay(sGame, sAccount, dPrice, sGTranID, sRoleID); } if (sGTRes == "0") //游戏兑换成功 { TranQuickBLL.TranQuickUpdateG(sGTranID); Response.Redirect(string.Format("PayGSucc.aspx?TranID={0}&gn={1}&type=q", sGTranID, sGame), false); } else { //sMsg = "<script>alert('充值武林币成功!游戏兑换失败!如有问题请与客服联系!');</script>"; Response.Redirect(string.Format("PayPErr.aspx?err=102>res={0}", sGTRes)); } } else if (1 == iLen) { Response.Redirect(string.Format("PayPSucc.aspx?TranID={0}", order_no)); //转向银行卡支付成功页面 } else { Response.Write(iLen); } } else { if (6 == j) { if (iLen > 1) { string sQuickState = TranQuickBLL.TransQuickStateSelByP(order_no); string sGTranID = TranQuickBLL.TranQuickGTranIDSel(order_no); string sGame = extra_common_param.Split('|')[1]; if (sQuickState == "2") { Response.Redirect(string.Format("PayGSucc.aspx?TranID={0}&gn={1}&type=q", sGTranID, sGame), false); } else if (sQuickState == "1") { string sGTRes = string.Empty; if (sGame.IndexOf("sq") == -1) { sGTRes = PayAll.GameQuickPay(sGame, sAccount, dPrice, sGTranID); } else { string sRoleID = extra_common_param.Split('|')[2]; sGTRes = PayAll.sqQuickPay(sGame, sAccount, dPrice, sGTranID, sRoleID); } if (sGTRes == "0") //游戏兑换成功 { TranQuickBLL.TranQuickUpdateG(sGTranID); Response.Redirect(string.Format("PayGSucc.aspx?TranID={0}&gn={1}&type=q", sGTranID, sGame), false); } else { //sMsg = "<script>alert('充值武林币成功!游戏兑换失败!如有问题请与客服联系!');</script>"; Response.Redirect(string.Format("PayPErr.aspx?err=102>res={0}", sGTRes)); } } } else if (1 == iLen) { Response.Redirect(string.Format("PayPSucc.aspx?TranID={0}", order_no)); } else { Response.Write(iLen); } } else { //sMsg = "<script>alert('订单提交失败!如有问题请与客服联系!');</script>"; Response.Redirect("PayPErr.aspx?err=101"); } } } else { //sMsg = "<script>alert('交易没有成功!如有问题请与客服联系!');</script>"; Response.Redirect("PayPErr.aspx?err=111"); } } else//验证失败 { //sMsg = "<script>alert('验证失败!如有问题请与客服联系!');</script>"; Response.Redirect("PayPErr.aspx?err=104"); } } else { //sMsg = "<script>alert('无返回参数!如有问题请与客服联系!');</script>"; Response.Redirect("PayPErr.aspx?err=103"); } }
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); } }
protected void Page_Load(object sender, EventArgs e) { string lbVersion = CYRequest.GetString("version"); //版本号 string lbMerId = CYRequest.GetString("merId"); //商户ID string lbPayMoney = CYRequest.GetString("payMoney"); //支付金额 string lbOrderId = CYRequest.GetString("orderId"); //订单号 string lbPayResult = CYRequest.GetString("payResult"); //支付结果 string lbPrivateField = CYRequest.GetString("privateField"); string lbPayDetails = CYRequest.GetString("payDetails"); string lbMd5String = CYRequest.GetString("md5String"); //MD5校验串 string lbSignString = CYRequest.GetString("signString"); //神州付支付系统对md5加密后的32位字符串(md5String)进行签名。 /* * MD5校验 * md5String =md5(version+merId+payMoney+orderId+payResult+privateField+payDetails+privateKey) */ StringBuilder sbText = new StringBuilder(); sbText.Append(lbVersion); sbText.Append(lbMerId); sbText.Append(lbPayMoney); sbText.Append(lbOrderId); sbText.Append(lbPayResult); sbText.Append(lbPrivateField); sbText.Append(lbPayDetails); sbText.Append(SzfPayBuy.GetKey()); String md5 = ProvideCommon.MD5(sbText.ToString()).ToLower(); if (md5.Equals(lbMd5String)) { if (SzfPayBuy.veriSig(md5, lbSignString)) { if ("1".Equals(lbPayResult)) { //支付成功 int iLen = lbPrivateField.Split('|').Length; string sAccount = lbPrivateField.Split('|')[0]; //获取充值人账户 decimal dPrice = Convert.ToDecimal(lbPayMoney) / 100; int j = TransPBLL.PointSalesCommit(lbOrderId, sAccount, dPrice); //确认返回信息无误后提交此定单 if (j == 0) { //游戏直冲 if (iLen > 1) { TranQuickBLL.TranQuickUpdateP(lbOrderId); string sGTranID = TranQuickBLL.TranQuickGTranIDSel(lbOrderId); string sGame = lbPrivateField.Split('|')[1]; int iChannelID = TransPBLL.TranPSelChannelIDByID(lbOrderId); dPrice = dPrice * ChannelBLL.FeeScaleSelByID(iChannelID); string sGTRes = string.Empty; if (sGame.IndexOf("sq") == -1) { sGTRes = PayAll.GameQuickPay(sGame, sAccount, dPrice, sGTranID); } else { string sRoleID = lbPrivateField.Split('|')[2]; sGTRes = PayAll.sqQuickPay(sGame, sAccount, dPrice, sGTranID, sRoleID); } if (sGTRes == "0") //游戏兑换成功 { TranQuickBLL.TranQuickUpdateG(sGTranID); } } } } Response.Write(lbOrderId); } } else { Response.Write("验证失败"); } }
protected void Page_Load(object sender, EventArgs e) { string partnerTradeId = CYRequest.GetString("partnerTradeId"); // 商户订单号 string state = CYRequest.GetString("state"); //支付状态 string signType = CYRequest.GetString("signType"); string tradeMoney = CYRequest.GetString("tradeMoney"); string successMoney = CYRequest.GetString("successMoney"); // 实际支付金额 string tradeId = CYRequest.GetString("tradeId"); // 支付中心订单号 string bankCode = CYRequest.GetString("bankCode"); // 支付银行 string tradeSuccessTime = CYRequest.GetString("tradeSuccessTime"); //订单成功时间 string productName = CYRequest.GetString("productName"); //商品名称 string productUrl = CYRequest.GetString("productUrl"); //商品url string remark = CYRequest.GetString("remark"); //备注 string sign = CYRequest.GetString("sign"); //加密串 StringBuilder sbText = new StringBuilder(); sbText.AppendFormat("{0}|", partnerTradeId); sbText.AppendFormat("{0}|", state); sbText.AppendFormat("{0}|", signType); sbText.AppendFormat("{0}|", tradeMoney); sbText.AppendFormat("{0}|", successMoney); sbText.AppendFormat("{0}|", tradeId); sbText.AppendFormat("{0}|", bankCode); sbText.AppendFormat("{0}|", tradeSuccessTime); sbText.AppendFormat("{0}|", productName); sbText.AppendFormat("{0}|", productUrl); sbText.AppendFormat("{0}|", remark); sbText.Append(QdbPayBuy.GetKey()); string md5 = QdbPayBuy.GetMD5(sbText.ToString(), "gb2312").ToUpper(); if (md5.Equals(sign)) { if ("1".Equals(state)) { //支付成功 int iLen = remark.Split('|').Length; string sAccount = remark.Split('|')[1];//获取充值人账户 decimal dPrice = Convert.ToDecimal(successMoney); string lbOrderId = string.Format("{0}{1}", partnerTradeId, remark.Split('|')[0]); int j = TransPBLL.PointSalesCommit(lbOrderId, sAccount, dPrice); //确认返回信息无误后提交此定单 if (j == 0) { //游戏直冲 if (iLen > 2) { TranQuickBLL.TranQuickUpdateP(lbOrderId); string sGTranID = TranQuickBLL.TranQuickGTranIDSel(lbOrderId); string sGame = remark.Split('|')[2]; dPrice = (dPrice * 95) / 100; string sGTRes = string.Empty; if (sGame.IndexOf("sq") == -1) { sGTRes = PayAll.GameQuickPay(sGame, sAccount, dPrice, sGTranID); } else { string sRoleID = remark.Split('|')[3]; sGTRes = PayAll.sqQuickPay(sGame, sAccount, dPrice, sGTranID, sRoleID); } if (sGTRes == "0") //游戏兑换成功 { TranQuickBLL.TranQuickUpdateG(sGTranID); Response.Write("0"); } else { Response.Write("5"); } } else { Response.Write("4"); } } else { Response.Write("3"); } } else { Response.Write("2"); } } else { Response.Write(string.Format("1|{0}:{1}", sign, md5)); } }
protected void Page_Load(object sender, EventArgs e) { SortedDictionary <string, string> sPara = GetRequestPost(); //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); //foreach(KeyValuePair<string,string> kvpForm in sPara) //{ // sbText.Append(string.Format("{0}={1} ",kvpForm.Key,kvpForm.Value)); //} //string sFormUrl = sbText.ToString(); //sbText.Remove(0,sbText.Length); //sbText.AppendFormat("{0},{1}", sFormUrl, DateTime.Now.ToString()); //pcObject.WriteLogFile(sPath, "PayAliNotify", sbText.ToString()); if (sPara.Count > 0)//判断是否有带返回参数 { Notify aliNotify = new Notify(); bool verifyResult = aliNotify.Verify(sPara, Request.Form["notify_id"], Request.Form["sign"]); if (verifyResult)//验证成功 { ///////////////////////////////////////////////////////////////////////////////////////////////////////////// //请在这里加上商户的业务逻辑程序代码 //——请根据您的业务逻辑来编写程序(以下代码仅作参考)—— //获取支付宝的通知返回参数,可参考技术文档中服务器异步通知参数列表 //string trade_no = Request.Form["trade_no"]; //支付宝交易号 //string buyer_email = Request.Form["buyer_email"]; //买家支付宝账号 string order_no = Request.Form["out_trade_no"]; //获取订单号 string total_fee = Request.Form["total_fee"]; //获取总金额 string subject = Request.Form["subject"]; //商品名称、订单名称 string body = Request.Form["body"]; //商品描述、订单备注、描述 string trade_status = Request.Form["trade_status"]; //交易状态 string extra_common_param = Request.Form["extra_common_param"]; //商户回传参数 string sTranIP = ProvideCommon.GetRealIP(); string sFromUrl = Request.Url.ToString(); char cTranFrom = 'y'; LastOfPayPointBLL.Add(sTranIP, cTranFrom, sFromUrl, order_no); if (trade_status == "TRADE_FINISHED" || trade_status == "TRADE_SUCCESS") { //判断该笔订单是否在商户网站中已经做过处理(可参考“集成教程”中“3.4返回数据处理”) //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序 //如果有做过处理,不执行商户的业务程序 string sAccount = extra_common_param.Split('|')[0];//获取充值人账户 decimal dPrice = Convert.ToDecimal(total_fee); int iLen = extra_common_param.Split('|').Length; int j = TransPBLL.PointSalesCommit(order_no, sAccount, dPrice); //确认返回信息无误后提交此定单 if (j == 0) { if (iLen > 1) { //游戏直冲 TranQuickBLL.TranQuickUpdateP(order_no); string sGTranID = TranQuickBLL.TranQuickGTranIDSel(order_no); string sGame = extra_common_param.Split('|')[1]; string sGTRes = string.Empty; if (sGame.IndexOf("sq") == -1) { sGTRes = PayAll.GameQuickPay(sGame, sAccount, dPrice, sGTranID); } else { if (extra_common_param.Split('|').Length > 2) { string sRoleID = extra_common_param.Split('|')[2]; sGTRes = PayAll.sqQuickPay(sGame, sAccount, dPrice, sGTranID, sRoleID); } } if (sGTRes == "0") //游戏兑换成功 { TranQuickBLL.TranQuickUpdateG(sGTranID); } } } Response.Write("success"); //请不要修改或删除 } else { Response.Write("success"); //其他状态判断。普通即时到帐中,其他状态不用判断,直接打印success。有问题,这里需要判断吗? } } else//验证失败 { Response.Write("fail"); } } else { Response.Write("无通知参数"); } }
protected void Page_Load(object sender, EventArgs e) { string lbVersion = CYRequest.GetString("version"); //版本号 string lbMerId = CYRequest.GetString("merId"); //商户ID string lbPayMoney = CYRequest.GetString("payMoney"); //支付金额 string lbOrderId = CYRequest.GetString("orderId"); //订单号 string lbPayResult = CYRequest.GetString("payResult"); //支付结果 string lbPrivateField = CYRequest.GetString("privateField"); string lbPayDetails = CYRequest.GetString("payDetails"); string lbMd5String = CYRequest.GetString("md5String"); //MD5校验串 string lbSignString = CYRequest.GetString("signString"); //神州付支付系统对md5加密后的32位字符串(md5String)进行签名。 /* * MD5校验 * md5String =md5(version+merId+payMoney+orderId+payResult+privateField+payDetails+privateKey) */ StringBuilder sbText = new StringBuilder(); sbText.Append(lbVersion); sbText.Append(lbMerId); sbText.Append(lbPayMoney); sbText.Append(lbOrderId); sbText.Append(lbPayResult); sbText.Append(lbPrivateField); sbText.Append(lbPayDetails); sbText.Append(SzfPayBuy.GetKey()); String md5 = ProvideCommon.MD5(sbText.ToString()).ToLower(); if (md5.Equals(lbMd5String)) { if (SzfPayBuy.veriSig(md5, lbSignString)) { if ("1".Equals(lbPayResult)) { //支付成功 int iLen = lbPrivateField.Split('|').Length; string sAccount = lbPrivateField.Split('|')[0]; //获取充值人账户 decimal dPrice = Convert.ToDecimal(lbPayMoney) / 100; int j = TransPBLL.PointSalesCommit(lbOrderId, sAccount, dPrice); //确认返回信息无误后提交此定单 if (j == 0) { //游戏直冲 if (iLen > 1) { TranQuickBLL.TranQuickUpdateP(lbOrderId); string sGTranID = TranQuickBLL.TranQuickGTranIDSel(lbOrderId); int iChannelID = TransPBLL.TranPSelChannelIDByID(lbOrderId); dPrice = dPrice * ChannelBLL.FeeScaleSelByID(iChannelID); string sGame = lbPrivateField.Split('|')[1]; string sGTRes = string.Empty; if (sGame.IndexOf("sq") == -1) { sGTRes = PayAll.GameQuickPay(sGame, sAccount, dPrice, sGTranID); } else { string sRoleID = lbPrivateField.Split('|')[2]; sGTRes = PayAll.sqQuickPay(sGame, sAccount, dPrice, sGTranID, sRoleID); } if (sGTRes == "0") //游戏兑换成功 { TranQuickBLL.TranQuickUpdateG(sGTranID); Response.Redirect(string.Format("PayGSucc.aspx?TranID={0}&gn={1}&type=q", sGTranID, sGame), false); } else { //sMsg = "<script>alert('充值武林币成功!游戏兑换失败!如有问题请与客服联系!');</script>"; Response.Redirect(string.Format("PayPErr.aspx?err=102>res={0}", sGTRes)); } } else if (1 == iLen) { Response.Redirect(string.Format("PayPSucc.aspx?TranID={0}", lbOrderId)); //转向银行卡支付成功页面 } } else { if (6 == j) { if (iLen > 1) { string sQuickState = TranQuickBLL.TransQuickStateSelByP(lbOrderId); string sGTranID = TranQuickBLL.TranQuickGTranIDSel(lbOrderId); string sGame = lbPrivateField.Split('|')[1]; if (sQuickState == "2") { Response.Redirect(string.Format("PayGSucc.aspx?TranID={0}&gn={1}&type=q", sGTranID, sGame), false); } else if (sQuickState == "1") { int iChannelID = TransPBLL.TranPSelChannelIDByID(lbOrderId); dPrice = dPrice * ChannelBLL.FeeScaleSelByID(iChannelID); string sGTRes = string.Empty; if (sGame.IndexOf("sq") == -1) { sGTRes = PayAll.GameQuickPay(sGame, sAccount, dPrice, sGTranID); } else { string sRoleID = lbPrivateField.Split('|')[2]; sGTRes = PayAll.sqQuickPay(sGame, sAccount, dPrice, sGTranID, sRoleID); } if (sGTRes == "0") //游戏兑换成功 { TranQuickBLL.TranQuickUpdateG(sGTranID); Response.Redirect(string.Format("PayGSucc.aspx?TranID={0}&gn={1}&type=q", sGTranID, sGame), false); } else { //sMsg = "<script>alert('充值武林币成功!游戏兑换失败!如有问题请与客服联系!');</script>"; Response.Redirect(string.Format("PayPErr.aspx?err=102>res={0}", sGTRes)); } } } else { Response.Redirect(string.Format("PayPSucc.aspx?TranID={0}", lbOrderId)); } } else { //sMsg = "<script>alert('订单提交失败!如有问题请与客服联系!');</script>"; Response.Redirect("PayPErr.aspx?err=101"); } } } else { //支付失败 //sMsg = "<script>alert('支付失败!如有问题请与客服联系!');</script>"; Response.Redirect("PayPErr.aspx?err=104"); } } } else { //sMsg = "<script>alert('验证失败!如有问题请与客服联系!');</script>"; Response.Redirect("PayPErr.aspx?err=103"); } }
protected string PTransUser(int iUserID, int iPage, int iNum) { return(TransPBLL.UserTranSelByUID(iUserID, iPage, iNum)); }
protected void Page_Load(object sender, EventArgs e) { string partnerTradeId = CYRequest.GetString("partnerTradeId"); // 商户订单号 string state = CYRequest.GetString("state"); //支付状态 string signType = CYRequest.GetString("signType"); string tradeMoney = CYRequest.GetString("tradeMoney"); string successMoney = CYRequest.GetString("successMoney"); // 实际支付金额 string tradeId = CYRequest.GetString("tradeId"); // 支付中心订单号 string bankCode = CYRequest.GetString("bankCode"); // 支付银行 string tradeSuccessTime = CYRequest.GetString("tradeSuccessTime"); //订单成功时间 string productName = CYRequest.GetString("productName"); //商品名称 string productUrl = CYRequest.GetString("productUrl"); //商品url string remark = CYRequest.GetString("remark"); //备注 string sign = CYRequest.GetString("sign"); //加密串 StringBuilder sbText = new StringBuilder(); sbText.AppendFormat("{0}|", partnerTradeId); sbText.AppendFormat("{0}|", state); sbText.AppendFormat("{0}|", signType); sbText.AppendFormat("{0}|", tradeMoney); sbText.AppendFormat("{0}|", successMoney); sbText.AppendFormat("{0}|", tradeId); sbText.AppendFormat("{0}|", bankCode); sbText.AppendFormat("{0}|", tradeSuccessTime); sbText.AppendFormat("{0}|", productName); sbText.AppendFormat("{0}|", productUrl); sbText.AppendFormat("{0}|", remark); sbText.Append(QdbPayBuy.GetKey()); string md5 = QdbPayBuy.GetMD5(sbText.ToString(), "gb2312").ToUpper(); if (md5.Equals(sign)) { if ("1".Equals(state)) { //支付成功 int iLen = remark.Split('|').Length; string sAccount = remark.Split('|')[1];//获取充值人账户 decimal dPrice = Convert.ToDecimal(successMoney); string lbOrderId = string.Format("{0}{1}", partnerTradeId, remark.Split('|')[0]); int j = TransPBLL.PointSalesCommit(lbOrderId, sAccount, dPrice); //确认返回信息无误后提交此定单 if (j == 0) { //游戏直冲 if (iLen > 2) { TranQuickBLL.TranQuickUpdateP(lbOrderId); string sGTranID = TranQuickBLL.TranQuickGTranIDSel(lbOrderId); dPrice = (dPrice * 95) / 100; string sGame = remark.Split('|')[2]; string sGTRes = string.Empty; if (sGame.IndexOf("sq") == -1) { sGTRes = PayAll.GameQuickPay(sGame, sAccount, dPrice, sGTranID); } else { string sRoleID = remark.Split('|')[3]; sGTRes = PayAll.sqQuickPay(sGame, sAccount, dPrice, sGTranID, sRoleID); } if (sGTRes == "0") //游戏兑换成功 { TranQuickBLL.TranQuickUpdateG(sGTranID); Response.Redirect(string.Format("PayGSucc.aspx?TranID={0}&gn={1}&type=q", sGTranID, sGame), false); } else { //sMsg = "<script>alert('充值武林币成功!游戏兑换失败!如有问题请与客服联系!');</script>"; Response.Redirect(string.Format("PayPErr.aspx?err=102>res={0}", sGTRes)); } } else { Response.Redirect(string.Format("PayPSucc.aspx?TranID={0}", lbOrderId)); //转向银行卡支付成功页面 } } else { if (6 == j) { if (iLen > 2) { string sQuickState = TranQuickBLL.TransQuickStateSelByP(lbOrderId); string sGTranID = TranQuickBLL.TranQuickGTranIDSel(lbOrderId); string sGame = remark.Split('|')[2]; if (sQuickState == "2") { Response.Redirect(string.Format("PayGSucc.aspx?TranID={0}&gn={1}&type=q", sGTranID, sGame), false); } else if (sQuickState == "1") { int iChannelID = TransPBLL.TranPSelChannelIDByID(lbOrderId); dPrice = (dPrice * 95) / 100; string sGTRes = string.Empty; if (sGame.IndexOf("sq") == -1) { sGTRes = PayAll.GameQuickPay(sGame, sAccount, dPrice, sGTranID); } else { string sRoleID = remark.Split('|')[3]; sGTRes = PayAll.sqQuickPay(sGame, sAccount, dPrice, sGTranID, sRoleID); } if (sGTRes == "0") //游戏兑换成功 { TranQuickBLL.TranQuickUpdateG(sGTranID); Response.Redirect(string.Format("PayGSucc.aspx?TranID={0}&gn={1}&type=q", sGTranID, sGame), false); } else { //sMsg = "<script>alert('充值武林币成功!游戏兑换失败!如有问题请与客服联系!');</script>"; Response.Redirect(string.Format("PayPErr.aspx?err=102>res={0}", sGTRes)); } } } else { Response.Redirect(string.Format("PayPSucc.aspx?TranID={0}", lbOrderId)); } } else { //sMsg = "<script>alert('订单提交失败!如有问题请与客服联系!');</script>"; Response.Redirect("PayPErr.aspx?err=101"); } } } else { //支付失败 //sMsg = "<script>alert('支付失败!如有问题请与客服联系!');</script>"; Response.Redirect("PayPErr.aspx?err=104"); } } else { //sMsg = "<script>alert('验证失败!如有问题请与客服联系!');</script>"; Response.Redirect("PayPErr.aspx?err=103"); } }