Exemplo n.º 1
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, "");
        }
Exemplo 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,"");
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
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);
        }
Exemplo 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);
        }
Exemplo 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);
               }
        }
Exemplo 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);
            }
        }
Exemplo n.º 9
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);
        }
Exemplo 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;
            }
            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);
        }
Exemplo n.º 11
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);
            }
        }
Exemplo n.º 12
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);
            }
        }
Exemplo n.º 13
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);
        }