protected void Page_Load(object sender, EventArgs e)
        {
            string str = ApplicationSettings.Get("key_th");
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary["versionId"]     = base.Request["versionId"];
            dictionary["transType"]     = base.Request["transType"];
            dictionary["asynNotifyUrl"] = base.Request["asynNotifyUrl"];
            dictionary["synNotifyUrl"]  = base.Request["synNotifyUrl"];
            dictionary["merId"]         = base.Request["merId"];
            dictionary["orderAmount"]   = base.Request["orderAmount"];
            dictionary["prdOrdNo"]      = base.Request["prdOrdNo"];
            dictionary["orderStatus"]   = base.Request["orderStatus"];
            dictionary["payId"]         = base.Request["payId"];
            dictionary["payTime"]       = base.Request["payTime"];
            dictionary["signType"]      = base.Request["signType"];
            dictionary = (
                from p in dictionary
                orderby p.Key
                select p).ToDictionary <KeyValuePair <string, string>, string, string>((KeyValuePair <string, string> p) => p.Key, (KeyValuePair <string, string> o) => o.Value);
            string password = string.Concat(PayHelper.PrepareSign(dictionary), "&key=", str);

            dictionary["signData"] = base.Request["signData"];
            if (dictionary["orderStatus"] == "01")
            {
                string text = TextEncrypt.EncryptPassword(password);
                if (dictionary["signData"] == text)
                {
                    ShareDetialInfo shareDetialInfo = new ShareDetialInfo()
                    {
                        OrderID   = dictionary["prdOrdNo"],
                        IPAddress = Utility.UserIP,
                        PayAmount = Convert.ToDecimal(dictionary["orderAmount"]) / new decimal(100)
                    };
                    Message message = FacadeManage.aideTreasureFacade.FilliedOnline(shareDetialInfo, 0);
                    if (!message.Success)
                    {
                        Log.Write(message.Content);
                    }
                    else
                    {
                        base.Response.Write("SUCCESS");
                    }
                }
                else
                {
                    Log.Write(string.Concat("签名错误,mySign:", text, "——Sign=", dictionary["signData"]));
                    base.Response.Write("签名错误");
                }
            }
            else
            {
                Log.Write("支付系统错误");
                base.Response.Write("支付系统错误");
            }
        }
Beispiel #2
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            SortedDictionary <string, string> sortedDictionary = new SortedDictionary <string, string>();

            sortedDictionary["merchant_code"]      = base.Request.Form["merchant_code"];
            sortedDictionary["notify_type"]        = base.Request.Form["notify_type"];
            sortedDictionary["notify_id"]          = base.Request.Form["notify_id"];
            sortedDictionary["interface_version"]  = base.Request.Form["interface_version"];
            sortedDictionary["order_no"]           = base.Request.Form["order_no"];
            sortedDictionary["order_time"]         = base.Request.Form["order_time"];
            sortedDictionary["order_amount"]       = base.Request.Form["order_amount"];
            sortedDictionary["extra_return_param"] = base.Request.Form["extra_return_param"];
            sortedDictionary["trade_no"]           = base.Request.Form["trade_no"];
            sortedDictionary["trade_time"]         = base.Request.Form["trade_time"];
            sortedDictionary["trade_status"]       = base.Request.Form["trade_status"];
            sortedDictionary["bank_seq_no"]        = base.Request["bank_seq_no"];
            string plainText = PayHelper.PrepareSign(sortedDictionary);

            sortedDictionary["sign_type"] = base.Request.Form["sign_type"];
            sortedDictionary["sign"]      = base.Request.Form["sign"];
            if (!(sortedDictionary["sign_type"] == "RSA-S"))
            {
                Log.Write(JsonHelper.SerializeObject(sortedDictionary));
            }
            else
            {
                string publicKey = ApplicationSettings.Get("pubKey_zdb");
                publicKey = HttpHelp.RSAPublicKeyJava2DotNet(publicKey);
                if (!HttpHelp.ValidateRsaSign(plainText, publicKey, sortedDictionary["sign"]))
                {
                    Log.Write("验签失败:" + JsonHelper.SerializeObject(sortedDictionary));
                    base.Response.Write("验签失败");
                }
                else
                {
                    ShareDetialInfo shareDetialInfo = new ShareDetialInfo();
                    shareDetialInfo.OrderID   = sortedDictionary["order_no"];
                    shareDetialInfo.IPAddress = Utility.UserIP;
                    shareDetialInfo.PayAmount = System.Convert.ToDecimal(sortedDictionary["order_amount"]);
                    Message message = FacadeManage.aideTreasureFacade.FilliedOnline(shareDetialInfo, 0);
                    if (message.Success)
                    {
                        base.Response.Write("SUCCESS");
                    }
                    else
                    {
                        Log.Write(message.Content + ":" + JsonHelper.SerializeObject(sortedDictionary));
                        base.Response.Write(message.Content);
                    }
                }
            }
        }
Beispiel #3
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string str = ApplicationSettings.Get("key_jifubao");

            System.Collections.Generic.Dictionary <string, string> dictionary = new System.Collections.Generic.Dictionary <string, string>();
            dictionary["service"]   = "TRADE.NOTIFY";
            dictionary["merId"]     = base.Request["merId"];
            dictionary["tradeNo"]   = base.Request["tradeNo"];
            dictionary["tradeDate"] = base.Request["tradeDate"];
            dictionary["opeNo"]     = base.Request["opeNo"];
            dictionary["opeDate"]   = base.Request["opeDate"];
            dictionary["amount"]    = base.Request["amount"];
            dictionary["status"]    = base.Request["status"];
            dictionary["extra"]     = "";
            dictionary["payTime"]   = base.Request["payTime"];
            string str2 = PayHelper.PrepareSign(dictionary);
            string text = TextEncrypt.EncryptPassword(str2 + str).ToLower();

            dictionary["sign"]       = base.Request["sign"];
            dictionary["notifyType"] = base.Request["notifyType"];
            if (!(text.ToLower() == dictionary["sign"].ToLower()))
            {
                Log.Write("签名错误" + dictionary["tradeNo"]);
                base.Response.Write("签名错误");
            }
            else
            {
                ShareDetialInfo shareDetialInfo = new ShareDetialInfo();
                shareDetialInfo.OrderID   = dictionary["tradeNo"];
                shareDetialInfo.IPAddress = Utility.UserIP;
                shareDetialInfo.PayAmount = System.Convert.ToDecimal(dictionary["amount"]);
                Message message = FacadeManage.aideTreasureFacade.FilliedOnline(shareDetialInfo, 0);
                if (message.Success)
                {
                    Log.Write("充值成功" + dictionary["tradeNo"]);
                    base.Response.Write("success");
                }
                else
                {
                    Log.Write(message.Content + dictionary["tradeNo"]);
                }
            }
        }
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string str = ApplicationSettings.Get("key_e");
            SortedDictionary <string, string> sortedDictionary = new SortedDictionary <string, string>();

            sortedDictionary["dd"]           = base.Request["dd"];
            sortedDictionary["total_fee"]    = base.Request["total_fee"];
            sortedDictionary["out_trade_no"] = base.Request["out_trade_no"];
            sortedDictionary["partner"]      = base.Request["partner"];
            sortedDictionary["sign_type"]    = base.Request["sign_type"];
            sortedDictionary["charset"]      = base.Request["charset"];
            sortedDictionary["sign"]         = base.Request["sign"];
            sortedDictionary["msg"]          = base.Request["msg"];
            Log.Write("通知参数:" + JsonHelper.SerializeObject(sortedDictionary));
            string str2 = PayHelper.PrepareSign(sortedDictionary);
            string b    = TextEncrypt.EncryptPassword(str2 + str).ToLower();

            if (!(sortedDictionary["sign"].ToLower() == b))
            {
                Log.Write("签名错误:" + JsonHelper.SerializeObject(sortedDictionary));
                base.Response.Write("签名错误");
            }
            else
            {
                ShareDetialInfo shareDetialInfo = new ShareDetialInfo();
                shareDetialInfo.OrderID   = sortedDictionary["out_trade_no"];
                shareDetialInfo.IPAddress = Utility.UserIP;
                shareDetialInfo.PayAmount = System.Convert.ToDecimal(sortedDictionary["total_fee"]);
                Message message = FacadeManage.aideTreasureFacade.FilliedOnline(shareDetialInfo, 0);
                if (message.Success)
                {
                    base.Response.Write("SUCCESS");
                }
                else
                {
                    Log.Write(message.Content + ":" + JsonHelper.SerializeObject(sortedDictionary));
                }
            }
        }
Beispiel #5
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (!base.IsPostBack)
     {
         NameValueCollection form = System.Web.HttpContext.Current.Request.Form;
         foreach (string text in form)
         {
             if (text != "sign")
             {
                 this.dic.Add(text, form[text]);
             }
         }
         string str   = PayHelper.PrepareSign(this.dic) + "&key=" + this.key;
         string text2 = Jiami.MD5(str).ToUpper();
         if (text2.Equals(form["sign"]))
         {
             ShareDetialInfo shareDetialInfo = new ShareDetialInfo();
             shareDetialInfo.OrderID   = form["out_trade_no"];
             shareDetialInfo.IPAddress = Utility.UserIP;
             shareDetialInfo.PayAmount = System.Convert.ToDecimal(form["total_fee"]);
             Message message = FacadeManage.aideTreasureFacade.FilliedOnline(shareDetialInfo, 0);
             if (message.Success)
             {
                 base.Response.Write("success");
             }
             else
             {
                 Log.Write(message.Content);
             }
         }
         else
         {
             Log.Write(JsonHelper.SerializeObject(this.dic));
             base.Response.Write("Signature verification failed");
         }
     }
 }
Beispiel #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string formString = GameRequest.GetFormString("account");

            if (formString == "")
            {
                base.Response.Write("充值账号错误");
                base.Response.End();
            }
            int formInt = GameRequest.GetFormInt("amount", 0);

            if (formInt < 6)
            {
                base.Response.Write("充值金额不能低于6元");
                base.Response.End();
            }
            string      formString2 = GameRequest.GetFormString("type");
            OnLineOrder onLineOrder = new OnLineOrder()
            {
                OrderID = PayHelper.GetOrderIDByPrefix("th")
            };

            if (Fetch.GetUserCookie() != null)
            {
                onLineOrder.OperUserID = Fetch.GetUserCookie().UserID;
            }
            else
            {
                onLineOrder.OperUserID = 0;
            }
            onLineOrder.Accounts    = formString;
            onLineOrder.OrderAmount = formInt;
            onLineOrder.IPAddress   = GameRequest.GetUserIP();
            string str1 = formString2;
            string str2 = str1;

            if (str2 != null)
            {
                switch (str2)
                {
                case "alipay":
                {
                    onLineOrder.ShareID = 2;
                    break;
                }

                case "weixin":
                {
                    onLineOrder.ShareID = 3;
                    break;
                }

                case "alipay-scan":
                {
                    this.paytype        = "支付宝";
                    onLineOrder.ShareID = 4;
                    break;
                }

                case "weixin-scan":
                {
                    this.paytype        = "微信";
                    onLineOrder.ShareID = 5;
                    break;
                }

                case "qq":
                {
                    onLineOrder.ShareID = 6;
                    break;
                }

                case "kuaijie":
                {
                    onLineOrder.ShareID = 7;
                    break;
                }

                case "qq-scan":
                {
                    this.paytype        = "QQ";
                    onLineOrder.ShareID = 8;
                    break;
                }

                case "jd":
                {
                    onLineOrder.ShareID = 9;
                    break;
                }

                case "baidu":
                {
                    onLineOrder.ShareID = 10;
                    break;
                }

                default:
                {
                    goto Label0;
                }
                }
            }
            else
            {
                goto Label0;
            }
Label1:
            Message message = FacadeManage.aideTreasureFacade.RequestOrder(onLineOrder);

            if (!message.Success)
            {
                base.Response.Write(message.Content);
                base.Response.End();
            }
            string gateway = ApplicationSettings.Get("url_th");
            string value   = ApplicationSettings.Get("parter_th");
            string str     = ApplicationSettings.Get("key_th");
            string text    = ApplicationSettings.Get("pay_url");

            if (text == "")
            {
                text = string.Concat("http://", base.Request.Url.Host);
            }
            string orderID = onLineOrder.OrderID;
            string value2  = string.Concat(text, "/pay/tonghui/notify_url.aspx");
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary["versionId"]     = "1";
            dictionary["orderAmount"]   = (formInt * 100).ToString();
            dictionary["orderDate"]     = DateTime.Now.ToString("yyyyMMddHHmmss");
            dictionary["currency"]      = "RMB";
            dictionary["accountType"]   = "0";
            dictionary["transType"]     = "008";
            dictionary["asynNotifyUrl"] = value2;
            dictionary["synNotifyUrl"]  = value2;
            dictionary["signType"]      = "MD5";
            dictionary["merId"]         = value;
            dictionary["prdOrdNo"]      = orderID;
            dictionary["payMode"]       = "0";
            dictionary["prdName"]       = "shop";
            dictionary["prdDesc"]       = "shop";
            dictionary["pnum"]          = "1";
            dictionary = (
                from p in dictionary
                orderby p.Key
                select p).ToDictionary <KeyValuePair <string, string>, string, string>((KeyValuePair <string, string> p) => p.Key, (KeyValuePair <string, string> o) => o.Value);
            string password = string.Concat(PayHelper.PrepareSign(dictionary), "&key=", str);

            dictionary["signData"] = TextEncrypt.EncryptPassword(password);
            base.Response.Write(PayHelper.BuildForm(dictionary, gateway));
            return;

Label0:
            onLineOrder.ShareID = 1;
            goto Label1;
        }
Beispiel #7
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string text     = ApplicationSettings.Get("partner_qianyifu");
            string text2    = ApplicationSettings.Get("key_qianyifu");
            string text3    = base.Request["returncode"];
            string text4    = base.Request["orderid"];
            string text5    = base.Request["money"];
            string text6    = base.Request["sign"];
            string arg_6C_0 = base.Request["ext"];
            string password = string.Format("returncode={0}&userid={1}&orderid={2}&money={3}&keyvalue={4}", new object[]
            {
                text3,
                text,
                text4,
                text5,
                text2
            });

            if (!(text6.ToLower() == TextEncrypt.EncryptPassword(password).ToLower()))
            {
                Log.Write("签名错误");
                base.Response.Write("签名错误");
            }
            else
            {
                if (!(text3 == "1"))
                {
                    Log.Write("商户业务数据失败处理:" + text4);
                    base.Response.Write("商户业务数据失败处理");
                }
                else
                {
                    string url = "http://wangguan.qianyifu.com:8881/gateway/query.asp";
                    System.Collections.Generic.Dictionary <string, string> dictionary = new System.Collections.Generic.Dictionary <string, string>();
                    dictionary["userid"]  = text;
                    dictionary["orderid"] = text4;
                    password           = string.Format("userid={0}&orderid={1}&keyvalue={2}", dictionary["userid"], dictionary["orderid"], text2);
                    dictionary["sign"] = TextEncrypt.EncryptPassword(password).ToLower();
                    string param = PayHelper.PrepareSign(dictionary);
                    string text7 = HttpHelper.HttpRequest(url, param, "get", "GB2312");
                    if (!text7.Contains("成功"))
                    {
                        Log.Write(text7 + ":" + text4);
                        base.Response.Write(text7);
                    }
                    else
                    {
                        text5 = text7.Substring(text7.IndexOf(":") + 1).Replace("元", "");
                        ShareDetialInfo shareDetialInfo = new ShareDetialInfo();
                        shareDetialInfo.OrderID   = text4;
                        shareDetialInfo.IPAddress = Utility.UserIP;
                        shareDetialInfo.PayAmount = System.Convert.ToDecimal(text5);
                        Message message = FacadeManage.aideTreasureFacade.FilliedOnline(shareDetialInfo, 0);
                        if (message.Success)
                        {
                            base.Response.Write("success");
                        }
                        else
                        {
                            Log.Write(message.Content);
                        }
                    }
                }
            }
        }
Beispiel #8
0
		protected void Page_Load(object sender, System.EventArgs e)
		{
			string formString = GameRequest.GetFormString("account");
			if (formString == "")
			{
				base.Response.Write("充值账号错误");
				base.Response.End();
			}
			int formInt = GameRequest.GetFormInt("amount", 0);
			if (formInt < 1)
			{
				base.Response.Write("充值金额不能低于1元");
				base.Response.End();
			}
			string text = GameRequest.GetFormString("type");
			OnLineOrder onLineOrder = new OnLineOrder();
			onLineOrder.OrderID = PayHelper.GetOrderIDByPrefix("sl");
			if (Fetch.GetUserCookie() == null)
			{
				onLineOrder.OperUserID = 0;
			}
			else
			{
				onLineOrder.OperUserID = Fetch.GetUserCookie().UserID;
			}
			onLineOrder.Accounts = formString;
			onLineOrder.OrderAmount = formInt;
			onLineOrder.IPAddress = GameRequest.GetUserIP();
			string text3 = text;
			switch (text3)
			{
			case "alipay":
				if (formInt < 50)
				{
					base.Response.Write("<h1>该通道不能低于50元</h1>");
					base.Response.End();
				}
				text = "2";
				onLineOrder.ShareID = 2;
				goto IL_2B6;
			case "weixin":
				text = "3";
				onLineOrder.ShareID = 3;
				goto IL_2B6;
			case "alipay-scan":
				text = "0";
				this.paytype = "支付宝";
				onLineOrder.ShareID = 4;
				goto IL_2B6;
			case "weixin-scan":
				text = "1";
				this.paytype = "微信";
				onLineOrder.ShareID = 5;
				goto IL_2B6;
			case "qq":
				text = "8";
				onLineOrder.ShareID = 6;
				goto IL_2B6;
			case "kuaijie":
				text = "bank";
				onLineOrder.ShareID = 7;
				goto IL_2B6;
			case "qq-scan":
				text = "7";
				this.paytype = "QQ";
				onLineOrder.ShareID = 8;
				goto IL_2B6;
			case "jd":
				text = "6";
				onLineOrder.ShareID = 9;
				goto IL_2B6;
			case "baidu":
				text = "5";
				onLineOrder.ShareID = 10;
				goto IL_2B6;
			}
			text = "4";
			onLineOrder.ShareID = 1;
			IL_2B6:
			Message message = FacadeManage.aideTreasureFacade.RequestOrder(onLineOrder);
			if (!message.Success)
			{
				base.Response.Write(message.Content);
				base.Response.End();
			}
			string str = ApplicationSettings.Get("url_sl");
			string value = ApplicationSettings.Get("parter_sl");
			string str2 = ApplicationSettings.Get("key_sl");
			string text2 = ApplicationSettings.Get("pay_url");
			if (text2 == "")
			{
				text2 = "http://" + base.Request.Url.Host;
			}
			string orderID = onLineOrder.OrderID;
			string value2 = text2 + "/pay/slpay/notify_url.aspx";
			System.Collections.Generic.Dictionary<string, string> dictionary = new System.Collections.Generic.Dictionary<string, string>();
			dictionary["parter"] = value;
			dictionary["b_type"] = text;
			dictionary["amount"] = formInt.ToString();
			dictionary["orderid"] = orderID;
			dictionary["callbackurl"] = value2;
			dictionary["goodsinfo"] = "shop";
			dictionary["nonce_str"] = orderID;
			dictionary = (
				from p in dictionary
				orderby p.Key
				select p).ToDictionary((System.Collections.Generic.KeyValuePair<string, string> p) => p.Key, (System.Collections.Generic.KeyValuePair<string, string> o) => o.Value);
			string password = PayHelper.PrepareSign(dictionary) + str2;
			dictionary["hrefbackurl"] = "";
			dictionary["attach"] = "";
			dictionary["sign"] = TextEncrypt.EncryptPassword(password);
			string url = str + "?" + PayHelper.PrepareSign(dictionary);
			base.Response.Redirect(url);
		}
Beispiel #9
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string formString = GameRequest.GetFormString("account");

            if (formString == "")
            {
                base.Response.Write("充值账号错误");
                base.Response.End();
            }
            int formInt = GameRequest.GetFormInt("amount", 0);

            if (formInt < 6)
            {
                base.Response.Write("充值金额不能低于6元");
                base.Response.End();
            }
            string      text        = GameRequest.GetFormString("type");
            OnLineOrder onLineOrder = new OnLineOrder();

            onLineOrder.OrderID = PayHelper.GetOrderIDByPrefix("yyb");
            if (Fetch.GetUserCookie() == null)
            {
                onLineOrder.OperUserID = 0;
            }
            else
            {
                onLineOrder.OperUserID = Fetch.GetUserCookie().UserID;
            }
            onLineOrder.Accounts    = formString;
            onLineOrder.OrderAmount = formInt;
            onLineOrder.IPAddress   = GameRequest.GetUserIP();
            string a;

            if ((a = text) != null)
            {
                if (!(a == "weixin"))
                {
                    if (!(a == "alipay-scan"))
                    {
                        if (!(a == "weixin-scan"))
                        {
                            if (a == "qq-scan")
                            {
                                text                = "2";
                                this.paytype        = "QQ";
                                onLineOrder.ShareID = 8;
                            }
                        }
                        else
                        {
                            text                = "3";
                            this.paytype        = "微信";
                            onLineOrder.ShareID = 5;
                        }
                    }
                    else
                    {
                        text                = "1";
                        this.paytype        = "支付宝";
                        onLineOrder.ShareID = 4;
                    }
                }
                else
                {
                    text = "3";
                    onLineOrder.ShareID = 3;
                }
            }
            Message message = FacadeManage.aideTreasureFacade.RequestOrder(onLineOrder);

            if (!message.Success)
            {
                base.Response.Write(message.Content);
                base.Response.End();
            }
            string str   = ApplicationSettings.Get("url_yyb");
            string value = ApplicationSettings.Get("parter_yyb");

            ApplicationSettings.Get("key_yyb");
            string text2 = ApplicationSettings.Get("pay_url");

            if (text2 == "")
            {
                text2 = "http://" + base.Request.Url.Host;
            }
            string orderID = onLineOrder.OrderID;
            string value2  = text2 + "/pay/yyb/notify_url.aspx";

            System.Collections.Generic.Dictionary <string, string> dictionary = new System.Collections.Generic.Dictionary <string, string>();
            dictionary["pid"]   = value;
            dictionary["lb"]    = text;
            dictionary["money"] = formInt.ToString();
            dictionary["data"]  = orderID;
            dictionary["url"]   = value2;
            dictionary["m"]     = "0";
            dictionary["bk"]    = "1";
            string url = str + "?" + PayHelper.PrepareSign(dictionary);

            base.Response.Redirect(url);
        }
Beispiel #10
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string formString = GameRequest.GetFormString("account");

            if (formString == "")
            {
                base.Response.Write("充值账号错误");
                base.Response.End();
            }
            int formInt = GameRequest.GetFormInt("amount", 0);

            if (formInt < 6)
            {
                base.Response.Write("充值金额不能低于6元");
                base.Response.End();
            }
            string      text        = GameRequest.GetFormString("type");
            OnLineOrder onLineOrder = new OnLineOrder();

            onLineOrder.OrderID = PayHelper.GetOrderIDByPrefix("ry");
            if (Fetch.GetUserCookie() == null)
            {
                onLineOrder.OperUserID = 0;
            }
            else
            {
                onLineOrder.OperUserID = Fetch.GetUserCookie().UserID;
            }
            onLineOrder.Accounts    = formString;
            onLineOrder.OrderAmount = formInt;
            onLineOrder.IPAddress   = GameRequest.GetUserIP();
            string text4 = text;

            switch (text4)
            {
            case "alipay":
                text = "36";
                onLineOrder.ShareID = 2;
                goto IL_240;

            case "weixin":
                text = "33";
                onLineOrder.ShareID = 3;
                goto IL_240;

            case "alipay-scan":
                text                = "2";
                this.paytype        = "支付宝";
                onLineOrder.ShareID = 4;
                goto IL_240;

            case "weixin-scan":
                text                = "21";
                this.paytype        = "微信";
                onLineOrder.ShareID = 5;
                goto IL_240;

            case "qq":
                text = "92";
                onLineOrder.ShareID = 6;
                goto IL_240;

            case "qq-scan":
                text                = "89";
                this.paytype        = "QQ";
                onLineOrder.ShareID = 8;
                goto IL_240;

            case "kuaijie":
                text = "32";
                onLineOrder.ShareID = 7;
                goto IL_240;
            }
            text = "1";
            onLineOrder.ShareID = 1;
IL_240:
            Message message = FacadeManage.aideTreasureFacade.RequestOrder(onLineOrder);

            if (!message.Success)
            {
                base.Response.Write(message.Content);
                base.Response.End();
            }
            string str   = ApplicationSettings.Get("url_ruyi");
            string value = ApplicationSettings.Get("parter_ruyi");
            string text2 = ApplicationSettings.Get("key_ruyi");
            string text3 = ApplicationSettings.Get("pay_url");

            if (text3 == "")
            {
                text3 = "http://" + base.Request.Url.Host;
            }
            string orderID = onLineOrder.OrderID;
            string value2  = text3 + "/pay/ruyi/notify_url.aspx";

            System.Collections.Generic.Dictionary <string, string> dictionary = new System.Collections.Generic.Dictionary <string, string>();
            dictionary["P_UserID"]     = value;
            dictionary["P_OrderID"]    = orderID;
            dictionary["P_FaceValue"]  = formInt.ToString("#0.00");
            dictionary["P_Price"]      = formInt.ToString("#0.00");
            dictionary["P_ChannelID"]  = text;
            dictionary["P_Result_URL"] = value2;
            dictionary["P_Notify_URL"] = value2;
            string password = string.Format("{0}|{1}|||{2}|{3}|{4}", new object[]
            {
                dictionary["P_UserID"],
                dictionary["P_OrderID"],
                dictionary["P_FaceValue"],
                dictionary["P_ChannelID"],
                text2
            });
            string value3 = TextEncrypt.EncryptPassword(password).ToLower();

            dictionary["P_PostKey"] = value3;
            string url = str + "?" + PayHelper.PrepareSign(dictionary);

            base.Response.Redirect(url);
        }
Beispiel #11
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string formString = GameRequest.GetFormString("account");

            if (formString == "")
            {
                base.Response.Write("充值账号错误");
                base.Response.End();
            }
            int formInt = GameRequest.GetFormInt("amount", 0);

            if (formInt < 6)
            {
                base.Response.Write("充值金额不能低于6元");
                base.Response.End();
            }
            string      text        = GameRequest.GetFormString("type");
            OnLineOrder onLineOrder = new OnLineOrder();

            onLineOrder.OrderID = PayHelper.GetOrderIDByPrefix("dd");
            if (Fetch.GetUserCookie() == null)
            {
                onLineOrder.OperUserID = 0;
            }
            else
            {
                onLineOrder.OperUserID = Fetch.GetUserCookie().UserID;
            }
            onLineOrder.Accounts    = formString;
            onLineOrder.OrderAmount = formInt;
            onLineOrder.IPAddress   = GameRequest.GetUserIP();
            string text4 = text;

            switch (text4)
            {
            case "alipay":
                text = "010008";
                onLineOrder.ShareID = 2;
                goto IL_289;

            case "weixin":
                text = "010007";
                onLineOrder.ShareID = 3;
                goto IL_289;

            case "alipay-scan":
                text                = "010002";
                this.paytype        = "支付宝";
                onLineOrder.ShareID = 4;
                goto IL_289;

            case "weixin-scan":
                text                = "010001";
                this.paytype        = "微信";
                onLineOrder.ShareID = 5;
                goto IL_289;

            case "qq":
                text = "7";
                onLineOrder.ShareID = 6;
                goto IL_289;

            case "kuaijie":
                text = "010010";
                onLineOrder.ShareID = 7;
                goto IL_289;

            case "qq-scan":
                text                = "010000";
                this.paytype        = "QQ";
                onLineOrder.ShareID = 8;
                goto IL_289;

            case "jd":
                text = "6";
                onLineOrder.ShareID = 9;
                goto IL_289;

            case "baidu":
                text = "5";
                onLineOrder.ShareID = 10;
                goto IL_289;
            }
            text = "4";
            onLineOrder.ShareID = 1;
IL_289:
            Message message = FacadeManage.aideTreasureFacade.RequestOrder(onLineOrder);

            if (!message.Success)
            {
                base.Response.Write(message.Content);
                base.Response.End();
            }
            string url   = ApplicationSettings.Get("url_dd");
            string value = ApplicationSettings.Get("parter_dd");
            string str   = ApplicationSettings.Get("key_dd");
            string text2 = ApplicationSettings.Get("pay_url");

            if (text2 == "")
            {
                text2 = "http://" + base.Request.Url.Host;
            }
            string orderID = onLineOrder.OrderID;
            string value2  = text2 + "/pay/diandian/notify_url.aspx";
            string str2    = "{\"mch_app_id\":\"http://www.qp137.com\",\"device_info\":\"AND_WAP\",\"ua\":\"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36\",\"mch_app_name\":\"支付测试\",\"cashier_desk\":\"1\"}";
            string s       = System.Web.HttpUtility.UrlEncode(str2);

            byte[] bytes  = System.Text.Encoding.UTF8.GetBytes(s);
            string value3 = System.Convert.ToBase64String(bytes);

            System.Collections.Generic.Dictionary <string, string> dictionary = new System.Collections.Generic.Dictionary <string, string>();
            dictionary["version"]      = "1.0";
            dictionary["charset"]      = "utf-8";
            dictionary["merchant_id"]  = value;
            dictionary["out_trade_no"] = orderID;
            dictionary["user_ip"]      = GameRequest.GetUserIP();
            dictionary["subject"]      = "支付测试";
            dictionary["body"]         = "支付测试";
            dictionary["user_id"]      = formString;
            dictionary["total_fee"]    = formInt.ToString("#0.00");
            dictionary["notify_url"]   = value2;
            dictionary["return_url"]   = value2;
            dictionary["nonce_str"]    = TextUtility.CreateAuthStr(20, false);
            dictionary["biz_content"]  = value3;
            dictionary["trade_type"]   = text;
            dictionary = (
                from p in dictionary
                orderby p.Key
                select p).ToDictionary((System.Collections.Generic.KeyValuePair <string, string> p) => p.Key, (System.Collections.Generic.KeyValuePair <string, string> o) => o.Value);
            string str3 = PayHelper.PrepareSign(dictionary) + "&key=" + str;

            dictionary["sign"] = Jiami.MD5(str3).ToUpper();
            string param = PayHelper.ToXml(dictionary);
            string text3 = HttpHelper.HttpRequest(url, param, "post", "utf-8", "text/xml");

            System.Collections.Generic.Dictionary <string, string> dictionary2 = PayHelper.XmlToDic(text3);
            if (!dictionary2.ContainsKey("status"))
            {
                base.Response.Write(text3);
                base.Response.End();
            }
            else
            {
                string a = dictionary2["status"];
                if (a == "0")
                {
                    this.order_no     = orderID;
                    this.order_amount = formInt.ToString();
                    this.qrcode       = dictionary2["pay_info"];
                    base.Response.Redirect(this.qrcode);
                }
                else
                {
                    base.Response.Write(dictionary2["message"]);
                    base.Response.End();
                }
            }
        }
Beispiel #12
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string formString = GameRequest.GetFormString("account");

            if (formString == "")
            {
                base.Response.Write("充值账号错误");
                base.Response.End();
            }
            int formInt = GameRequest.GetFormInt("amount", 0);

            if (formInt < 6)
            {
                base.Response.Write("充值金额不能低于6元");
                base.Response.End();
            }
            string      text        = GameRequest.GetFormString("type");
            OnLineOrder onLineOrder = new OnLineOrder();

            onLineOrder.OrderID = PayHelper.GetOrderIDByPrefix("gf");
            if (Fetch.GetUserCookie() == null)
            {
                onLineOrder.OperUserID = 0;
            }
            else
            {
                onLineOrder.OperUserID = Fetch.GetUserCookie().UserID;
            }
            onLineOrder.Accounts    = formString;
            onLineOrder.OrderAmount = formInt;
            onLineOrder.IPAddress   = GameRequest.GetUserIP();
            string text3 = text;

            switch (text3)
            {
            case "alipay":
                text = "1006";
                onLineOrder.ShareID = 2;
                goto IL_240;

            case "weixin":
                text = "1007";
                onLineOrder.ShareID = 3;
                goto IL_240;

            case "alipay-scan":
                text                = "992";
                this.paytype        = "支付宝";
                onLineOrder.ShareID = 4;
                goto IL_240;

            case "weixin-scan":
                text                = "1004";
                this.paytype        = "微信";
                onLineOrder.ShareID = 5;
                goto IL_240;

            case "qq":
                text = "92";
                onLineOrder.ShareID = 6;
                goto IL_240;

            case "qq-scan":
                text                = "993";
                this.paytype        = "QQ";
                onLineOrder.ShareID = 8;
                goto IL_240;

            case "kuaijie":
                text = "1005";
                onLineOrder.ShareID = 7;
                goto IL_240;
            }
            text = "1";
            onLineOrder.ShareID = 1;
IL_240:
            Message message = FacadeManage.aideTreasureFacade.RequestOrder(onLineOrder);

            if (!message.Success)
            {
                base.Response.Write(message.Content);
                base.Response.End();
            }
            string str   = ApplicationSettings.Get("url_gf");
            string value = ApplicationSettings.Get("parter_gf");
            string str2  = ApplicationSettings.Get("key_gf");
            string text2 = ApplicationSettings.Get("pay_url");

            if (text2 == "")
            {
                text2 = "http://" + base.Request.Url.Host;
            }
            string orderID = onLineOrder.OrderID;
            string value2  = text2 + "/pay/guifu/notify_url.aspx";

            System.Collections.Generic.Dictionary <string, string> dictionary = new System.Collections.Generic.Dictionary <string, string>();
            dictionary["parter"]      = value;
            dictionary["type"]        = text;
            dictionary["value"]       = formInt.ToString("#0.00");
            dictionary["orderid"]     = orderID;
            dictionary["callbackurl"] = value2;
            string str3   = PayHelper.PrepareSign(dictionary);
            string value3 = TextEncrypt.EncryptPassword(str3 + str2).ToLower();

            dictionary["hrefbackurl"] = value2;
            dictionary["sign"]        = value3;
            string url = str + "?" + PayHelper.PrepareSign(dictionary);

            base.Response.Redirect(url);
        }
Beispiel #13
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string formString = GameRequest.GetFormString("account");

            if (formString == "")
            {
                base.Response.Write("充值账号错误");
                base.Response.End();
            }
            int formInt = GameRequest.GetFormInt("amount", 0);

            if (formInt < 6)
            {
                base.Response.Write("充值金额不能低于6元");
                base.Response.End();
            }
            string      formString2 = GameRequest.GetFormString("type");
            OnLineOrder onLineOrder = new OnLineOrder();

            onLineOrder.OrderID = PayHelper.GetOrderIDByPrefix("zlf");
            if (Fetch.GetUserCookie() == null)
            {
                onLineOrder.OperUserID = 0;
            }
            else
            {
                onLineOrder.OperUserID = Fetch.GetUserCookie().UserID;
            }
            onLineOrder.Accounts    = formString;
            onLineOrder.OrderAmount = formInt;
            onLineOrder.IPAddress   = GameRequest.GetUserIP();
            string text4 = formString2;

            switch (text4)
            {
            case "alipay":
                onLineOrder.ShareID = 2;
                goto IL_241;

            case "weixin":
                onLineOrder.ShareID = 3;
                goto IL_241;

            case "alipay-scan":
                this.paytype        = "支付宝";
                onLineOrder.ShareID = 4;
                goto IL_241;

            case "weixin-scan":
                this.paytype        = "微信";
                onLineOrder.ShareID = 5;
                goto IL_241;

            case "qq":
                onLineOrder.ShareID = 6;
                goto IL_241;

            case "kuaijie":
                onLineOrder.ShareID = 7;
                goto IL_241;

            case "qq-scan":
                this.paytype        = "QQ";
                onLineOrder.ShareID = 8;
                goto IL_241;

            case "jd":
                onLineOrder.ShareID = 9;
                goto IL_241;

            case "baidu":
                onLineOrder.ShareID = 10;
                goto IL_241;
            }
            onLineOrder.ShareID = 1;
IL_241:
            Message message = FacadeManage.aideTreasureFacade.RequestOrder(onLineOrder);

            if (!message.Success)
            {
                base.Response.Write(message.Content);
                base.Response.End();
            }
            string url   = ApplicationSettings.Get("url_168");
            string value = ApplicationSettings.Get("parter_168");
            string text  = ApplicationSettings.Get("key_168");
            string text2 = ApplicationSettings.Get("pay_url");

            if (text2 == "")
            {
                text2 = "http://" + base.Request.Url.Host;
            }
            string orderID = onLineOrder.OrderID;
            string value2  = text2 + "/pay/168/notify_url.aspx";

            System.Collections.Generic.Dictionary <string, string> dictionary = new System.Collections.Generic.Dictionary <string, string>();
            dictionary["mchid"] = value;
            System.Collections.Generic.Dictionary <string, string> arg_31F_0 = dictionary;
            string arg_31F_1 = "fee";
            int    num       = formInt * 100;

            arg_31F_0[arg_31F_1]     = num.ToString();
            dictionary["order_sn"]   = orderID;
            dictionary["notify_url"] = value2;
            string password = string.Concat(new string[]
            {
                dictionary["mchid"],
                "&",
                dictionary["fee"],
                "&",
                dictionary["order_sn"],
                "&",
                text
            });

            dictionary["sign"] = TextEncrypt.EncryptPassword(password).ToLower();
            string param = PayHelper.PrepareSign(dictionary);
            string text3 = HttpHelper.HttpRequest(url, param);

            if (!text3.Contains("rtn"))
            {
                base.Response.Write(text3);
                base.Response.End();
            }
            else
            {
                System.Collections.Generic.Dictionary <string, string> dictionary2 = JsonHelper.DeserializeJsonToObject <System.Collections.Generic.Dictionary <string, string> >(text3);
                if (dictionary2["rtn"] == "0")
                {
                    this.order_no     = orderID;
                    this.order_amount = formInt.ToString();
                    this.qrcode       = dictionary2["qrurl"];
                    base.Response.Redirect(this.qrcode);
                }
                else
                {
                    base.Response.Write(dictionary2["message"]);
                    base.Response.End();
                }
            }
        }
Beispiel #14
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string formString = GameRequest.GetFormString("account");

            if (formString == "")
            {
                base.Response.Write("充值账号错误");
                base.Response.End();
            }
            int formInt = GameRequest.GetFormInt("amount", 0);

            if (formInt < 6)
            {
                base.Response.Write("充值金额不能低于6元");
                base.Response.End();
            }
            string      text        = GameRequest.GetFormString("type");
            OnLineOrder onLineOrder = new OnLineOrder();

            onLineOrder.OrderID = PayHelper.GetOrderIDByPrefix("ft");
            if (Fetch.GetUserCookie() == null)
            {
                onLineOrder.OperUserID = 0;
            }
            else
            {
                onLineOrder.OperUserID = Fetch.GetUserCookie().UserID;
            }
            onLineOrder.Accounts    = formString;
            onLineOrder.OrderAmount = formInt;
            onLineOrder.IPAddress   = GameRequest.GetUserIP();
            string text5 = text;

            switch (text5)
            {
            case "alipay":
                text = "alipaywap";
                onLineOrder.ShareID = 2;
                goto IL_240;

            case "weixin":
                text = "wxpaywap";
                onLineOrder.ShareID = 3;
                goto IL_240;

            case "alipay-scan":
                text                = "ZFBZF";
                this.paytype        = "支付宝";
                onLineOrder.ShareID = 4;
                goto IL_240;

            case "weixin-scan":
                text                = "WXZF";
                this.paytype        = "微信";
                onLineOrder.ShareID = 5;
                goto IL_240;

            case "qq":
                text = "qqwap";
                onLineOrder.ShareID = 6;
                goto IL_240;

            case "qq-scan":
                text                = "QQZF";
                this.paytype        = "QQ";
                onLineOrder.ShareID = 8;
                goto IL_240;

            case "kuaijie":
                text = "bank";
                onLineOrder.ShareID = 7;
                goto IL_240;
            }
            text = "bank";
            onLineOrder.ShareID = 1;
IL_240:
            Message message = FacadeManage.aideTreasureFacade.RequestOrder(onLineOrder);

            if (!message.Success)
            {
                base.Response.Write(message.Content);
                base.Response.End();
            }
            string url   = ApplicationSettings.Get("url_ft");
            string text2 = ApplicationSettings.Get("parter_ft");
            string text3 = ApplicationSettings.Get("key_ft");
            string text4 = ApplicationSettings.Get("pay_url");

            if (text4 == "")
            {
                text4 = "http://" + base.Request.Url.Host;
            }
            string orderID = onLineOrder.OrderID;
            string value   = text4 + "/pay/ftpay/notify_url.aspx";
            string value2  = "2001";

            System.Collections.Generic.Dictionary <string, string> dictionary = new System.Collections.Generic.Dictionary <string, string>();
            dictionary["amt"]       = formInt.ToString();
            dictionary["payType"]   = text;
            dictionary["subject"]   = "shop";
            dictionary["notifyUrl"] = value;
            string password = string.Format("orgCode={0}&amt={1}&payType ={2}&md5={3}", new object[]
            {
                text2,
                formInt,
                text,
                text3
            });
            string value3 = TextEncrypt.EncryptPassword(password).ToLower();

            System.Collections.Generic.Dictionary <string, string> dictionary2 = new System.Collections.Generic.Dictionary <string, string>();
            dictionary2["orgCode"]     = text2;
            dictionary2["serviceCode"] = value2;
            dictionary2["orgNo"]       = orderID;
            dictionary2["jsonData"]    = JsonHelper.SerializeObject(dictionary);
            dictionary2["sign"]        = value3;
            this.order_no     = orderID;
            this.order_amount = formInt.ToString();
            string param = PayHelper.PrepareSign(dictionary2);
            string json  = HttpHelper.HttpRequest(url, param);

            System.Collections.Generic.Dictionary <string, string> dictionary3 = JsonHelper.DeserializeJsonToObject <System.Collections.Generic.Dictionary <string, string> >(json);
            if (dictionary3.ContainsKey("respCode"))
            {
                if (!(dictionary3["respCode"] == "0000") && !(dictionary3["respCode"] == "0001"))
                {
                    base.Response.Write(dictionary3["respDesc"]);
                }
                else
                {
                    string json2 = dictionary3["jsonData"];
                    System.Collections.Generic.Dictionary <string, string> dictionary4 = JsonHelper.DeserializeJsonToObject <System.Collections.Generic.Dictionary <string, string> >(json2);
                    if (dictionary4.ContainsKey("payUrl"))
                    {
                        this.qrcode = dictionary4["payUrl"];
                    }
                }
            }
            else
            {
                base.Response.Write("下单失败");
            }
        }
Beispiel #15
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string formString = GameRequest.GetFormString("account");

            if (formString == "")
            {
                base.Response.Write("充值账号错误");
                base.Response.End();
            }
            int formInt = GameRequest.GetFormInt("amount", 0);

            if (formInt < 6)
            {
                base.Response.Write("充值金额不能低于6元");
                base.Response.End();
            }
            string      text        = GameRequest.GetFormString("type");
            OnLineOrder onLineOrder = new OnLineOrder();

            onLineOrder.OrderID = PayHelper.GetOrderIDByPrefix("ymf");
            if (Fetch.GetUserCookie() == null)
            {
                onLineOrder.OperUserID = 0;
            }
            else
            {
                onLineOrder.OperUserID = Fetch.GetUserCookie().UserID;
            }
            onLineOrder.Accounts    = formString;
            onLineOrder.OrderAmount = formInt;
            onLineOrder.IPAddress   = GameRequest.GetUserIP();
            string text3 = text;

            switch (text3)
            {
            case "alipay":
                text = "9";
                onLineOrder.ShareID = 2;
                goto IL_283;

            case "weixin":
                text = "13";
                onLineOrder.ShareID = 3;
                goto IL_283;

            case "alipay-scan":
                text                = "4";
                this.paytype        = "支付宝";
                onLineOrder.ShareID = 4;
                goto IL_283;

            case "weixin-scan":
                text                = "5";
                this.paytype        = "微信";
                onLineOrder.ShareID = 5;
                goto IL_283;

            case "qq":
                text = "15";
                onLineOrder.ShareID = 6;
                goto IL_283;

            case "qq-scan":
                text                = "6";
                this.paytype        = "QQ";
                onLineOrder.ShareID = 8;
                goto IL_283;

            case "jd":
                text = "21";
                onLineOrder.ShareID = 9;
                goto IL_283;

            case "jd-scan":
                text = "8";
                onLineOrder.ShareID = 13;
                goto IL_283;

            case "kuaijie":
                text = "1";
                onLineOrder.ShareID = 7;
                goto IL_283;
            }
            onLineOrder.ShareID = 1;
IL_283:
            Message message = FacadeManage.aideTreasureFacade.RequestOrder(onLineOrder);

            if (!message.Success)
            {
                base.Response.Write(message.Content);
                base.Response.End();
            }
            string value   = ApplicationSettings.Get("parter_ymf");
            string key2    = ApplicationSettings.Get("key_ymf");
            string text2   = ApplicationSettings.Get("pay_url");
            string gateway = ApplicationSettings.Get("url_ymf");

            if (text2 == "")
            {
                text2 = "http://" + base.Request.Url.Host;
            }
            string value2 = text2 + "/pay/youmifu/notify_url.aspx";

            System.Collections.Generic.Dictionary <string, string> dictionary = new System.Collections.Generic.Dictionary <string, string>();
            dictionary["apiName"] = "WAP_PAY_B2C";
            if (text == "wangyin")
            {
                dictionary["apiName"] = "WEB_PAY_B2C";
            }
            dictionary["apiVersion"]   = "1.0.0.1";
            dictionary["platformID"]   = value;
            dictionary["merchNo"]      = value;
            dictionary["orderNo"]      = onLineOrder.OrderID;
            dictionary["tradeDate"]    = System.DateTime.Now.ToString("yyyyMMdd");
            dictionary["amt"]          = formInt.ToString() + ".00";
            dictionary["merchUrl"]     = value2;
            dictionary["merchParam"]   = TextUtility.CreateAuthStr(20, false);
            dictionary["tradeSummary"] = "shop";
            dictionary["customerIP"]   = GameRequest.GetUserIP();
            string sourceData = PayHelper.PrepareSign(dictionary);
            string value3     = Jiami.sign(sourceData, key2);

            dictionary["signMsg"]       = value3;
            dictionary["choosePayType"] = text;
            if (text == "wangyin")
            {
                dictionary["choosePayType"] = "1";
            }
            dictionary["bankCode"] = "";
            base.Response.Write(PayHelper.BuildForm(dictionary, gateway));
            base.Response.End();
        }
Beispiel #16
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string formString = GameRequest.GetFormString("account");

            if (formString == "")
            {
                base.Response.Write("充值账号错误");
                base.Response.End();
            }
            int formInt = GameRequest.GetFormInt("amount", 0);

            if (formInt < 6)
            {
                base.Response.Write("充值金额不能低于6元");
                base.Response.End();
            }
            string      formString2 = GameRequest.GetFormString("type");
            OnLineOrder onLineOrder = new OnLineOrder();

            onLineOrder.OrderID = PayHelper.GetOrderIDByPrefix("zny");
            if (Fetch.GetUserCookie() == null)
            {
                onLineOrder.OperUserID = 0;
            }
            else
            {
                onLineOrder.OperUserID = Fetch.GetUserCookie().UserID;
            }
            onLineOrder.Accounts    = formString;
            onLineOrder.OrderAmount = formInt;
            onLineOrder.IPAddress   = GameRequest.GetUserIP();
            string text = "";

            if (formString2 == "alipay")
            {
                text = "10001";
                onLineOrder.ShareID = 2;
                this.paytype        = "支付宝";
            }
            if (formString2 == "weixin")
            {
                text = "20001";
                onLineOrder.ShareID = 3;
                this.paytype        = "微信";
            }
            if (formString2 == "weixin-scan")
            {
                text = "20001";
                onLineOrder.ShareID = 5;
                this.paytype        = "微信";
            }
            Message message = FacadeManage.aideTreasureFacade.RequestOrder(onLineOrder);

            if (!message.Success)
            {
                base.Response.Write(message.Content);
                base.Response.End();
            }
            string url   = ApplicationSettings.Get("url_zny");
            string value = ApplicationSettings.Get("parter_zny");
            string text2 = ApplicationSettings.Get("key_zny");
            string text3 = ApplicationSettings.Get("pay_url");

            if (text3 == "")
            {
                text3 = "http://" + base.Request.Url.Host;
            }
            string value2 = text3 + "/pay/zhinengyun/notify_url.aspx";

            System.Collections.Generic.Dictionary <string, string> dictionary = new System.Collections.Generic.Dictionary <string, string>();
            dictionary["uid"]        = value;
            dictionary["orderid"]    = onLineOrder.OrderID;
            dictionary["istype"]     = text;
            dictionary["price"]      = formInt.ToString();
            dictionary["goodsname"]  = "shop";
            dictionary["orderuid"]   = TextUtility.CreateAuthStr(20, false);
            dictionary["notify_url"] = value2;
            dictionary["return_url"] = value2;
            dictionary["format "]    = "json";
            string password = string.Concat(new string[]
            {
                dictionary["goodsname"],
                dictionary["istype"],
                dictionary["notify_url"],
                dictionary["orderid"],
                dictionary["orderuid"],
                dictionary["price"],
                dictionary["return_url"],
                text2,
                dictionary["uid"]
            });
            string value3 = TextEncrypt.EncryptPassword(password).ToLower();

            dictionary["key"] = value3;
            string param = PayHelper.PrepareSign(dictionary);
            string json  = HttpHelper.HttpRequest(url, param);

            System.Collections.Generic.Dictionary <string, object> dictionary2 = JsonHelper.DeserializeJsonToObject <System.Collections.Generic.Dictionary <string, object> >(json);
            if (!dictionary2.ContainsKey("code"))
            {
                base.Response.Write("接口正在维护中...");
            }
            else
            {
                if (!(dictionary2["code"].ToString() == "200"))
                {
                    base.Response.Write(dictionary2["msg"].ToString());
                }
                else
                {
                    Log.Write(dictionary2["data"].ToString());
                    System.Collections.Generic.Dictionary <string, string> dictionary3 = JsonHelper.DeserializeJsonToObject <System.Collections.Generic.Dictionary <string, string> >(dictionary2["data"].ToString());
                    if (text == "10001")
                    {
                        base.Response.Redirect(dictionary3["qrcode"]);
                    }
                    else
                    {
                        this.order_no     = onLineOrder.OrderID;
                        this.order_amount = formInt.ToString();
                        this.qrcode       = dictionary3["qrcode"];
                    }
                }
            }
        }
Beispiel #17
0
        private void QueryOrder(string orgCode, string orgNo, string key)
        {
            string value = "2003";

            System.Collections.Generic.Dictionary <string, string> dictionary = new System.Collections.Generic.Dictionary <string, string>();
            dictionary["oldOrgNo"] = orgNo;
            string password = string.Format("orgCode={0}&oldOrgNo={1}&md5={2}", orgCode, orgNo, key);
            string value2   = TextEncrypt.EncryptPassword(password).ToLower();

            System.Collections.Generic.Dictionary <string, string> dictionary2 = new System.Collections.Generic.Dictionary <string, string>();
            dictionary2["orgCode"]     = orgCode;
            dictionary2["serviceCode"] = value;
            dictionary2["orgNo"]       = PayHelper.GetOrderIDByPrefix("");
            dictionary2["jsonData"]    = JsonHelper.SerializeObject(dictionary);
            dictionary2["sign"]        = value2;
            string param = PayHelper.PrepareSign(dictionary2);
            string json  = HttpHelper.HttpRequest(ApplicationSettings.Get("url_ft"), param);

            System.Collections.Generic.Dictionary <string, string> dictionary3 = JsonHelper.DeserializeJsonToObject <System.Collections.Generic.Dictionary <string, string> >(json);
            if (dictionary3.ContainsKey("respCode"))
            {
                if (!(dictionary3["respCode"] == "0000") && !(dictionary3["respCode"] == "0001"))
                {
                    base.Response.Write(dictionary3["respDesc"]);
                    Log.Write(dictionary3["respDesc"]);
                }
                else
                {
                    string json2 = dictionary3["jsonData"];
                    System.Collections.Generic.Dictionary <string, string> dictionary4 = JsonHelper.DeserializeJsonToObject <System.Collections.Generic.Dictionary <string, string> >(json2);
                    if (dictionary4.ContainsKey("status"))
                    {
                        if (!(dictionary4["status"] == "3"))
                        {
                            base.Response.Write(((notify_url.PayStatus)System.Convert.ToInt32(dictionary4["status"])).ToString());
                            Log.Write(((notify_url.PayStatus)System.Convert.ToInt32(dictionary4["status"])).ToString());
                        }
                        else
                        {
                            ShareDetialInfo shareDetialInfo = new ShareDetialInfo();
                            shareDetialInfo.OrderID   = orgNo;
                            shareDetialInfo.IPAddress = Utility.UserIP;
                            shareDetialInfo.PayAmount = System.Convert.ToDecimal(dictionary4["amt"]);
                            Message message = FacadeManage.aideTreasureFacade.FilliedOnline(shareDetialInfo, 0);
                            if (message.Success)
                            {
                                base.Response.Write("success");
                            }
                            else
                            {
                                Log.Write(message.Content);
                            }
                        }
                    }
                }
            }
            else
            {
                base.Response.Write("查询订单失败");
                Log.Write("查询订单失败");
            }
        }
Beispiel #18
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string formString = GameRequest.GetFormString("account");

            if (formString == "")
            {
                base.Response.Write("充值账号错误");
                base.Response.End();
            }
            int formInt = GameRequest.GetFormInt("amount", 0);

            if (formInt < 6)
            {
                base.Response.Write("充值金额不能低于6元");
                base.Response.End();
            }
            string      formString2 = GameRequest.GetFormString("type");
            OnLineOrder onLineOrder = new OnLineOrder();

            onLineOrder.OrderID = PayHelper.GetOrderIDByPrefix("txf");
            if (Fetch.GetUserCookie() == null)
            {
                onLineOrder.OperUserID = 0;
            }
            else
            {
                onLineOrder.OperUserID = Fetch.GetUserCookie().UserID;
            }
            onLineOrder.Accounts    = formString;
            onLineOrder.OrderAmount = formInt;
            onLineOrder.IPAddress   = GameRequest.GetUserIP();
            string value = "";
            string text  = ApplicationSettings.Get("url_san");

            if (formString2 == "alipay")
            {
                value = "2";
                onLineOrder.ShareID = 2;
                text += "/Pay/GateWayAliPay.aspx";
            }
            else
            {
                text += "/Pay/GateWayTencent.aspx";
            }
            if (formString2 == "weixin")
            {
                value = "2";
                onLineOrder.ShareID = 3;
            }
            if (formString2 == "qq")
            {
                value = "4";
                onLineOrder.ShareID = 6;
            }
            if (formString2 == "jd")
            {
                value = "5";
                onLineOrder.ShareID = 9;
            }
            Message message = FacadeManage.aideTreasureFacade.RequestOrder(onLineOrder);

            if (!message.Success)
            {
                base.Response.Write(message.Content);
                base.Response.End();
            }
            string value2 = ApplicationSettings.Get("partner_san");
            string text2  = ApplicationSettings.Get("key_san");
            string text3  = ApplicationSettings.Get("pay_url");

            if (text3 == "")
            {
                text3 = "http://" + base.Request.Url.Host;
            }
            string value3 = text3 + "/pay/san/notify_url.aspx";

            System.Collections.Generic.Dictionary <string, string> dictionary = new System.Collections.Generic.Dictionary <string, string>();
            dictionary["app_id"]     = value2;
            dictionary["pay_type"]   = value;
            dictionary["order_id"]   = onLineOrder.OrderID;
            dictionary["order_amt"]  = formInt.ToString();
            dictionary["notify_url"] = value3;
            dictionary["return_url"] = value3;
            dictionary["time_stamp"] = System.DateTime.Now.ToString("yyyyMMddHHmmss");
            string text4 = "";

            foreach (System.Collections.Generic.KeyValuePair <string, string> current in dictionary)
            {
                string text5 = text4;
                text4 = string.Concat(new string[]
                {
                    text5,
                    current.Key,
                    "=",
                    current.Value,
                    "&"
                });
            }
            text2 = TextEncrypt.EncryptPassword(text2).ToLower();
            string value4 = TextEncrypt.EncryptPassword(text4 + "key=" + text2).ToLower();

            dictionary["goods_name"] = "shop";
            dictionary["sign"]       = value4;
            string param = PayHelper.PrepareSign(dictionary);
            string json  = HttpHelper.HttpRequest(text, param);

            System.Collections.Generic.Dictionary <string, string> dictionary2 = JsonHelper.DeserializeJsonToObject <System.Collections.Generic.Dictionary <string, string> >(json);
            if (!dictionary2.ContainsKey("status_code"))
            {
                base.Response.Write("下单失败");
            }
            else
            {
                if (dictionary2["status_code"] == "0")
                {
                    base.Response.Redirect(dictionary2["pay_url"]);
                }
                else
                {
                    base.Response.Write(dictionary2["status_msg"]);
                }
            }
        }
Beispiel #19
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string formString = GameRequest.GetFormString("account");

            if (formString == "")
            {
                base.Response.Write("充值账号错误");
                base.Response.End();
            }
            decimal num = GameRequest.GetFormInt("amount", 0);

            if (num < 6m)
            {
                base.Response.Write("充值金额不能低于6元");
                base.Response.End();
            }
            string      text        = GameRequest.GetFormString("type");
            OnLineOrder onLineOrder = new OnLineOrder();

            onLineOrder.OrderID = PayHelper.GetOrderIDByPrefix("hyf");
            if (Fetch.GetUserCookie() == null)
            {
                onLineOrder.OperUserID = 0;
            }
            else
            {
                onLineOrder.OperUserID = Fetch.GetUserCookie().UserID;
            }
            onLineOrder.Accounts    = formString;
            onLineOrder.OrderAmount = num;
            onLineOrder.IPAddress   = GameRequest.GetUserIP();
            if (text == "alipay-scan")
            {
                text = "4";
                onLineOrder.ShareID = 4;
            }
            else
            {
                if (text == "weixin-scan")
                {
                    onLineOrder.ShareID = 5;
                }
                else
                {
                    if (text == "kuaijie")
                    {
                        text = "10";
                        onLineOrder.ShareID = 7;
                    }
                }
            }
            Message message = FacadeManage.aideTreasureFacade.RequestOrder(onLineOrder);

            if (!message.Success)
            {
                base.Response.Write(message.Content);
                base.Response.End();
            }
            string gateway = ApplicationSettings.Get("url_heyifu");
            string value   = ApplicationSettings.Get("partner_heyifu");
            string str     = ApplicationSettings.Get("key_heyifu");
            string text2   = ApplicationSettings.Get("pay_url");

            this.ordernumber = onLineOrder.OrderID;
            this.paymoney    = num.ToString();
            if (text2 == "")
            {
                text2 = "http://" + base.Request.Url.Host;
            }
            string value2 = text2 + "/pay/heyifu/notify_url.aspx";

            System.Collections.Generic.Dictionary <string, string> dictionary = new System.Collections.Generic.Dictionary <string, string>();
            dictionary["apiName"]      = "WEB_PAY_B2C";
            dictionary["apiVersion"]   = "1.0.0.0";
            dictionary["platformID"]   = value;
            dictionary["merchNo"]      = value;
            dictionary["orderNo"]      = this.ordernumber;
            dictionary["tradeDate"]    = System.DateTime.Now.ToString("yyyyMMdd");
            dictionary["amt"]          = this.paymoney;
            dictionary["merchUrl"]     = value2;
            dictionary["merchParam"]   = "";
            dictionary["tradeSummary"] = "1|1";
            string str2   = PayHelper.PrepareSign(dictionary);
            string value3 = TextEncrypt.EncryptPassword(str2 + str);

            dictionary["bankCode"]      = "";
            dictionary["choosePayType"] = text;
            dictionary["signMsg"]       = value3;
            dictionary["overTime"]      = "";
            dictionary["customerIP"]    = GameRequest.GetUserIP();
            base.Response.Write(PayHelper.BuildForm(dictionary, gateway));
            base.Response.End();
        }
Beispiel #20
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string formString = GameRequest.GetFormString("account");

            if (formString == "")
            {
                base.Response.Write("充值账号错误");
                base.Response.End();
            }
            int formInt = GameRequest.GetFormInt("amount", 0);

            if (formInt < 6)
            {
                base.Response.Write("充值金额不能低于6元");
                base.Response.End();
            }
            string      text        = GameRequest.GetFormString("type");
            OnLineOrder onLineOrder = new OnLineOrder();

            onLineOrder.OrderID = PayHelper.GetOrderIDByPrefix("e");
            if (Fetch.GetUserCookie() == null)
            {
                onLineOrder.OperUserID = 0;
            }
            else
            {
                onLineOrder.OperUserID = Fetch.GetUserCookie().UserID;
            }
            onLineOrder.Accounts    = formString;
            onLineOrder.OrderAmount = formInt;
            onLineOrder.IPAddress   = GameRequest.GetUserIP();
            string text3 = text;

            switch (text3)
            {
            case "alipay":
                text = "alipay.wap";
                onLineOrder.ShareID = 2;
                goto IL_240;

            case "weixin":
                text = "wxpay.wap";
                onLineOrder.ShareID = 3;
                goto IL_240;

            case "alipay-scan":
                text                = "alipay.ma";
                this.paytype        = "支付宝";
                onLineOrder.ShareID = 4;
                goto IL_240;

            case "weixin-scan":
                text                = "wxpay.ma";
                this.paytype        = "微信";
                onLineOrder.ShareID = 5;
                goto IL_240;

            case "qq":
                text = "qqpay.wap";
                onLineOrder.ShareID = 6;
                goto IL_240;

            case "qq-scan":
                text                = "qqpay.ma";
                this.paytype        = "QQ";
                onLineOrder.ShareID = 8;
                goto IL_240;

            case "kuaijie":
                text = "wangyin.wap";
                onLineOrder.ShareID = 7;
                goto IL_240;
            }
            text = "1";
            onLineOrder.ShareID = 1;
IL_240:
            Message message = FacadeManage.aideTreasureFacade.RequestOrder(onLineOrder);

            if (!message.Success)
            {
                base.Response.Write(message.Content);
                base.Response.End();
            }
            string url   = ApplicationSettings.Get("url_e");
            string value = ApplicationSettings.Get("parter_e");
            string str   = ApplicationSettings.Get("key_e");
            string text2 = ApplicationSettings.Get("pay_url");

            if (text2 == "")
            {
                text2 = "http://" + base.Request.Url.Host;
            }
            string orderID = onLineOrder.OrderID;
            string value2  = text2 + "/pay/epay/notify_url.aspx";
            SortedDictionary <string, string> sortedDictionary = new SortedDictionary <string, string>();

            sortedDictionary["out_trade_no"] = orderID;
            sortedDictionary["service"]      = text;
            sortedDictionary["partner"]      = value;
            sortedDictionary["version"]      = "";
            sortedDictionary["charset"]      = "utf-8";
            sortedDictionary["sign_type"]    = "";
            sortedDictionary["total_fee"]    = formInt.ToString("#0.00");
            sortedDictionary["notify_url"]   = value2;
            sortedDictionary["return_url"]   = value2;
            sortedDictionary["nonce_str"]    = TextUtility.CreateAuthStr(20, false);
            string str2  = PayHelper.PrepareSign(sortedDictionary);
            string str3  = TextEncrypt.EncryptPassword(str2 + str).ToLower();
            string param = str2 + "&sign=" + str3;
            string s     = HttpHelper.HttpRequest(url, param);

            base.Response.Write(s);
            base.Response.End();
        }
Beispiel #21
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string formString = GameRequest.GetFormString("account");

            if (formString == "")
            {
                base.Response.Write("充值账号错误");
                base.Response.End();
            }
            int formInt = GameRequest.GetFormInt("amount", 0);

            if (formInt < 6)
            {
                base.Response.Write("充值金额不能低于6元");
                base.Response.End();
            }
            string      text        = GameRequest.GetFormString("type");
            OnLineOrder onLineOrder = new OnLineOrder();

            onLineOrder.OrderID = PayHelper.GetOrderIDByPrefix("lf");
            if (Fetch.GetUserCookie() == null)
            {
                onLineOrder.OperUserID = 0;
            }
            else
            {
                onLineOrder.OperUserID = Fetch.GetUserCookie().UserID;
            }
            onLineOrder.Accounts    = formString;
            onLineOrder.OrderAmount = formInt;
            onLineOrder.IPAddress   = GameRequest.GetUserIP();
            string text4 = text;

            switch (text4)
            {
            case "alipay":
                text = "alipaywap";
                onLineOrder.ShareID = 2;
                goto IL_240;

            case "weixin":
                text = "wxh5";
                onLineOrder.ShareID = 3;
                goto IL_240;

            case "alipay-scan":
                text                = "alipay";
                this.paytype        = "支付宝";
                onLineOrder.ShareID = 4;
                goto IL_240;

            case "weixin-scan":
                text                = "weixin";
                this.paytype        = "微信";
                onLineOrder.ShareID = 5;
                goto IL_240;

            case "qq":
                text = "qqwallet";
                onLineOrder.ShareID = 6;
                goto IL_240;

            case "qq-scan":
                text                = "QQZF";
                this.paytype        = "QQ";
                onLineOrder.ShareID = 8;
                goto IL_240;

            case "kuaijie":
                text = "bank";
                onLineOrder.ShareID = 7;
                goto IL_240;
            }
            text = "bank";
            onLineOrder.ShareID = 1;
IL_240:
            Message message = FacadeManage.aideTreasureFacade.RequestOrder(onLineOrder);

            if (!message.Success)
            {
                base.Response.Write(message.Content);
                base.Response.End();
            }
            string str   = ApplicationSettings.Get("url_lf");
            string value = ApplicationSettings.Get("parter_lf");
            string text2 = ApplicationSettings.Get("key_lf");
            string text3 = ApplicationSettings.Get("pay_url");

            if (text3 == "")
            {
                text3 = "http://" + base.Request.Url.Host;
            }
            string orderID = onLineOrder.OrderID;
            string value2  = text3 + "/pay/laifu/notify_url.aspx";

            System.Collections.Generic.Dictionary <string, string> dictionary = new System.Collections.Generic.Dictionary <string, string>();
            dictionary["version"]    = "1.0";
            dictionary["customerid"] = value;
            dictionary["sdorderno"]  = orderID;
            dictionary["total_fee"]  = formInt.ToString("#0.00");
            dictionary["paytype"]    = text;
            dictionary["notifyurl"]  = value2;
            dictionary["returnurl"]  = value2;
            string password = string.Format("version={0}&customerid={1}&total_fee={2}&sdorderno={3}&notifyurl={4}&returnurl={5}&{6}", new object[]
            {
                dictionary["version"],
                dictionary["customerid"],
                dictionary["total_fee"],
                dictionary["sdorderno"],
                dictionary["notifyurl"],
                dictionary["returnurl"],
                text2
            });
            string value3 = TextEncrypt.EncryptPassword(password).ToLower();

            dictionary["bankcode"] = "";
            dictionary["remark"]   = "";
            dictionary["sign"]     = value3;
            string url = str + "?" + PayHelper.PrepareSign(dictionary);

            base.Response.Redirect(url);
        }
Beispiel #22
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string formString = GameRequest.GetFormString("account");

            if (formString == "")
            {
                base.Response.Write("充值账号错误");
                base.Response.End();
            }
            decimal num = GameRequest.GetFormInt("amount", 0);

            if (num < 6m)
            {
                base.Response.Write("充值金额不能低于6元");
                base.Response.End();
            }
            string      text        = GameRequest.GetFormString("type");
            OnLineOrder onLineOrder = new OnLineOrder();

            onLineOrder.OrderID = PayHelper.GetOrderIDByPrefix("jfb");
            if (Fetch.GetUserCookie() == null)
            {
                onLineOrder.OperUserID = 0;
            }
            else
            {
                onLineOrder.OperUserID = Fetch.GetUserCookie().UserID;
            }
            onLineOrder.Accounts    = formString;
            onLineOrder.OrderAmount = num;
            onLineOrder.IPAddress   = GameRequest.GetUserIP();
            if (text == "alipay")
            {
                text = "1";
                onLineOrder.ShareID = 2;
            }
            if (text == "weixin")
            {
                text = "2";
                onLineOrder.ShareID = 3;
            }
            if (text == "qq")
            {
                text = "3";
                onLineOrder.ShareID = 6;
            }
            Message message = FacadeManage.aideTreasureFacade.RequestOrder(onLineOrder);

            if (!message.Success)
            {
                base.Response.Write(message.Content);
                base.Response.End();
            }
            string gateway = ApplicationSettings.Get("url_jifubao");
            string value   = ApplicationSettings.Get("partner_jifubao");
            string str     = ApplicationSettings.Get("key_jifubao");
            string text2   = ApplicationSettings.Get("pay_url");

            this.ordernumber = onLineOrder.OrderID;
            this.paymoney    = num.ToString();
            if (text2 == "")
            {
                text2 = "http://" + base.Request.Url.Host;
            }
            string value2 = text2 + "/pay/jifubao/notify_url.aspx";

            System.Collections.Generic.Dictionary <string, string> dictionary = new System.Collections.Generic.Dictionary <string, string>();
            dictionary["service"]    = "TRADE.H5PAY";
            dictionary["version"]    = "1.0.0.0";
            dictionary["merId"]      = value;
            dictionary["typeId"]     = text;
            dictionary["tradeNo"]    = this.ordernumber;
            dictionary["tradeDate"]  = System.DateTime.Now.ToString("yyyyMMdd");
            dictionary["amount"]     = this.paymoney;
            dictionary["notifyUrl"]  = value2;
            dictionary["extra"]      = "";
            dictionary["summary"]    = "shop";
            dictionary["expireTime"] = "";
            dictionary["clientIp"]   = GameRequest.GetUserIP();
            string str2   = PayHelper.PrepareSign(dictionary);
            string value3 = TextEncrypt.EncryptPassword(str2 + str).ToLower();

            dictionary["sign"] = value3;
            base.Response.Write(PayHelper.BuildForm(dictionary, gateway));
            base.Response.End();
        }
Beispiel #23
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string formString = GameRequest.GetFormString("account");

            if (formString == "")
            {
                base.Response.Write("充值账号错误");
                base.Response.End();
            }
            int formInt = GameRequest.GetFormInt("amount", 0);

            if (formInt < 6)
            {
                base.Response.Write("充值金额不能低于6元");
                base.Response.End();
            }
            string      formString2 = GameRequest.GetFormString("type");
            OnLineOrder onLineOrder = new OnLineOrder();

            onLineOrder.OrderID = PayHelper.GetOrderIDByPrefix("45");
            if (Fetch.GetUserCookie() == null)
            {
                onLineOrder.OperUserID = 0;
            }
            else
            {
                onLineOrder.OperUserID = Fetch.GetUserCookie().UserID;
            }
            onLineOrder.Accounts    = formString;
            onLineOrder.OrderAmount = formInt;
            onLineOrder.IPAddress   = GameRequest.GetUserIP();
            string value = "";

            if (formString2 == "alipay")
            {
                value = "";
                onLineOrder.ShareID = 2;
                this.paytype        = "支付宝";
            }
            if (formString2 == "weixin")
            {
                value = "";
                onLineOrder.ShareID = 3;
                this.paytype        = "微信";
            }
            if (formString2 == "weixin-scan")
            {
                value = "";
                onLineOrder.ShareID = 5;
                this.paytype        = "微信";
            }
            Message message = FacadeManage.aideTreasureFacade.RequestOrder(onLineOrder);

            if (!message.Success)
            {
                base.Response.Write(message.Content);
                base.Response.End();
            }
            string url    = ApplicationSettings.Get("url_45");
            string value2 = ApplicationSettings.Get("parter_45");
            string text   = ApplicationSettings.Get("key_45");
            string text2  = ApplicationSettings.Get("pay_url");

            if (text2 == "")
            {
                text2 = "http://" + base.Request.Url.Host;
            }
            string value3 = text2 + "/pay/45/notify_url.aspx";

            System.Collections.Generic.Dictionary <string, string> dictionary = new System.Collections.Generic.Dictionary <string, string>();
            dictionary["v"]          = "1.0";
            dictionary["uid"]        = value2;
            dictionary["orderid"]    = onLineOrder.OrderID;
            dictionary["title"]      = "shop";
            dictionary["note"]       = "";
            dictionary["istype"]     = value;
            dictionary["amount"]     = formInt.ToString();
            dictionary["userpara"]   = "";
            dictionary["receiveurl"] = value3;
            dictionary["userIP "]    = GameRequest.GetUserIP();
            dictionary["returnurl"]  = value3;
            string password = string.Concat(new object[]
            {
                dictionary["uid"],
                dictionary["orderid"],
                formInt,
                dictionary["receiveurl"],
                text
            });
            string value4 = TextEncrypt.EncryptPassword(password).ToLower();

            dictionary["sign"] = value4;
            string param = PayHelper.PrepareSign(dictionary);
            string json  = HttpHelper.HttpRequest(url, param);

            System.Collections.Generic.Dictionary <string, string> dictionary2 = JsonHelper.DeserializeJsonToObject <System.Collections.Generic.Dictionary <string, string> >(json);
            if (!dictionary2.ContainsKey("result"))
            {
                base.Response.Write("接口正在维护中...");
            }
            else
            {
                if (dictionary2["result"].ToString() == "ok")
                {
                    base.Response.Redirect(dictionary2["data"]);
                }
                else
                {
                    base.Response.Write(dictionary2["msg"].ToString());
                }
            }
        }
Beispiel #24
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string formString = GameRequest.GetFormString("account");

            if (formString == "")
            {
                base.Response.Write("充值账号错误");
                base.Response.End();
            }
            int formInt = GameRequest.GetFormInt("amount", 0);

            if (formInt < 6)
            {
                base.Response.Write("充值金额不能低于6元");
                base.Response.End();
            }
            string      text        = GameRequest.GetFormString("type");
            OnLineOrder onLineOrder = new OnLineOrder();

            onLineOrder.OrderID = PayHelper.GetOrderIDByPrefix("zdb");
            if (Fetch.GetUserCookie() == null)
            {
                onLineOrder.OperUserID = 0;
            }
            else
            {
                onLineOrder.OperUserID = Fetch.GetUserCookie().UserID;
            }
            onLineOrder.Accounts    = formString;
            onLineOrder.OrderAmount = formInt;
            onLineOrder.IPAddress   = GameRequest.GetUserIP();
            string text8 = text;

            switch (text8)
            {
            case "alipay":
                text = "aliapi_h5api";
                onLineOrder.ShareID = 2;
                goto IL_23A;

            case "weixin":
                text = "weixin_h5api";
                onLineOrder.ShareID = 3;
                goto IL_23A;

            case "alipay-scan":
                text                = "alipay_scan";
                this.paytype        = "支付宝";
                onLineOrder.ShareID = 4;
                goto IL_23A;

            case "weixin-scan":
                text                = "weixin_scan";
                this.paytype        = "微信";
                onLineOrder.ShareID = 5;
                goto IL_23A;

            case "qq":
                text = "qq_h5api";
                onLineOrder.ShareID = 6;
                goto IL_23A;

            case "qq-scan":
                text                = "tenpay_scan";
                this.paytype        = "QQ";
                onLineOrder.ShareID = 8;
                goto IL_23A;

            case "kuaijie":
                text = "wangyin-kj";
                onLineOrder.ShareID = 7;
                goto IL_23A;
            }
            onLineOrder.ShareID = 1;
IL_23A:
            Message message = FacadeManage.aideTreasureFacade.RequestOrder(onLineOrder);

            if (!message.Success)
            {
                base.Response.Write(message.Content);
                base.Response.End();
            }
            string value = ApplicationSettings.Get("parter_zdb");
            string text2 = ApplicationSettings.Get("priKey_zdb");
            string text3 = ApplicationSettings.Get("pay_url");
            string text4 = ApplicationSettings.Get("url_zdb");

            if (text.Contains("_scan"))
            {
                text4 += "scanpay";
            }
            if (text.Contains("_h5api"))
            {
                text4 += "h5apipay";
            }
            if (text3 == "")
            {
                text3 = "http://" + base.Request.Url.Host;
            }
            string value2 = text3 + "/pay/zdb/notify_url.aspx";
            SortedDictionary <string, string> sortedDictionary = new SortedDictionary <string, string>();

            sortedDictionary["merchant_code"]      = value;
            sortedDictionary["service_type"]       = text;
            sortedDictionary["notify_url"]         = value2;
            sortedDictionary["interface_version"]  = "V3.1";
            sortedDictionary["client_ip"]          = GameRequest.GetUserIP();
            sortedDictionary["order_no"]           = onLineOrder.OrderID;
            sortedDictionary["order_time"]         = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            sortedDictionary["order_amount"]       = formInt.ToString();
            sortedDictionary["product_name"]       = "shop";
            sortedDictionary["product_code"]       = "";
            sortedDictionary["product_num"]        = "";
            sortedDictionary["product_desc"]       = "";
            sortedDictionary["extra_return_param"] = "";
            sortedDictionary["extend_param"]       = "";
            string text5      = PayHelper.PrepareSign(sortedDictionary);
            string privateKey = text2;

            privateKey = HttpHelp.RSAPrivateKeyJava2DotNet(privateKey);
            string text6 = HttpHelp.RSASign(text5, privateKey);

            text6 = System.Web.HttpUtility.UrlEncode(text6);
            sortedDictionary["sign_type"] = "RSA-S";
            sortedDictionary["sign"]      = text6;
            string postData = string.Concat(new string[]
            {
                text5,
                "&sign_type=",
                sortedDictionary["sign_type"],
                "&sign=",
                text6
            });
            string   text7 = HttpHelp.HttpPost(text4, postData);
            XElement node  = XElement.Load(new System.IO.StringReader(text7));

            if (!text.Contains("_h5api"))
            {
                XElement xElement = node.XPathSelectElement("/response/qrcode");
                if (xElement == null)
                {
                    base.Response.Write("状态:" + text7 + "<br/>");
                    base.Response.End();
                }
                this.qrcode       = Regex.Match(xElement.ToString(), "(?<=>).*?(?=<)").Value;
                this.order_no     = onLineOrder.OrderID;
                this.order_amount = formInt.ToString();
            }
            else
            {
                XElement xElement2 = node.XPathSelectElement("/response/apiURL");
                if (xElement2 == null)
                {
                    base.Response.Write("状态:" + text7 + "<br/>");
                    base.Response.End();
                }
                else
                {
                    base.Response.Redirect(xElement2.ToString());
                }
            }
        }