Esempio n. 1
0
        protected void button5_ServerClick(object sender, EventArgs e)
        {
            //1.校验验证码
            if (UiCommon.ValidCode.CurrentCode == null)
            {
                lblMsg.Text       = "验证码已过期,请输入新的验证码!";
                txtValidCode.Text = string.Empty;
                return;
            }
            else if (txtValidCode.Text.Trim() != UiCommon.ValidCode.CurrentCode)
            {
                lblMsg.Text       = "验证码输入错误,请输入新的验证码!";
                txtValidCode.Text = string.Empty;
                return;
            }

            //2.判断用户名是否存在
            BLL.Member member   = new BLL.Member();
            string     userName = Utility.Common.SqlEncode(txtUserName.Text.Trim());

            if (!member.ExistName(userName))
            {
                lblMsg.Text       = "抱歉,您输入的注册用户名不存在!";
                txtValidCode.Text = string.Empty;
                return;
            }
            else
            {
                Session["getpwduser"] = txtUserName.Text;
                Response.Redirect("/Manage/GetPassAnswer.aspx");
            }
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string errorUrl = "/Manage/Pay/JFTpay/Default.aspx"; //出错跳转地址
            string BackUrl  = UiCommon.StringConfig.WebSiteName + "/Manage/Pay/JFTpay/Receive.aspx";


            string PayType     = Request.Form["pay_type"];                           //支付类型(1是网银,2为点卡)
            string txtUserName = Utility.Common.GetStringOfForm("txtUserName");      //用户名
            string payMoney    = Utility.Common.GetIntOfForm("PayMoney").ToString(); //支付金额
            string txtCardNo   = Utility.Common.GetStringOfForm("txtCardNo");        //卡号
            string txtCardPass = Utility.Common.GetStringOfForm("txtCardPass");      //卡密
            string OrderNo;

            //string strCouponNum = Utility.Common.GetStringOfForm("CouponNum");

            //1,支付类型
            if (PayType == "1")
            {
                OrderNo = DateTime.Now.ToString("yyyyMMddHHmmssffffff");
            }
            else
            {
                OrderNo = "ka" + DateTime.Now.ToString("yyyyMMddHHmmssffff");
            }

            //2, 验证用户名
            BLL.Member mem = new BLL.Member();
            if (!mem.ExistName(txtUserName))
            {
                Response.Write("<script>alert('找不到您要充值的用户帐号,请检查输入是否有误');location.href='" + errorUrl + "';</script>");
                Response.End();
            }

            if (mem.IsInRoomOrGame(txtUserName))
            {
                Response.Write("<script>alert('要充值的帐号正在游戏中,请先退出游戏再进行充值。');location.href='" + errorUrl + "';</script>");
                Response.End();
            }



            //4, 插入支付的订单日志
            mem.Add3PayOrder(txtUserName.Trim(), Convert.ToInt32(payMoney), 9, "聚付通充值", OrderNo);

            payMoney = payMoney + ".00";



            //5, 跳转到支付平台
            jftpay(OrderNo, BackUrl, payMoney, txtUserName, "");
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string errorUrl = "/Manage/Pay/JFTpay/Default.aspx"; //出错跳转地址
            string BackUrl = UiCommon.StringConfig.WebSiteName + "/Manage/Pay/JFTpay/Receive.aspx";

            string PayType = Request.Form["pay_type"]; //支付类型(1是网银,2为点卡)
            string txtUserName = Utility.Common.GetStringOfForm("txtUserName"); //用户名
            string payMoney = Utility.Common.GetIntOfForm("PayMoney").ToString(); //支付金额
            string txtCardNo = Utility.Common.GetStringOfForm("txtCardNo"); //卡号
            string txtCardPass = Utility.Common.GetStringOfForm("txtCardPass"); //卡密
            string OrderNo;

            //string strCouponNum = Utility.Common.GetStringOfForm("CouponNum");

            //1,支付类型
            if (PayType == "1")
            {
                OrderNo = DateTime.Now.ToString("yyyyMMddHHmmssffffff");

            }
            else
            {
                OrderNo = "ka" + DateTime.Now.ToString("yyyyMMddHHmmssffff");

            }

            //2, 验证用户名
            BLL.Member mem = new BLL.Member();
            if (!mem.ExistName(txtUserName))
            {
                Response.Write("<script>alert('找不到您要充值的用户帐号,请检查输入是否有误');location.href='" + errorUrl + "';</script>");
                Response.End();
            }

            if (mem.IsInRoomOrGame(txtUserName))
            {
                Response.Write("<script>alert('要充值的帐号正在游戏中,请先退出游戏再进行充值。');location.href='" + errorUrl + "';</script>");
                Response.End();
            }

            //4, 插入支付的订单日志
            mem.Add3PayOrder(txtUserName.Trim(), Convert.ToInt32(payMoney), 9, "聚付通充值", OrderNo);

            payMoney = payMoney + ".00";

            //5, 跳转到支付平台
            jftpay(OrderNo, BackUrl, payMoney,txtUserName,"");
        }
Esempio n. 4
0
        protected void button5_ServerClick(object sender, EventArgs e)
        {
            if (!BCST.Common.CommonManager.Web.CheckPostSource())
            {
                return;
            }

            string userId      = UiCommon.UserLoginInfo.UserID;
            string outUserName = UiCommon.UserLoginInfo.UserName;
            string password    = txtPassword.Text.Trim();//hidPwd.Value.Trim(); //

            if (!member.CompareTwoPassword(userId, password))
            {
                lblMsg.Text = "对不起,您输入的银行密码有误!";
                return;
            }

            Int64 outUserBankMoney = member.GetBankMoney(userId);

            string inputUserName = Utility.Common.FilterString(txtInputUserName.Text.Trim());



            //2.判断转出方账号是否在游戏房间或正在游戏中,是则不能进行转账操作!
            if (member.IsInRoomOrGame(outUserName))
            {
                lblMsg.Text = "抱歉,您的帐号已进入房间中或正在游戏中,不能进行转账操作!";
                return;
            }

            //2.1转出方账户余额必须大于这个数TransferLessAllMoney才能转账
            long LeftMoney = member.GetAllMoney(userId);       //获取账户余额

            if (LeftMoney <= Convert.ToInt64(TransferLessAllMoney))
            {
                lblMsg.Text = "抱歉,您的账户余额必须大于规定的" + UiCommon.StringConfig.AddZeros(TransferLessAllMoney) + UiCommon.StringConfig.MoneyName + "才能转账!";
                return;
            }

            //3.如果转入方的账号不存在,不能进行转账操作
            if (!member.ExistName(inputUserName))
            {
                lblMsg.Text = "抱歉,您填写的转入帐号不存在!";
                return;
            }

            //4.如果转入方的账号正在游戏中,不能进行转账操作(此项限制可选)
            if (member.IsInRoomOrGame(inputUserName))
            {
                lblMsg.Text = "抱歉,转入方的帐号已进入房间中或正在游戏中,不能进行转账操作!";
                return;
            }

            long transMoney = Convert.ToInt64(txtMoney.Text.Trim());

            //5.1转账金额必须是这个数的倍数TransferMultiple
            if (transMoney % TransferMultiple != 0)
            {
                lblMsg.Text = "抱歉,您输入的转账金额必须是" + TransferMultiple + "的倍数!";
                return;
            }

            transMoney = Convert.ToInt64(UiCommon.StringConfig.RemoveZeros(transMoney));
            //5.2转账金额不能小于单笔转账规定值TransferLessMoney
            if (transMoney < TransferLessMoney)
            {
                lblMsg.Text = "抱歉,您输入的转账金额小于单笔转账规定值" + UiCommon.StringConfig.AddZeros(TransferLessMoney) + UiCommon.StringConfig.MoneyName + "!";
                return;
            }

            //6.转出方银行帐户余额不足,请存款后在进行转帐!
            if (outUserBankMoney < transMoney)
            {
                lblMsg.Text = "抱歉,您的银行余额不足,请存款或充值后再进行转账!";
                return;
            }

            //transMoney少于零,则说明输入的金额比配置的倍数小。输入的金额至少要达到倍数的额数。2010-01-26
            if (transMoney <= 0)
            {
                lblMsg.Text = "抱歉,转账金额必须大于或等于" + UiCommon.StringConfig.GetMultiple();
                return;
            }

            //7.更新转出方银行存款、更新转入方银行存款、写入转账 Web_TransLog 记录表
            Dictionary <string, object> dic = new Dictionary <string, object>();

            DbSession.Default.FromProc("Web_pBankTrans")
            .AddInputParameter("@outUserName", DbType.String, outUserName)
            .AddInputParameter("@inUserName", DbType.String, inputUserName)
            .AddInputParameter("@transMoney", DbType.Int64, transMoney)
            .AddInputParameter("@transTime", DbType.DateTime, DateTime.Now)
            .AddInputParameter("@transIP", DbType.String, CommonManager.Web.GetIP())
            .AddOutputParameter("@Result", DbType.Int32, 4)
            .Execute(out dic);

            //if( member.BankTransfer( outUserName, inputUserName, transMoney, Utility.Common.RequestIP ) )
            if (dic.Count > 0 && (int)dic["Result"] == 0)
            {
                DateTime tmp_viptime = DbSession.Default.FromSql("select DATEADD([second],viptime,'1970-01-01 08:00:00') from Web_vUserList where UserName=@UserName").AddInputParameter("@UserName", DbType.String, outUserName).ToScalar <DateTime>();

                int taxMoney = 0;// = transMoney;
                if (tmp_viptime > DateTime.Now)
                {
                    //VIP手续费   根据项目实施部要求转账手续费改成千分比  周圣华 2010-05-14
                    taxMoney = (int)((float)transMoney * (((float)VipTransferTax / 10000))); //*= (VipTransferTax / 100);
                }
                else
                {
                    //普通会员手续费
                    taxMoney = (int)((float)transMoney * (((float)TransferTax / 10000))); //*= (TransferTax / 100);
                }

                if (taxMoney > MaxTransTax)
                {
                    taxMoney = MaxTransTax;
                }
                int sjTransMoney = (int)transMoney - taxMoney; //实际转账金额

                CommonManager.Web.RegJs(this, "alert('转账成功,您转给" + inputUserName + "的" + UiCommon.StringConfig.AddZeros(transMoney) + UiCommon.StringConfig.MoneyName + ",扣除手续费" + UiCommon.StringConfig.AddZeros(taxMoney) + UiCommon.StringConfig.MoneyName + "后," + UiCommon.StringConfig.AddZeros(sjTransMoney) + UiCommon.StringConfig.MoneyName + "已转入他/她的银行账户!');location.href=location.href;", false);
            }
            else if (dic.Count > 0 && (int)dic["Result"] == 1)
            {
                CommonManager.Web.RegJs(this, "alert('您的银行" + UiCommon.StringConfig.MoneyName + "不足,请先去充值后再转帐。');location.href=location.href;", true);
            }
            else if (dic.Count > 0 && (int)dic["Result"] == 3)
            {
                CommonManager.Web.RegJs(this, "alert('抱歉,转账不能自己转给自己,请重新输入转入帐号!');location.href=location.href;", true);
            }
            else
            {
                //lblMsg.Text = "抱歉,转账操作失败,可能是服务器繁忙,请稍候再试!";
                CommonManager.Web.RegJs(this, "alert('抱歉,转账操作失败,可能是服务器繁忙,请稍候再试!');location.href=location.href;", true);
            }
        }
Esempio n. 5
0
        protected void button5_ServerClick(object sender, EventArgs e)
        {
            //1.У����֤��
            if (UiCommon.ValidCode.CurrentCode == null)
            {
                lblMsg.Text = "��֤���ѹ��ڣ��������µ���֤�룡";
                txtValidCode.Text = string.Empty;
                return;
            }
            else if (txtValidCode.Text.Trim() != UiCommon.ValidCode.CurrentCode)
            {
                lblMsg.Text = "��֤����������������µ���֤�룡";
                txtValidCode.Text = string.Empty;
                return;
            }

            //2.�ж��û����Ƿ����
            BLL.Member member = new BLL.Member();
            string userName = Utility.Common.SqlEncode(txtUserName.Text.Trim());
            if (!member.ExistName(userName))
            {
                lblMsg.Text = "��Ǹ���������ע���û��������ڣ�";
                txtValidCode.Text = string.Empty;
                return;
            }
            else
            {
                Session["getpwduser"] = txtUserName.Text;
                Response.Redirect("/Manage/GetPassAnswer.aspx");
            }
        }
Esempio n. 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string errorUrl = "/Manage/Pay/KF/Default.aspx"; //出错跳转地址
              BLL.Member mem = new BLL.Member();

              string txtUserName = Utility.Common.GetStringOfForm("txtUserName"); //用户名

              if (!mem.ExistName(txtUserName.Trim()))
              {
                  Response.Write("<script>alert('找不到您要充值的用户帐号,请检查输入是否有误');location.href='" + errorUrl + "';</script>");
                  Response.End();
              }

              //支付金额
              string payMoney = Utility.Common.GetStringOfForm("PayMoney");
              if (string.IsNullOrEmpty(payMoney) || !CommonManager.String.IsInteger(payMoney) || int.Parse(payMoney) <= 0)
              {
                  CommonManager.Web.RegJs(this, "alert('金额只能输入大于0的整数。');history.back();", false);
                  return;
              }
              int otherPayMoney = mem.UserTodayOtherPayMoney(txtUserName.Trim());
              //是否超出今天充值限制额
              if (Convert.ToInt32(payMoney) > otherPayMoney)
              {
                  Response.Write("<script>alert('您今天能充值金额数不能大于" + otherPayMoney + "。');location.href='" + errorUrl + "';</script>");
                  Response.End();
              }
              //充值类型
              string payType = Utility.Common.GetStringOfForm("channelId");
              string P_CardId = string.Empty;
              string P_CardPass = string.Empty;
              if (payType != "1" && payType != "2" && payType != "3")
              {
                  P_CardId = Utility.Common.GetStringOfForm("CardNo");
                  P_CardPass = Utility.Common.GetStringOfForm("CardPwd");
              }
              else
              {

              }
              int payTypeLog = 8;
              //商户定单编号
              string P_OrderId = DateTime.Now.ToString("yyyyMMddHHmmssfffffff");
              //支付成功前, 插入支付的订单日志
              mem.Add3PayOrder(txtUserName, Convert.ToInt32(payMoney), payTypeLog, "花旗充值", P_OrderId);
              //商户编号
              string P_UserId = UiCommon.StringConfig.KFPayID;
              //面值
              string P_FaceValue = payMoney + ".00";
              //充值类型
              string P_ChannelId = payType;
              //产品名称
              string P_Subject = "";
              //产品价格
              string P_Price = payMoney + ".00";

               //产品数量
              string P_Quantity ="1";
              //产品描述
              string P_Description = "";
              //用户附加信息
              string P_Notic = "";
              //充值状态通知地址
              string P_Result_URL = UiCommon.StringConfig.WebSiteName+"/Manage/Pay/KF/Result.aspx";
              //充值后网页跳转地址
              string P_Notify_URL = UiCommon.StringConfig.WebSiteName + "/Manage/Pay/KF/Return.aspx";
              //密钥
              string SalfStr = UiCommon.StringConfig.KFPayKey;
              //签名认证
              string preEncodeStr = P_UserId + "|" + P_OrderId + "|" + P_CardId + "|" + P_CardPass + "|" + P_FaceValue + "|" + P_ChannelId + "|" + SalfStr;
              string P_PostKey = Utility.Common.md5(preEncodeStr);
              //Response.Write(P_PostKey+"</br>"+Utility.Common.md5(preEncodeStr).ToUpper());
              //Response.End();
              //接口url
              string url = UiCommon.StringConfig.KFNotifyURL+"P_UserId="+P_UserId+"&P_OrderId="+P_OrderId+"&P_CardId="+P_CardId+"&P_CardPass="******"&P_FaceValue="+P_FaceValue+"&P_ChannelId="+P_ChannelId+"&P_Subject="+P_Subject+"&P_Price="
                  +P_Price+"&P_Quantity="+P_Quantity+"&P_Description="+P_Description+"&P_Notic="+P_Notic+"&P_PostKey="+P_PostKey
                  +"&P_Result_url="+P_Result_URL+"&P_Notify_URL="+P_Notify_URL;

             Response.Redirect(url);
        }
Esempio n. 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //string toServerURL = "https://pay.ips.com.cn/ipayment.aspx";//IPS支付接口路径

               //string toServerURLTest = "https://pay.ips.net.cn/ipayment.aspx"; //IPS支付接口测试路径

               //frmPay.Action = toServerURLTest;

               string errorUrl = "/Manage/Pay/IPS/Default.aspx"; //出错跳转地址

               BLL.Member mem = new BLL.Member();

               string txtUserName = Utility.Common.GetStringOfForm("txtUserName"); //用户名

               if (!mem.ExistName(txtUserName.Trim()))
               {
               Response.Write("<script>alert('找不到您要充值的用户帐号,请检查输入是否有误');location.href='" + errorUrl + "';</script>");
               Response.End();
               }

               // [add] jeffery
               //string strCouponNum = Utility.Common.GetStringOfForm("CouponNum"); //获取应赠送奖劵数量
               //Attach.Value = txtUserName + "!@#" + strCouponNum;
               // --- end

             //支付金额
            string payMoney = Utility.Common.GetStringOfForm("PayMoney");

            if (string.IsNullOrEmpty(payMoney) || !CommonManager.String.IsInteger(payMoney) || int.Parse(payMoney) <= 0)
            {
                CommonManager.Web.RegJs(this, "alert('金额只能输入大于0的整数。');history.back();", false);
                return;
            }
            int otherPayMoney = mem.UserTodayOtherPayMoney(txtUserName.Trim());
            //是否超出今天充值限制额
            if (Convert.ToInt32(payMoney) > otherPayMoney)
            {
                Response.Write("<script>alert('您今天能充值金额数不能大于"+otherPayMoney+"。');location.href='" + errorUrl + "';</script>");
                Response.End();
            }
            int payTypeLog = 6;

               Currency_Type.Value = "RMB";  //支付币种

               Amount.Value = payMoney + ".00";  //订单金额

               Mer_code.Value = UiCommon.StringConfig.IPS_Mer_code; //商户编号

               Billno.Value = DateTime.Now.ToString("yyyyMMddHHmmssfffffff"); //商户定单编号

               Date.Value = DateTime.Now.ToString("yyyyMMdd");  //订单日期

               MerchantUrl.Value = UiCommon.StringConfig.WebSiteName + "/Manage/Pay/IPS/OrderReturn.aspx"; //支付成功通知的URL

               failUrl.Value = UiCommon.StringConfig.WebSiteName + "/Manage/Pay/IPS/OrderReturn.aspx"; //支付失败通知的URL

               signMD5.Value = Utility.Common.md5("billno" + Billno.Value + "currencytype" + Currency_Type.Value + "amount" + Amount.Value + "date" + Date.Value + "orderencodetype" + OrderEncodeType.Value + UiCommon.StringConfig.IPS_Letter);   //MD5加密签名

              //如果是神舟卡
               if (Utility.Common.GetStringOfForm("Type") == "phone")
               {
               DoCredit.Value = "1";//直连神舟行
               Bankco.Value = "00077";//神州行代码
               Rettype.Value = "1";
               ServerUrl.Value = UiCommon.StringConfig.WebSiteName + "/Manage/Pay/IPS/IPS_Server.aspx";
               //支付成功前, 插入支付的订单日志
               mem.Add3PayOrder(txtUserName, Convert.ToInt32(payMoney), payTypeLog, "环迅-神州行充值", Billno.Value);
               }
               else
               {
               //支付成功前, 插入支付的订单日志
               mem.Add3PayOrder(txtUserName, Convert.ToInt32(payMoney), payTypeLog, "环迅充值", Billno.Value);
               }
        }
Esempio n. 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string toUrl = "/Manage/Pay/15173pay/Default.aspx";
            //支付人
            string userName = Utility.Common.GetStringOfForm("txtUserName");
            BLL.Member mem = new BLL.Member();
            if (!mem.ExistName(userName))
            {
                CommonManager.Web.RegJs(this, "alert('找不到您输入的用户,请重新核对。');history.back();", false);
                return;
            }

            //支付金额
            string payMoney = Utility.Common.GetStringOfForm("PayMoney");
            if (string.IsNullOrEmpty(payMoney) || !CommonManager.String.IsInteger(payMoney) || int.Parse(payMoney) <= 0)
            {
                CommonManager.Web.RegJs(this, "alert('金额只能输入大于0的整数。');history.back();", false);
                return;
            }
            int otherPayMoney = mem.UserTodayOtherPayMoney(userName.Trim());
            //是否超出今天充值限制额
            if (Convert.ToInt32(payMoney) > otherPayMoney)
            {
                Response.Write("<script>alert('您今天能充值金额数不能大于" + otherPayMoney + "。');location.href='" + toUrl + "';</script>");
                Response.End();
            }
            Pay15173 pays = new Pay15173();
            //商户ID
            pays.Bargainor_id = UiCommon.StringConfig.Pay15173ID;

            //商户密钥
            pays.Key = UiCommon.StringConfig.Pay15173Key;

            //商户订单号
            string out_trade_no = DateTime.Now.ToString("yyyyMMddHHmmssfffffff");

            pays.Sp_billno = out_trade_no;

            pays.Total_fee = Convert.ToDecimal(payMoney);
            //充值类型
            string payType = System.Web.HttpContext.Current.Request.Form["rdPayType"].ToString().Trim();

            pays.Pay_type = payType;

            //返回页面
            pays.Return_url = UiCommon.StringConfig.WebSiteName + "/Manage/Pay/15173pay/Return.aspx";

            //交易单备注,留空
            pays.Attach = "CC";

            string typeInfoLog = string.Empty;

            switch (payType)
            {
                case "a":
                    typeInfoLog = "15173神州行卡支付";
                    break;
                case "b":
                    typeInfoLog = "15173俊网一卡通支付";
                    break;
                case "c":
                    typeInfoLog = "15173盛大卡支付";
                    break;
                case "d":
                    typeInfoLog = "15173征途游戏卡支付";
                    break;
                case "m":
                    typeInfoLog = "15173网易一卡通支付";
                    break;
                case "n":
                    typeInfoLog = "15173搜狐一卡通支付";
                    break;
                case "q":
                    typeInfoLog = "15173久游一卡通支付";
                    break;
                case "u":
                    typeInfoLog = "15173完美一卡通支付";
                    break;
                case "x":
                    typeInfoLog = "15173联通全国充值卡支付";
                    break;
                case "y":
                    typeInfoLog = "15173中国电信付费充值卡支付";
                    break;
                case "f":
                    typeInfoLog = "15173金山一卡通支付";
                    break;
                case "g":
                    typeInfoLog = "15173光宇一卡通支付";
                    break;
                case "e":
                    typeInfoLog = "15173纵游一卡通支付";
                    break;

            }
            int payTypeLog = 5;
            mem.Add3PayOrder(userName, Convert.ToInt32(payMoney), payTypeLog, typeInfoLog, out_trade_no);
            string url = "";
            if (!pays.GetPayUrl(out url))
            {
                Utility.Common.OutMsgBox(url, toUrl);
            }
            else
            {
                Response.Redirect(url);
            }
        }
Esempio n. 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //string toServerURL = "https://pay.ips.com.cn/ipayment.aspx";//IPS支付接口路径

            //string toServerURLTest = "https://pay.ips.net.cn/ipayment.aspx"; //IPS支付接口测试路径

            //frmPay.Action = toServerURLTest;

            string errorUrl = "/Manage/Pay/IPS/Default.aspx"; //出错跳转地址

            BLL.Member mem = new BLL.Member();

            string txtUserName = Utility.Common.GetStringOfForm("txtUserName"); //用户名

            if (!mem.ExistName(txtUserName.Trim()))
            {
                Response.Write("<script>alert('找不到您要充值的用户帐号,请检查输入是否有误');location.href='" + errorUrl + "';</script>");
                Response.End();
            }

            // [add] jeffery
            //string strCouponNum = Utility.Common.GetStringOfForm("CouponNum"); //获取应赠送奖劵数量
            //Attach.Value = txtUserName + "!@#" + strCouponNum;
            // --- end

            //支付金额
            string payMoney = Utility.Common.GetStringOfForm("PayMoney");

            if (string.IsNullOrEmpty(payMoney) || !CommonManager.String.IsInteger(payMoney) || int.Parse(payMoney) <= 0)
            {
                CommonManager.Web.RegJs(this, "alert('金额只能输入大于0的整数。');history.back();", false);
                return;
            }
            int otherPayMoney = mem.UserTodayOtherPayMoney(txtUserName.Trim());

            //是否超出今天充值限制额
            if (Convert.ToInt32(payMoney) > otherPayMoney)
            {
                Response.Write("<script>alert('您今天能充值金额数不能大于" + otherPayMoney + "。');location.href='" + errorUrl + "';</script>");
                Response.End();
            }
            int payTypeLog = 6;

            Currency_Type.Value = "RMB";     //支付币种

            Amount.Value = payMoney + ".00"; //订单金额


            Mer_code.Value = UiCommon.StringConfig.IPS_Mer_code; //商户编号


            Billno.Value = DateTime.Now.ToString("yyyyMMddHHmmssfffffff");                              //商户定单编号

            Date.Value = DateTime.Now.ToString("yyyyMMdd");                                             //订单日期

            MerchantUrl.Value = UiCommon.StringConfig.WebSiteName + "/Manage/Pay/IPS/OrderReturn.aspx"; //支付成功通知的URL

            failUrl.Value = UiCommon.StringConfig.WebSiteName + "/Manage/Pay/IPS/OrderReturn.aspx";     //支付失败通知的URL


            signMD5.Value = Utility.Common.md5("billno" + Billno.Value + "currencytype" + Currency_Type.Value + "amount" + Amount.Value + "date" + Date.Value + "orderencodetype" + OrderEncodeType.Value + UiCommon.StringConfig.IPS_Letter);  //MD5加密签名

            //如果是神舟卡
            if (Utility.Common.GetStringOfForm("Type") == "phone")
            {
                DoCredit.Value  = "1";     //直连神舟行
                Bankco.Value    = "00077"; //神州行代码
                Rettype.Value   = "1";
                ServerUrl.Value = UiCommon.StringConfig.WebSiteName + "/Manage/Pay/IPS/IPS_Server.aspx";
                //支付成功前, 插入支付的订单日志
                mem.Add3PayOrder(txtUserName, Convert.ToInt32(payMoney), payTypeLog, "环迅-神州行充值", Billno.Value);
            }
            else
            {
                //支付成功前, 插入支付的订单日志
                mem.Add3PayOrder(txtUserName, Convert.ToInt32(payMoney), payTypeLog, "环迅充值", Billno.Value);
            }
        }
Esempio n. 10
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            /*
             * show_url          ="www.xiaohhgame.com"                   '网站的网址
             * seller_email		= "*****@*****.**"				'请设置成您自己的支付宝帐户
             * partner			= "2088102335433231"					'支付宝的账户的合作者身份ID
             * key			    = "7a7kaee4ogm8lwywepjgpgkcek9pcnl3"	'支付宝的安全校验码
             *
             * notify_url			= "http://www.xiaohhgame.com/alipay/Alipay_Notify.asp"	'付完款后服务器通知的页面 要用 http://格式的完整路径
             * return_url			= "http://www.xiaohhgame.com/alipay/return_Alipay_Notify.asp"	'付完款后跳转的页面 要用 http://格式的完整路径
             */


            //商品名称(商户)(此参数可以后台配置的)
            string companyName = UiCommon.StringConfig.CompanyNameOfPay;

            //支付人(也就是登录的用户账号)
            string userName = txtUserName.Text.Trim();

            BLL.Member mem = new BLL.Member();
            if (!mem.ExistName(userName))//验证用户名是否存在
            {
                CommonManager.Web.RegJs(this, "alert('找不到您输入的用户,请重新核对。');history.back();", false);
                return;
            }

            //支付金额
            string payMoney = PayMoney.Text.Trim();                                                                      //从前台得到支付的金额

            if (string.IsNullOrEmpty(payMoney) || !CommonManager.String.IsInteger(payMoney) || int.Parse(payMoney) <= 0) //验证金额的合法性
            {
                CommonManager.Web.RegJs(this, "alert('金额只能输入大于0的整数。');history.back();", false);
                return;
            }

            //支付类型 Web_RMBCost.PayType  此值固定
            int payTypeLog = 4;

            //类型信息 Web_RMBCost.Typeinfo  此值固定
            string typeInfoLog = "支付宝在线支付";

            //*****************业务参数赋值*****************************************************************
            //订单号(按时构造)

            /*System.DateTime currentTime = new System.DateTime();
             * currentTime = System.DateTime.Now;
             * string out_trade_no = currentTime.ToString("g");
             * out_trade_no = out_trade_no.Replace("-", "");
             * out_trade_no = out_trade_no.Replace(":", "");
             * out_trade_no = out_trade_no.Replace(" ", "");*/
            string out_trade_no = DateTime.Now.ToString("yyyyMMddHHmmssfffffff");//此值固定

            //支付接口 https://www.alipay.com/cooperate/gateway.do?
            string gateway = UiCommon.StringConfig.AlipayNotifyURL;//此值在web.config中配置

            //服务参数
            string service = "create_direct_pay_by_user";//此值固定

            //partner 合作伙伴ID(保留字段)
            string partner = UiCommon.StringConfig.AlipayPartnerID;//此值在web.config中配置

            //加密类型
            string sign_type = "MD5";//此值固定

            //subject 商品名称
            string subject = companyName;

            //body 商品描述
            string body = "游戏金币";//此值可以自定义

            //支付类型
            string payment_type = "1";//此值固定

            //总金额 0.01~50000.00
            string total_fee = payMoney;

            //网站的网址
            string show_url = UiCommon.StringConfig.WebSiteName;// 支付宝页面显示<a href="www.xiaohhgame.com" target="_blank">商品名称</a> ;

            //卖家账号
            string seller_email = UiCommon.StringConfig.AlipayAccount; //此值在web.config中配置

            //partner账户的支付宝安全校验码
            string key = UiCommon.StringConfig.AlipayKey; //此值在web.config中配置

            //服务器通知返回接口,这个页面可以展示给客户看,只有付款成功才会跳转到这个页面
            string return_url = UiCommon.StringConfig.WebSiteName + "/Manage/Pay/Alipay/Alipay_Return.aspx";

            //服务器通知返回接口  这个页面是支付宝发过来确定信息后网站更新数据,然后再给支付宝发送确定信息

            string notify_url = UiCommon.StringConfig.WebSiteName + "/Manage/Pay/Alipay/Alipay_Notify.aspx";

            string _input_charset = "utf-8";


            //支付成功前, 插入支付的订单日志
            mem.Add3PayOrder(userName, Convert.ToInt32(payMoney), payTypeLog, typeInfoLog, out_trade_no);


            //把支付数据提交到支付宝服务器
            AliPay ap        = new AliPay();
            string aliay_url = ap.CreatUrl(
                gateway,
                service,
                partner,
                sign_type,
                out_trade_no,
                subject,
                body,
                payment_type,
                total_fee,
                show_url,
                seller_email,
                key,
                return_url,
                _input_charset,
                notify_url
                );

            Response.Redirect(aliay_url);
        }
Esempio n. 11
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            /*
            show_url          ="www.xiaohhgame.com"                   '��վ����ַ
            seller_email		= "*****@*****.**"				'�����ó����Լ���֧�����ʻ�
            partner			= "2088102335433231"					'֧�������˻��ĺ��������ID
            key			    = "7a7kaee4ogm8lwywepjgpgkcek9pcnl3"	'֧�����İ�ȫУ����

            notify_url			= "http://www.xiaohhgame.com/alipay/Alipay_Notify.asp"	'�����������֪ͨ��ҳ�� Ҫ�� http://��ʽ������·��
            return_url			= "http://www.xiaohhgame.com/alipay/return_Alipay_Notify.asp"	'��������ת��ҳ�� Ҫ�� http://��ʽ������·��
            */

            //��Ʒ���ƣ��̻���
            string companyName = UiCommon.StringConfig.CompanyNameOfPay;

            //֧����
            string userName = txtUserName.Text.Trim();
            BLL.Member mem = new BLL.Member();
            if (!mem.ExistName(userName))
            {
                CommonManager.Web.RegJs(this, "alert('�Ҳ�����������û��������º˶ԡ�');history.back();", false);
                return;
            }

            //֧�����
            string payMoney = PayMoney.Text.Trim();
            if (string.IsNullOrEmpty(payMoney) || !CommonManager.String.IsInteger(payMoney) || int.Parse(payMoney) <= 0)
            {
                CommonManager.Web.RegJs(this, "alert('���ֻ���������0��������');history.back();", false);
                return;
            }
            int otherPayMoney = mem.UserTodayOtherPayMoney(userName.Trim());
            //�Ƿ񳬳������ֵ���ƶ�
            if (Convert.ToInt32(payMoney) > otherPayMoney)
            {

                CommonManager.Web.RegJs(this, "alert(''�������ܳ�ֵ��������ܴ���" + otherPayMoney + "��');history.back();", false);
                return;
            }
            //֧������ Web_RMBCost.PayType
            int payTypeLog = 4;

            //������Ϣ Web_RMBCost.Typeinfo
            string typeInfoLog = "֧��������֧��";

            //*****************ҵ�������ֵ*****************************************************************
            //������(��ʱ����)
            /*System.DateTime currentTime = new System.DateTime();
            currentTime = System.DateTime.Now;
            string out_trade_no = currentTime.ToString("g");
            out_trade_no = out_trade_no.Replace("-", "");
            out_trade_no = out_trade_no.Replace(":", "");
            out_trade_no = out_trade_no.Replace(" ", "");*/
            string out_trade_no = DateTime.Now.ToString("yyyyMMddHHmmssfffffff");

            //֧���ӿڡ�https://www.alipay.com/cooperate/gateway.do?
            string gateway = UiCommon.StringConfig.AlipayNotifyURL;

            //�������
            string service = "create_direct_pay_by_user";

            //partner �������ID(�����ֶ�)
            string partner = UiCommon.StringConfig.AlipayPartnerID;// "2088102335433231";

            //��������
            string sign_type = "MD5";

            //subject ��Ʒ����
            string subject = companyName;

            //body ��Ʒ����

            // [modify] jeffery
            string body = "��Ϸ" + UiCommon.StringConfig.MoneyName;

            //double poupon = Convert.ToDouble(CouponRate) * Convert.ToDouble(PayMoney.Text);
            //if (poupon < 0)
            //    poupon = 0;

            //string body = "��Ϸ" + UiCommon.StringConfig.MoneyName +
            //    "!@#" + userName + "!@#" + Convert.ToInt32(poupon).ToString();
            // ---end

            //֧������
            string payment_type = "1";

            //�ܽ�� 0.01��50000.00
            string total_fee = payMoney;

            //��վ����ַ
            string show_url = UiCommon.StringConfig.WebSiteName;// ֧����ҳ����ʾ<a href="www.xiaohhgame.com" target="_blank">��Ʒ����</a> ;

            //����˺�
            string seller_email = UiCommon.StringConfig.AlipayAccount; //"*****@*****.**";

            //partner�˻���֧������ȫУ����
            string key = UiCommon.StringConfig.AlipayKey; //"7a7kaee4ogm8lwywepjgpgkcek9pcnl3";

            //������֪ͨ���ؽӿڣ����ҳ�����չʾ���ͻ���,ֻ�и���ɹ��Ż���ת�����ҳ��
            string return_url = UiCommon.StringConfig.WebSiteName + "/Manage/Pay/Alipay/Alipay_Return.aspx";

            //������֪ͨ���ؽӿ�
            string notify_url = UiCommon.StringConfig.WebSiteName + "/Manage/Pay/Alipay/Alipay_Notify.aspx";

            string _input_charset = "utf-8";

            //֧���ɹ�ǰ�� ����֧���Ķ�����־
            mem.Add3PayOrder(userName, Convert.ToInt32(payMoney), payTypeLog, typeInfoLog, out_trade_no);

            //��֧�������ύ��֧����������
            AliPay ap = new AliPay();
            string aliay_url = ap.CreatUrl(
                gateway,
                service,
                partner,
                sign_type,
                out_trade_no,
                subject,
                body,
                payment_type,
                total_fee,
                show_url,
                seller_email,
                key,
                return_url,
                _input_charset,
                notify_url
                );

            Response.Redirect(aliay_url);
        }
Esempio n. 12
0
        protected void button5_ServerClick(object sender, EventArgs e)
        {
            if (!BCST.Common.CommonManager.Web.CheckPostSource())
            {
                return;
            }
            //1.校验验证码
            if (UiCommon.ValidCode.CurrentCode == null)
            {
                lblMsg.Text       = "验证码已过期,请输入新的验证码!";
                txtValidCode.Text = string.Empty;
                return;
            }
            else if (txtValidCode.Text.Trim() != UiCommon.ValidCode.CurrentCode)
            {
                lblMsg.Text       = "验证码输入错误,请输入新的验证码!";
                txtValidCode.Text = string.Empty;
                return;
            }

            //2.判断用户名是否存在
            BLL.Member member   = new BLL.Member();
            string     userName = Utility.Common.SqlEncode(txtUserName.Text.Trim());

            if (!member.ExistName(userName))
            {
                lblMsg.Text       = "您输入的游戏帐号(用户名)不存在!";
                txtValidCode.Text = string.Empty;
                return;
            }
            //判断玩家充值时,不能在游戏中
            if (member.IsInRoomOrGame(userName))
            {
                lblMsg.Text       = "要充值的帐号正在游戏中,请先退出游戏再进行充值!";
                txtValidCode.Text = string.Empty;
                return;
            }
            //3.判断充值卡是否已充值,或卡号及密码错误
            string cardNo    = Utility.Common.SqlEncode(txtCardNo.Text.Trim());
            string cardPwd   = Utility.Common.SqlEncode(txtCardPwd.Text.Trim());
            int    cardState = new BLL.Card().PointCardState(cardNo, cardPwd);

            if (cardState == -1)
            {
                lblMsg.Text       = "对不起,您输入的卡号或密码有误!";
                txtValidCode.Text = string.Empty;
                return;
            }
            else if (cardState == 1)
            {
                lblMsg.Text       = "对不起,您输入的卡号已经被充值!";
                txtValidCode.Text = string.Empty;
                return;
            }

            #region 免费卡

            // 免费卡的张数
            int     freeCardForUser = 0;
            DataRow dr = member.GetFreeCardCount();
            if (dr != null)
            {
                freeCardForUser = Convert.ToInt32(dr["FreeCardCount"]);
            }


            //若是免费卡,先判断用户是否已经充值了XX张。如:免费卡每个用户只能充值2张。
            if (member.IsFreeCard(cardNo))
            {
                int cardCount = member.FreeCardCount(userName);
                if (cardCount >= freeCardForUser)
                {
                    lblMsg.Text       = "您已经使用" + freeCardForUser + "张免费卡了!";
                    txtValidCode.Text = string.Empty;
                    return;
                }
            }
            #endregion

            //4.将充值金额转换成金币存入银行
            //被充值用户如果有推荐人,在Web_Config中根据参数值奖励推荐人
            //更新点卡状态
            //by YMH 2012-9-4  充值积分
            //积分充值存在
            if (ConfigurationManager.AppSettings["IsPayToPoint"] == "1" && rblPayType.SelectedValue == "point" && ddlGameList.SelectedValue != "")
            {
                //充值积分
                int result = member.PointCardFull2(userName, cardNo, cardPwd, Utility.Common.RequestIP, ddlGameList.SelectedValue);
                if (result == 0)
                {
                    lblMsg.Text       = "充值卡[" + cardNo + "]充值成功,充值的游戏帐号(用户名)是" + userName + "!" + DateTime.Now;
                    txtUserName.Text  = string.Empty;
                    txtUserName2.Text = string.Empty;
                    txtCardNo.Text    = string.Empty;
                    txtValidCode.Text = string.Empty;
                }
                else if (result == -1)
                {
                    lblMsg.Text       = "抱歉,点卡不存在或点卡号、密码不正确!";
                    txtValidCode.Text = string.Empty;
                }
                else
                {
                    lblMsg.Text       = "抱歉,点卡充值失败,可能是服务器繁忙,请稍候再试!";
                    txtValidCode.Text = string.Empty;
                }
            }
            else//充值金币
            {
                if (member.PointCardFull(userName, cardNo, cardPwd, Utility.Common.RequestIP))
                {
                    lblMsg.Text       = "充值卡[" + cardNo + "]充值成功,充值的游戏帐号(用户名)是" + userName + "!" + DateTime.Now;
                    txtUserName.Text  = string.Empty;
                    txtUserName2.Text = string.Empty;
                    txtCardNo.Text    = string.Empty;
                    txtValidCode.Text = string.Empty;
                }
                else
                {
                    lblMsg.Text       = "抱歉,点卡充值失败,可能是服务器繁忙,请稍候再试!";
                    txtValidCode.Text = string.Empty;
                }
            }
        }
Esempio n. 13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string toUrl = "/Manage/Pay/15173pay/Default.aspx";
            //支付人
            string userName = Utility.Common.GetStringOfForm("txtUserName");

            BLL.Member mem = new BLL.Member();
            if (!mem.ExistName(userName))
            {
                CommonManager.Web.RegJs(this, "alert('找不到您输入的用户,请重新核对。');history.back();", false);
                return;
            }

            //支付金额
            string payMoney = Utility.Common.GetStringOfForm("PayMoney");

            if (string.IsNullOrEmpty(payMoney) || !CommonManager.String.IsInteger(payMoney) || int.Parse(payMoney) <= 0)
            {
                CommonManager.Web.RegJs(this, "alert('金额只能输入大于0的整数。');history.back();", false);
                return;
            }
            int otherPayMoney = mem.UserTodayOtherPayMoney(userName.Trim());

            //是否超出今天充值限制额
            if (Convert.ToInt32(payMoney) > otherPayMoney)
            {
                Response.Write("<script>alert('您今天能充值金额数不能大于" + otherPayMoney + "。');location.href='" + toUrl + "';</script>");
                Response.End();
            }
            Pay15173 pays = new Pay15173();

            //商户ID
            pays.Bargainor_id = UiCommon.StringConfig.Pay15173ID;

            //商户密钥
            pays.Key = UiCommon.StringConfig.Pay15173Key;

            //商户订单号
            string out_trade_no = DateTime.Now.ToString("yyyyMMddHHmmssfffffff");

            pays.Sp_billno = out_trade_no;

            pays.Total_fee = Convert.ToDecimal(payMoney);
            //充值类型
            string payType = System.Web.HttpContext.Current.Request.Form["rdPayType"].ToString().Trim();

            pays.Pay_type = payType;

            //返回页面
            pays.Return_url = UiCommon.StringConfig.WebSiteName + "/Manage/Pay/15173pay/Return.aspx";

            //交易单备注,留空
            pays.Attach = "CC";

            string typeInfoLog = string.Empty;

            switch (payType)
            {
            case "a":
                typeInfoLog = "15173神州行卡支付";
                break;

            case "b":
                typeInfoLog = "15173俊网一卡通支付";
                break;

            case "c":
                typeInfoLog = "15173盛大卡支付";
                break;

            case "d":
                typeInfoLog = "15173征途游戏卡支付";
                break;

            case "m":
                typeInfoLog = "15173网易一卡通支付";
                break;

            case "n":
                typeInfoLog = "15173搜狐一卡通支付";
                break;

            case "q":
                typeInfoLog = "15173久游一卡通支付";
                break;

            case "u":
                typeInfoLog = "15173完美一卡通支付";
                break;

            case "x":
                typeInfoLog = "15173联通全国充值卡支付";
                break;

            case "y":
                typeInfoLog = "15173中国电信付费充值卡支付";
                break;

            case "f":
                typeInfoLog = "15173金山一卡通支付";
                break;

            case "g":
                typeInfoLog = "15173光宇一卡通支付";
                break;

            case "e":
                typeInfoLog = "15173纵游一卡通支付";
                break;
            }
            int payTypeLog = 5;

            mem.Add3PayOrder(userName, Convert.ToInt32(payMoney), payTypeLog, typeInfoLog, out_trade_no);
            string url = "";

            if (!pays.GetPayUrl(out url))
            {
                Utility.Common.OutMsgBox(url, toUrl);
            }
            else
            {
                Response.Redirect(url);
            }
        }
Esempio n. 14
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            //非法操作时重定向的URL地址
            //     string toUrl = "/Manage/Pay/Yeepay2/Default.aspx";
            //银行支付通道编码
            //与易宝的交易订单号
            string out_trade_no = string.Empty;

            string bankCode = CommonManager.Web.Request("params", "").Trim();

            if (bankCode.ToUpper() == "BANK")   //网银充值
            {
                bankCode     = CommonManager.Web.RequestForm("rtypeBank", "").ToUpper();
                payType      = "银行卡充值";
                out_trade_no = DateTime.Now.ToString("yyyyMMddHHmmssfffffff");
            }
            else  //点卡充值
            {
                bankCode     = CommonManager.Web.RequestForm("rtype", "").ToUpper();
                out_trade_no = "ka" + DateTime.Now.ToString("yyMMddHHmmssfffffff");
                switch (bankCode.ToLower())
                {
                case "szx-net":
                    payType = "神州行充值卡充值";
                    break;

                case "unicom-net":
                    payType = "联通卡充值";
                    break;

                case "ypcard-net":
                    payType = "易宝一卡通充值";
                    break;

                case "zhengtu-net":
                    payType = "征途游戏卡充值";
                    break;

                case "sndacard-net":
                    payType = "盛大游戏卡充值";
                    break;

                case "qqcard-net":
                    payType = "Q币支付";
                    break;

                case "junnet-net":
                    payType = "全国骏网一卡通充值";
                    break;
                }
            }


            BLL.Member mem      = new BLL.Member();
            string     userName = txtUserName.Text.Trim();

            //判断输入的用户是否存在
            if (!mem.ExistName(userName))
            {
                Response.Write("<script>alert('找不到您要充值的用户帐号,请检查输入是否有误');history.go(-1);</script>");
                Response.End();
            }
            //判断玩家充值时,不能在游戏中
            if (mem.IsInRoomOrGame(userName))
            {
                Response.Write("<script>alert('要充值的帐号正在游戏中,请先退出游戏再进行充值');history.go(-1);</script>");
                Response.End();
            }
            string money = PayMoney.Text.Trim();

            //判断面值是否正确
            if (string.IsNullOrEmpty(money) || !CommonManager.String.IsInteger(money) || int.Parse(money) <= 0)
            {
                CommonManager.Web.RegJs(this, "alert('金额只能输入大于0的整数。');history.back();", false);
                return;
            }

            int otherPayMoney = mem.UserTodayOtherPayMoney(userName);

            //是否超出今天充值限制额
            if (Convert.ToInt32(money) > otherPayMoney)
            {
                Response.Write("<script>alert('您今天能充值金额数不能大于" + otherPayMoney + "。');history.go(-1);</script>");
                Response.End();
            }


            //接收第三方支付平台返回支付结果的页面地址,为绝对地址
            string receivePageUrl = UiCommon.StringConfig.WebSiteName + "/Manage/pay/Yeepay2/Return.aspx";
            //商品名称(商户)
            string companyName = UiCommon.StringConfig.CompanyNameOfPay;
            //支付类型 Web_RMBCost.PayType
            int payTypeLog = 3;


            //类型信息 Web_RMBCost.Typeinfo
            string typeInfoLog = "易宝支付_" + payType;


            //插入支付订单日志
            //by YMH 2012-9-5  充值积分
            //积分充值存在
            if (ConfigurationManager.AppSettings["IsPayToPoint"] == "1" && rblPayType.SelectedValue == "point" && ddlGameList.SelectedValue != "")
            {
                pa_MP = "2"; //充积分
                new BLL.Member().Add3PayOrder(userName, Convert.ToInt32(money), typeInfoLog, out_trade_no, ddlGameList.SelectedValue);
            }
            else
            {
                pa_MP = "0"; //充金币
                new BLL.Member().Add3PayOrder(userName, Convert.ToInt32(money), payTypeLog, typeInfoLog, out_trade_no);
            }
            //开始调用支付网关



            //设置编码
            Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");


            //#if !debug
            #region 正式代码
            p1_MerId = StringConfig.YeepayMerID; // 商家ID
            keyValue = StringConfig.YeepayKey;   // 商家密钥
            Buy.NodeAuthorizationURL = StringConfig.YeepayNodeAuthorizationURL;
            #endregion
            //#endif


            p2_Order = out_trade_no;

            p3_Amt = money;

            //交易币种,固定值"CNY".
            p4_Cur = "CNY";

            //商品名称
            //用于支付时显示在易宝支付网关左侧的订单产品信息.
            p5_Pid = "";

            //商品种类
            p6_Pcat = "";

            //商品描述
            p7_Pdesc = "";
            //商户接收支付成功数据的地址,支付成功后易宝支付会向该地址发送两次成功通知.
            p8_Url = UiCommon.StringConfig.WebSiteName + "/Manage/Pay/Yeepay2/Return.aspx";
            //送货地址
            //为“1”: 需要用户将送货地址留在易宝支付系统;为“0”: 不需要,默认为 ”0”.
            p9_SAF = "0";

            //商户扩展信息
            //商户可以任意填写1K 的字符串,支付成功时将原样返回.	用这个字段判断是否是点卡 点卡手续费20%
            //   pa_MP = "";

            //银行编码
            //默认为"",到易宝支付网关.若不需显示易宝支付的页面,直接跳转到各银行、神州行支付、骏网一卡通等支付页面,该字段可依照附录:银行列表设置参数值.
            pd_FrpId = bankCode;


            //应答机制
            //为"1": 需要应答机制;为"0": 不需要应答机制.
            pr_NeedResponse = "1";

            // Response.Write(p1_MerId.ToString() + " <br> " + keyValue.ToString() + " <br> " + p2_Order.ToString() + " <br> " + p3_Amt.ToString() + " <br> " + p4_Cur.ToString() + " <br> " + p5_Pid.ToString() + " <br> " + p6_Pcat.ToString() + " <br> " + p7_Pdesc.ToString() + " <br> " + p8_Url.ToString() + " <br> " + p9_SAF.ToString() + " <br> " + pa_MP.ToString() + " <br> " + pd_FrpId.ToString() + " <br> " + pr_NeedResponse);
            // Response.End();

            Response.Redirect(Buy.CreateBuyUrl(p1_MerId, keyValue, p2_Order, p3_Amt, p4_Cur, p5_Pid, p6_Pcat, p7_Pdesc, p8_Url, p9_SAF, pa_MP, pd_FrpId, pr_NeedResponse));
        }
Esempio n. 15
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            //非法操作时重定向的URL地址
            //     string toUrl = "/Manage/Pay/Yeepay2/Default.aspx";
            //银行支付通道编码
            //与易宝的交易订单号
            string out_trade_no = string.Empty;

            string bankCode = CommonManager.Web.Request("params", "").Trim();

            if (bankCode.ToUpper() == "BANK")   //网银充值
            {
                bankCode = CommonManager.Web.RequestForm("rtypeBank", "").ToUpper();
                payType = "银行卡充值";
                out_trade_no = DateTime.Now.ToString("yyyyMMddHHmmssfffffff");
            }
            else  //点卡充值
            {
                bankCode = CommonManager.Web.RequestForm("rtype", "").ToUpper();
                out_trade_no ="ka" + DateTime.Now.ToString("yyMMddHHmmssfffffff");
                switch (bankCode.ToLower())
                {
                    case "szx-net":
                        payType = "神州行充值卡充值";
                        break;
                    case "unicom-net":
                        payType = "联通卡充值";
                        break;
                    case "ypcard-net":
                        payType = "易宝一卡通充值";
                        break;
                    case "zhengtu-net":
                        payType = "征途游戏卡充值";
                        break;
                    case "sndacard-net":
                        payType = "盛大游戏卡充值";
                        break;
                    case "qqcard-net":
                        payType = "Q币支付";
                        break;
                    case "junnet-net":
                        payType = "全国骏网一卡通充值";
                        break;

                }
            }

            BLL.Member mem = new BLL.Member();
            string userName = txtUserName.Text.Trim();
            //判断输入的用户是否存在
            if (!mem.ExistName(userName))
            {
                Response.Write("<script>alert('找不到您要充值的用户帐号,请检查输入是否有误');history.go(-1);</script>");
                Response.End();
            }
            //判断玩家充值时,不能在游戏中
            if (mem.IsInRoomOrGame(userName))
            {
                Response.Write("<script>alert('要充值的帐号正在游戏中,请先退出游戏再进行充值');history.go(-1);</script>");
                Response.End();

            }
            string money = PayMoney.Text.Trim();
            //判断面值是否正确
            if (string.IsNullOrEmpty(money) || !CommonManager.String.IsInteger(money) || int.Parse(money) <= 0)
            {
                CommonManager.Web.RegJs(this, "alert('金额只能输入大于0的整数。');history.back();", false);
                return;
            }

            int otherPayMoney = mem.UserTodayOtherPayMoney(userName);
            //是否超出今天充值限制额
            if (Convert.ToInt32(money) > otherPayMoney)
            {
                Response.Write("<script>alert('您今天能充值金额数不能大于" + otherPayMoney + "。');history.go(-1);</script>");
                Response.End();
            }

            //接收第三方支付平台返回支付结果的页面地址,为绝对地址
            string receivePageUrl = UiCommon.StringConfig.WebSiteName + "/Manage/pay/Yeepay2/Return.aspx";
            //商品名称(商户)
            string companyName = UiCommon.StringConfig.CompanyNameOfPay;
            //支付类型 Web_RMBCost.PayType
            int payTypeLog = 3;

            //类型信息 Web_RMBCost.Typeinfo
            string typeInfoLog = "易宝支付_" + payType;

            //插入支付订单日志
               //by YMH 2012-9-5  充值积分
               //积分充值存在
            if (ConfigurationManager.AppSettings["IsPayToPoint"] == "1" && rblPayType.SelectedValue == "point" && ddlGameList.SelectedValue != "")
            {
                pa_MP = "2"; //充积分
                new BLL.Member().Add3PayOrder(userName, Convert.ToInt32(money), typeInfoLog, out_trade_no,ddlGameList.SelectedValue);

            }
            else
            {
                pa_MP = "0"; //充金币
                new BLL.Member().Add3PayOrder(userName, Convert.ToInt32(money), payTypeLog, typeInfoLog, out_trade_no);
            }
            //开始调用支付网关

            //设置编码
            Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");

            //#if !debug
            #region 正式代码
            p1_MerId = StringConfig.YeepayMerID;                                     // 商家ID
            keyValue = StringConfig.YeepayKey;  // 商家密钥
            Buy.NodeAuthorizationURL = StringConfig.YeepayNodeAuthorizationURL;
            #endregion
            //#endif

            p2_Order = out_trade_no;

            p3_Amt = money;

            //交易币种,固定值"CNY".
            p4_Cur = "CNY";

            //商品名称
            //用于支付时显示在易宝支付网关左侧的订单产品信息.
            p5_Pid = "";

            //商品种类
            p6_Pcat = "";

            //商品描述
            p7_Pdesc = "";
            //商户接收支付成功数据的地址,支付成功后易宝支付会向该地址发送两次成功通知.
            p8_Url = UiCommon.StringConfig.WebSiteName + "/Manage/Pay/Yeepay2/Return.aspx";
            //送货地址
            //为“1”: 需要用户将送货地址留在易宝支付系统;为“0”: 不需要,默认为 ”0”.
            p9_SAF = "0";

            //商户扩展信息
            //商户可以任意填写1K 的字符串,支付成功时将原样返回.	用这个字段判断是否是点卡 点卡手续费20%
            //   pa_MP = "";

            //银行编码
            //默认为"",到易宝支付网关.若不需显示易宝支付的页面,直接跳转到各银行、神州行支付、骏网一卡通等支付页面,该字段可依照附录:银行列表设置参数值.
            pd_FrpId = bankCode;

            //应答机制
            //为"1": 需要应答机制;为"0": 不需要应答机制.
            pr_NeedResponse = "1";

               // Response.Write(p1_MerId.ToString() + " <br> " + keyValue.ToString() + " <br> " + p2_Order.ToString() + " <br> " + p3_Amt.ToString() + " <br> " + p4_Cur.ToString() + " <br> " + p5_Pid.ToString() + " <br> " + p6_Pcat.ToString() + " <br> " + p7_Pdesc.ToString() + " <br> " + p8_Url.ToString() + " <br> " + p9_SAF.ToString() + " <br> " + pa_MP.ToString() + " <br> " + pd_FrpId.ToString() + " <br> " + pr_NeedResponse);
               // Response.End();

            Response.Redirect(Buy.CreateBuyUrl(p1_MerId, keyValue, p2_Order, p3_Amt, p4_Cur, p5_Pid, p6_Pcat, p7_Pdesc, p8_Url, p9_SAF, pa_MP, pd_FrpId, pr_NeedResponse));
        }
Esempio n. 16
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            /*
            show_url          ="www.xiaohhgame.com"                   '网站的网址
            seller_email		= "*****@*****.**"				'请设置成您自己的支付宝帐户
            partner			= "2088102335433231"					'支付宝的账户的合作者身份ID
            key			    = "7a7kaee4ogm8lwywepjgpgkcek9pcnl3"	'支付宝的安全校验码

            notify_url			= "http://www.xiaohhgame.com/alipay/Alipay_Notify.asp"	'付完款后服务器通知的页面 要用 http://格式的完整路径
            return_url			= "http://www.xiaohhgame.com/alipay/return_Alipay_Notify.asp"	'付完款后跳转的页面 要用 http://格式的完整路径
            */

            //商品名称(商户)(此参数可以后台配置的)
            string companyName = UiCommon.StringConfig.CompanyNameOfPay;

            //支付人(也就是登录的用户账号)
            string userName = txtUserName.Text.Trim();
            BLL.Member mem = new BLL.Member();
            if (!mem.ExistName(userName))//验证用户名是否存在
            {
                CommonManager.Web.RegJs(this, "alert('找不到您输入的用户,请重新核对。');history.back();", false);
                return;
            }

            //支付金额
            string payMoney = PayMoney.Text.Trim();//从前台得到支付的金额
            if (string.IsNullOrEmpty(payMoney) || !CommonManager.String.IsInteger(payMoney) || int.Parse(payMoney) <= 0)//验证金额的合法性
            {
                CommonManager.Web.RegJs(this, "alert('金额只能输入大于0的整数。');history.back();", false);
                return;
            }

            //支付类型 Web_RMBCost.PayType  此值固定
            int payTypeLog = 4;

            //类型信息 Web_RMBCost.Typeinfo  此值固定
            string typeInfoLog = "支付宝在线支付";

            //*****************业务参数赋值*****************************************************************
            //订单号(按时构造)
            /*System.DateTime currentTime = new System.DateTime();
            currentTime = System.DateTime.Now;
            string out_trade_no = currentTime.ToString("g");
            out_trade_no = out_trade_no.Replace("-", "");
            out_trade_no = out_trade_no.Replace(":", "");
            out_trade_no = out_trade_no.Replace(" ", "");*/
            string out_trade_no = DateTime.Now.ToString("yyyyMMddHHmmssfffffff");//此值固定

            //支付接口 https://www.alipay.com/cooperate/gateway.do?
            string gateway = UiCommon.StringConfig.AlipayNotifyURL;//此值在web.config中配置

            //服务参数
            string service = "create_direct_pay_by_user";//此值固定

            //partner 合作伙伴ID(保留字段)
            string partner = UiCommon.StringConfig.AlipayPartnerID;//此值在web.config中配置

            //加密类型
            string sign_type = "MD5";//此值固定

            //subject 商品名称
            string subject = companyName;

            //body 商品描述
            string body = "游戏金币";//此值可以自定义

            //支付类型
            string payment_type = "1";//此值固定

            //总金额 0.01~50000.00
            string total_fee = payMoney;

            //网站的网址
            string show_url = UiCommon.StringConfig.WebSiteName;// 支付宝页面显示<a href="www.xiaohhgame.com" target="_blank">商品名称</a> ;

            //卖家账号
            string seller_email = UiCommon.StringConfig.AlipayAccount; //此值在web.config中配置

            //partner账户的支付宝安全校验码
            string key = UiCommon.StringConfig.AlipayKey; //此值在web.config中配置

            //服务器通知返回接口,这个页面可以展示给客户看,只有付款成功才会跳转到这个页面
            string return_url = UiCommon.StringConfig.WebSiteName + "/Manage/Pay/Alipay/Alipay_Return.aspx";

            //服务器通知返回接口  这个页面是支付宝发过来确定信息后网站更新数据,然后再给支付宝发送确定信息

            string notify_url = UiCommon.StringConfig.WebSiteName + "/Manage/Pay/Alipay/Alipay_Notify.aspx";

            string _input_charset = "utf-8";

            //支付成功前, 插入支付的订单日志
            mem.Add3PayOrder(userName, Convert.ToInt32(payMoney), payTypeLog, typeInfoLog, out_trade_no);

            //把支付数据提交到支付宝服务器
            AliPay ap = new AliPay();
            string aliay_url = ap.CreatUrl(
                gateway,
                service,
                partner,
                sign_type,
                out_trade_no,
                subject,
                body,
                payment_type,
                total_fee,
                show_url,
                seller_email,
                key,
                return_url,
                _input_charset,
                notify_url
                );

            Response.Redirect(aliay_url);
        }
Esempio n. 17
0
        protected void button5_ServerClick(object sender, EventArgs e)
        {
            if (!BCST.Common.CommonManager.Web.CheckPostSource())
                return;
            //1.У����֤��
            if (UiCommon.ValidCode.CurrentCode == null)
            {
                lblMsg.Text = "��֤���ѹ��ڣ��������µ���֤�룡";
                txtValidCode.Text = string.Empty;
                return;
            }
            else if (txtValidCode.Text.Trim() != UiCommon.ValidCode.CurrentCode)
            {
                lblMsg.Text = "��֤����������������µ���֤�룡";
                txtValidCode.Text = string.Empty;
                return;
            }

            //2.�ж��û����Ƿ����
            BLL.Member member = new BLL.Member();
            string userName = Utility.Common.SqlEncode(txtUserName.Text.Trim());
            if (!member.ExistName(userName))
            {
                lblMsg.Text = "���������Ϸ�ʺ�(�û���)�����ڣ�";
                txtValidCode.Text = string.Empty;
                return;
            }
            //�ж���ҳ�ֵʱ����������Ϸ��
            if (member.IsInRoomOrGame(userName))
            {
                lblMsg.Text = "Ҫ��ֵ���ʺ�������Ϸ�У������˳���Ϸ�ٽ��г�ֵ��";
                txtValidCode.Text = string.Empty;
                return;

            }
            //3.�жϳ�ֵ���Ƿ��ѳ�ֵ���򿨺ż��������
            string cardNo = Utility.Common.SqlEncode(txtCardNo.Text.Trim());
            string cardPwd = Utility.Common.SqlEncode(txtCardPwd.Text.Trim());
            int cardState = new BLL.Card().PointCardState(cardNo, cardPwd);
            if (cardState == -1)
            {
                lblMsg.Text = "�Բ���������Ŀ��Ż���������";
                txtValidCode.Text = string.Empty;
                return;
            }
            else if (cardState == 1)
            {
                lblMsg.Text = "�Բ���������Ŀ����Ѿ�����ֵ��";
                txtValidCode.Text = string.Empty;
                return;
            }

            #region ��ѿ�

            // ��ѿ�������
            int freeCardForUser = 0;
            DataRow dr = member.GetFreeCardCount();
            if (dr != null)
            {
            freeCardForUser = Convert.ToInt32(dr["FreeCardCount"]);
            }

            //������ѿ������ж��û��Ƿ��Ѿ���ֵ��XX�š��磺��ѿ�ÿ���û�ֻ�ܳ�ֵ2�š�
            if (member.IsFreeCard(cardNo))
            {
            int cardCount = member.FreeCardCount(userName);
            if (cardCount >= freeCardForUser)
            {
                lblMsg.Text = "���Ѿ�ʹ��" + freeCardForUser + "����ѿ��ˣ�";
                txtValidCode.Text = string.Empty;
                return;
            }
            }
            #endregion

            //4.����ֵ���ת���ɽ�Ҵ�������
            //����ֵ�û�������Ƽ��ˣ���Web_Config�и��ݲ���ֵ�����Ƽ���
            //���µ㿨״̬
            //by YMH 2012-9-4  ��ֵ����
             //���ֳ�ֵ����
            if (ConfigurationManager.AppSettings["IsPayToPoint"] == "1" && rblPayType.SelectedValue=="point" && ddlGameList.SelectedValue!="")
            {
            //��ֵ����
            int result = member.PointCardFull2(userName, cardNo, cardPwd, Utility.Common.RequestIP,ddlGameList.SelectedValue);
            if (result == 0)
            {
                lblMsg.Text = "��ֵ��[" + cardNo + "]��ֵ�ɹ�����ֵ����Ϸ�ʺ�(�û���)��" + userName + "��" + DateTime.Now;
                txtUserName.Text = string.Empty;
                txtUserName2.Text = string.Empty;
                txtCardNo.Text = string.Empty;
                txtValidCode.Text = string.Empty;
            }
            else if (result == -1)
            {
                lblMsg.Text = "��Ǹ���㿨�����ڻ�㿨�š����벻��ȷ��";
                txtValidCode.Text = string.Empty;
            }
            else
            {
                lblMsg.Text = "��Ǹ���㿨��ֵʧ�ܣ������Ƿ�������æ�����Ժ����ԣ�";
                txtValidCode.Text = string.Empty;
            }
            }
            else//��ֵ���
            {
            if (member.PointCardFull(userName, cardNo, cardPwd, Utility.Common.RequestIP))
            {
                lblMsg.Text = "��ֵ��[" + cardNo + "]��ֵ�ɹ�����ֵ����Ϸ�ʺ�(�û���)��" + userName + "��" + DateTime.Now;
                txtUserName.Text = string.Empty;
                txtUserName2.Text = string.Empty;
                txtCardNo.Text = string.Empty;
                txtValidCode.Text = string.Empty;
            }
            else
            {
                lblMsg.Text = "��Ǹ���㿨��ֵʧ�ܣ������Ƿ�������æ�����Ժ����ԣ�";
                txtValidCode.Text = string.Empty;
            }
            }
        }
Esempio n. 18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string errorUrl = "/Manage/Pay/KF/Default.aspx";   //出错跳转地址

            BLL.Member mem = new BLL.Member();

            string txtUserName = Utility.Common.GetStringOfForm("txtUserName");   //用户名

            if (!mem.ExistName(txtUserName.Trim()))
            {
                Response.Write("<script>alert('找不到您要充值的用户帐号,请检查输入是否有误');location.href='" + errorUrl + "';</script>");
                Response.End();
            }

            //支付金额
            string payMoney = Utility.Common.GetStringOfForm("PayMoney");

            if (string.IsNullOrEmpty(payMoney) || !CommonManager.String.IsInteger(payMoney) || int.Parse(payMoney) <= 0)
            {
                CommonManager.Web.RegJs(this, "alert('金额只能输入大于0的整数。');history.back();", false);
                return;
            }
            int otherPayMoney = mem.UserTodayOtherPayMoney(txtUserName.Trim());

            //是否超出今天充值限制额
            if (Convert.ToInt32(payMoney) > otherPayMoney)
            {
                Response.Write("<script>alert('您今天能充值金额数不能大于" + otherPayMoney + "。');location.href='" + errorUrl + "';</script>");
                Response.End();
            }
            //充值类型
            string payType    = Utility.Common.GetStringOfForm("channelId");
            string P_CardId   = string.Empty;
            string P_CardPass = string.Empty;

            if (payType != "1" && payType != "2" && payType != "3")
            {
                P_CardId   = Utility.Common.GetStringOfForm("CardNo");
                P_CardPass = Utility.Common.GetStringOfForm("CardPwd");
            }
            else
            {
            }
            int payTypeLog = 8;
            //商户定单编号
            string P_OrderId = DateTime.Now.ToString("yyyyMMddHHmmssfffffff");

            //支付成功前, 插入支付的订单日志
            mem.Add3PayOrder(txtUserName, Convert.ToInt32(payMoney), payTypeLog, "花旗充值", P_OrderId);
            //商户编号
            string P_UserId = UiCommon.StringConfig.KFPayID;
            //面值
            string P_FaceValue = payMoney + ".00";
            //充值类型
            string P_ChannelId = payType;
            //产品名称
            string P_Subject = "";
            //产品价格
            string P_Price = payMoney + ".00";

            //产品数量
            string P_Quantity = "1";
            //产品描述
            string P_Description = "";
            //用户附加信息
            string P_Notic = "";
            //充值状态通知地址
            string P_Result_URL = UiCommon.StringConfig.WebSiteName + "/Manage/Pay/KF/Result.aspx";
            //充值后网页跳转地址
            string P_Notify_URL = UiCommon.StringConfig.WebSiteName + "/Manage/Pay/KF/Return.aspx";
            //密钥
            string SalfStr = UiCommon.StringConfig.KFPayKey;
            //签名认证
            string preEncodeStr = P_UserId + "|" + P_OrderId + "|" + P_CardId + "|" + P_CardPass + "|" + P_FaceValue + "|" + P_ChannelId + "|" + SalfStr;
            string P_PostKey    = Utility.Common.md5(preEncodeStr);
            //Response.Write(P_PostKey+"</br>"+Utility.Common.md5(preEncodeStr).ToUpper());
            //Response.End();
            //接口url
            string url = UiCommon.StringConfig.KFNotifyURL + "P_UserId=" + P_UserId + "&P_OrderId=" + P_OrderId + "&P_CardId=" + P_CardId + "&P_CardPass="******"&P_FaceValue=" + P_FaceValue + "&P_ChannelId=" + P_ChannelId + "&P_Subject=" + P_Subject + "&P_Price="
                         + P_Price + "&P_Quantity=" + P_Quantity + "&P_Description=" + P_Description + "&P_Notic=" + P_Notic + "&P_PostKey=" + P_PostKey
                         + "&P_Result_url=" + P_Result_URL + "&P_Notify_URL=" + P_Notify_URL;

            Response.Redirect(url);
        }
Esempio n. 19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string errorUrl,strMd5Key, txtUserName;
            int intPayType, intBankID, intCardID;

            errorUrl = "/Manage/Pay/Baofoo/Default.aspx"; //出错跳转地址
            strMerchant_url = UiCommon.StringConfig.WebSiteName + "/Manage/Pay/Baofoo/return_url.aspx"; //客户端跳转地址
            strReturn_url = UiCommon.StringConfig.WebSiteName + "/Manage/Pay/Baofoo/merchant_url.aspx";//服务器端返回地址
            strMerchantID = ConfigurationManager.AppSettings["baofoo_memberid"]; //商户号
            strMd5Key = ConfigurationManager.AppSettings["baofoo_key"]; //密钥 双方约定
            txtUserName = Utility.Common.GetStringOfForm("txtUserName"); //用户名
            payMoney = Utility.Common.GetIntOfForm("PayMoney").ToString(); //支付金额

            strCouponNum = Utility.Common.GetStringOfForm("CouponNum");

            strTradeDate = DateTime.Now.ToString("yyyyMMddHHmmss"); //交易日期

            //strPayID = Request.Params["SPayID"];//神州行卡充值是1

            intPayType = Utility.Common.GetIntOfForm("pay_type"); //支付方式
            intBankID = Utility.Common.GetIntOfForm("bankid");  //银行对应的ID
            intCardID = Utility.Common.GetIntOfForm("cardid");  //点卡对应的ID

            if (intPayType == 1) //银行支付
            {
                strPayID = intBankID.ToString();
                strTransID = DateTime.Now.ToString("yyyyMMddHHmmssffff"); //商户订单号(交易流水号)8-20位:必须唯一,推荐:前6位为商户号,后10位为用户流水号,string类型
            }
            else //点卡支付
            {
                strPayID = intCardID.ToString();
                strTransID = "ka" + DateTime.Now.ToString("yyMMddHHmmssffff");
            }

            BLL.Member mem = new BLL.Member();
            //判断用户帐号是否正常
            if (!mem.ExistName(txtUserName.Trim()))
            {
                Response.Write("<script>alert('找不到您要充值的用户帐号,请检查输入是否有误');location.href='" + errorUrl + "';</script>");
                Response.End();
            }

            if (mem.IsInRoomOrGame(txtUserName.Trim()))
            {
                Response.Write("<script>alert('要充值的帐号正在游戏中,请先退出游戏再进行充值。');location.href='" + errorUrl + "';</script>");
                Response.End();
            }

            strProductName = "";//商品名称
            strAmount = "1";//商品数量,为1
            strProductLogo = "";//商品图片地址
            strUsername = "";
            strEmail = "";
            strMobile = "";

            // [modify] jeffery
            strAdditionalInfo = "";
            //strAdditionalInfo = txtUserName + "!@#" + strCouponNum;
            // ---end

            strNoticeType = "1";//0 不跳转 1 会跳转

            //商户保存订单信息.....
            //SaveOrderInfo();
            //支付成功前, 插入支付的订单日志

            mem.Add3PayOrder(txtUserName.Trim(),
                Convert.ToInt32(payMoney),
                8, "宝付充值", strTransID);

            payMoney = (Convert.ToInt32(payMoney) * 100).ToString();

            strMd5Sign = GetMd5Sign(strMerchantID, strPayID, strTradeDate,
                strTransID, payMoney, strMerchant_url, strReturn_url, strNoticeType, strMd5Key);
        }
Esempio n. 20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string errorUrl, strMd5Key, txtUserName;
            int    intPayType, intBankID, intCardID;


            errorUrl        = "/Manage/Pay/Baofoo/Default.aspx";                                          //出错跳转地址
            strMerchant_url = UiCommon.StringConfig.WebSiteName + "/Manage/Pay/Baofoo/return_url.aspx";   //客户端跳转地址
            strReturn_url   = UiCommon.StringConfig.WebSiteName + "/Manage/Pay/Baofoo/merchant_url.aspx"; //服务器端返回地址
            strMerchantID   = ConfigurationManager.AppSettings["baofoo_memberid"];                        //商户号
            strMd5Key       = ConfigurationManager.AppSettings["baofoo_key"];                             //密钥 双方约定
            txtUserName     = Utility.Common.GetStringOfForm("txtUserName");                              //用户名
            payMoney        = Utility.Common.GetIntOfForm("PayMoney").ToString();                         //支付金额

            strCouponNum = Utility.Common.GetStringOfForm("CouponNum");

            strTradeDate = DateTime.Now.ToString("yyyyMMddHHmmss"); //交易日期

            //strPayID = Request.Params["SPayID"];//神州行卡充值是1

            intPayType = Utility.Common.GetIntOfForm("pay_type"); //支付方式
            intBankID  = Utility.Common.GetIntOfForm("bankid");   //银行对应的ID
            intCardID  = Utility.Common.GetIntOfForm("cardid");   //点卡对应的ID

            if (intPayType == 1)                                  //银行支付
            {
                strPayID   = intBankID.ToString();
                strTransID = DateTime.Now.ToString("yyyyMMddHHmmssffff"); //商户订单号(交易流水号)8-20位:必须唯一,推荐:前6位为商户号,后10位为用户流水号,string类型
            }
            else //点卡支付
            {
                strPayID   = intCardID.ToString();
                strTransID = "ka" + DateTime.Now.ToString("yyMMddHHmmssffff");
            }


            BLL.Member mem = new BLL.Member();
            //判断用户帐号是否正常
            if (!mem.ExistName(txtUserName.Trim()))
            {
                Response.Write("<script>alert('找不到您要充值的用户帐号,请检查输入是否有误');location.href='" + errorUrl + "';</script>");
                Response.End();
            }

            if (mem.IsInRoomOrGame(txtUserName.Trim()))
            {
                Response.Write("<script>alert('要充值的帐号正在游戏中,请先退出游戏再进行充值。');location.href='" + errorUrl + "';</script>");
                Response.End();
            }



            strProductName = "";  //商品名称
            strAmount      = "1"; //商品数量,为1
            strProductLogo = "";  //商品图片地址
            strUsername    = "";
            strEmail       = "";
            strMobile      = "";

            // [modify] jeffery
            strAdditionalInfo = "";
            //strAdditionalInfo = txtUserName + "!@#" + strCouponNum;
            // ---end

            strNoticeType = "1";//0 不跳转 1 会跳转

            //商户保存订单信息.....
            //SaveOrderInfo();
            //支付成功前, 插入支付的订单日志

            mem.Add3PayOrder(txtUserName.Trim(),
                             Convert.ToInt32(payMoney),
                             8, "宝付充值", strTransID);

            payMoney = (Convert.ToInt32(payMoney) * 100).ToString();

            strMd5Sign = GetMd5Sign(strMerchantID, strPayID, strTradeDate,
                                    strTransID, payMoney, strMerchant_url, strReturn_url, strNoticeType, strMd5Key);
        }