예제 #1
0
        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&gtres={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&gtres={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");
            }
        }
예제 #2
0
        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("验证失败");
            }
        }
예제 #3
0
        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));
            }
        }
예제 #4
0
        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("无通知参数");
            }
        }
예제 #5
0
        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&gtres={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&gtres={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");
            }
        }
예제 #6
0
        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&gtres={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&gtres={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");
            }
        }