protected void Page_Load(object sender, EventArgs e) { //定义变量 userName = GameRequest.GetFormString("txtPayAccounts"); string reUserName = GameRequest.GetFormString("txtPayReAccounts"); money = GameRequest.GetFormInt("hdfSalePrice", 0); sendUrl = System.Configuration.ConfigurationSettings.AppSettings["DaySendUrl"]; //导向地址 notifyUrl = System.Configuration.ConfigurationSettings.AppSettings["DayNotifyUrl"]; //同步回调地址 string key = System.Configuration.ConfigurationSettings.AppSettings["DayKey"]; //密钥 merId = System.Configuration.ConfigurationSettings.AppSettings["DayMerId"]; //商户ID //验证参数 if (userName != reUserName) { ShowAndRedirect("两次输入的用户名不一致", "/Pay/PayDay.aspx"); return; } if (money == 0) { ShowAndRedirect("金额输入有误", "/Pay/PayDay.aspx"); return; } //生成订单 orderID = PayHelper.GetOrderIDByPrefix("Day"); //订单号 OnLineOrder onlineOrder = new OnLineOrder( ); onlineOrder.ShareID = 2; onlineOrder.OrderID = orderID; if (Fetch.GetUserCookie( ) == null) { onlineOrder.OperUserID = 0; } else { onlineOrder.OperUserID = Fetch.GetUserCookie( ).UserID; } onlineOrder.Accounts = userName; onlineOrder.CardTotal = 1; onlineOrder.CardTypeID = money < 30 ? 1 : money < 60 ? 2 : money < 120 ? 3 : 4; onlineOrder.OrderAmount = money; onlineOrder.IPAddress = GameRequest.GetUserIP( ); TreasureFacade treasureFacade = new TreasureFacade( ); Message umsg = treasureFacade.RequestOrder(onlineOrder); if (!umsg.Success) { RenderAlertInfo(true, umsg.Content, 2); return; } //生成sign签名 string signStr = merId + "|" + orderID + "|" + money + "|" + sendUrl + "|" + userName + "|" + key; sign = EncryptMD5(signStr, false, 32); }
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 < 20) { base.Response.Write("充值金额不能低于20"); base.Response.End(); } string text = base.Request["type"]; if (string.IsNullOrEmpty(text)) { base.Response.Write("请选择支付方式"); base.Response.End(); } double num = System.Convert.ToDouble(base.Request["money"]); if (num < 0.0) { base.Response.Write("充值金额不能低于0元"); base.Response.End(); } OnLineOrder onLineOrder = new OnLineOrder(); onLineOrder.OrderID = PayHelper.GetOrderIDByPrefix("th"); 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 == "alipay-wap")) { if (!(a == "weixin-wap")) { if (!(a == "alipay")) { if (a == "weixin") { text = "WEIXIN"; onLineOrder.ShareID = 5; } } else { text = "ZHIFUBAO"; onLineOrder.ShareID = 4; } } else { text = "WEIXIN_H5"; onLineOrder.ShareID = 3; } } else { text = "ZHIFUBAO_H5"; onLineOrder.ShareID = 2; } } Message message = FacadeManage.aideTreasureFacade.RequestOrder(onLineOrder); if (!message.Success) { base.Response.Write(message.Content); base.Response.End(); } string value = ApplicationSettings.Get("partner_41"); string str = ApplicationSettings.Get("key_41"); string actionUrl = ApplicationSettings.Get("url_41"); string str2 = ApplicationSettings.Get("pay_url"); string value2 = str2 + "/pay/41/notify_url.aspx"; string value3 = str2 + "/pay/41/return_url.aspx"; string value4 = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); SortedDictionary <string, string> sortedDictionary = new SortedDictionary <string, string>(); sortedDictionary.Add("input_charset", "UTF-8"); sortedDictionary.Add("notify_url", value2); sortedDictionary.Add("return_url", value3); sortedDictionary.Add("pay_type", "1"); sortedDictionary.Add("bank_code", text); sortedDictionary.Add("merchant_code", value); sortedDictionary.Add("order_no", onLineOrder.OrderID); sortedDictionary.Add("order_amount", num.ToString()); sortedDictionary.Add("order_time", value4); sortedDictionary.Add("product_name", ""); sortedDictionary.Add("product_num", ""); sortedDictionary.Add("req_referer", ""); sortedDictionary.Add("customer_ip", ""); sortedDictionary.Add("customer_phone", ""); sortedDictionary.Add("receive_address", ""); sortedDictionary.Add("return_params", ""); string text2 = ""; foreach (System.Collections.Generic.KeyValuePair <string, string> current in sortedDictionary) { if (current.Value != "") { string text3 = text2; text2 = string.Concat(new string[] { text3, current.Key, "=", current.Value, "&" }); } } text2 = text2 + "key=" + str; sortedDictionary.Add("sign", Jiami.MD5(text2, "UTF-8")); base.Response.Write(HttpHelper.CreatFormHtml(actionUrl, sortedDictionary, "post")); }
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()); } } }
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); }
protected void btnPay_Click(object sender, EventArgs e) { string strAccounts = CtrlHelper.GetText(txtPayAccounts); string strReAccounts = CtrlHelper.GetText(txtPayReAccounts); int salePrice = Utility.StrToInt(this.hdfSalePrice.Value, 0); if (strAccounts == "") { RenderAlertInfo(true, "抱歉,请输入充值帐号。", 2); return; } if (strReAccounts != strAccounts) { RenderAlertInfo(true, "抱歉,两次输入的帐号不一致。", 2); return; } if (salePrice < 10) { RenderAlertInfo(true, "抱歉,充值金额不足10元,无法充值。", 2); return; } OnLineOrder onlineOrder = new OnLineOrder(); onlineOrder.ShareID = 3; onlineOrder.OrderID = PayHelper.GetOrderIDByPrefix("YB"); #region 订单处理 if (Fetch.GetUserCookie() == null) { onlineOrder.OperUserID = 0; } else { onlineOrder.OperUserID = Fetch.GetUserCookie().UserID; } onlineOrder.Accounts = strAccounts; onlineOrder.CardTotal = 1; onlineOrder.CardTypeID = salePrice < 30 ? 1 : salePrice < 60 ? 2 : salePrice < 120 ? 3 : 4; onlineOrder.OrderAmount = salePrice; onlineOrder.IPAddress = GameRequest.GetUserIP(); //生成订单 Message umsg = treasureFacade.RequestOrder(onlineOrder); if (!umsg.Success) { RenderAlertInfo(true, umsg.Content, 2); return; } #endregion #region 提交给易宝处理 // 商户订单号,选填. //若不为"",提交的订单号必须在自身账户交易中唯一;为""时,易宝支付会自动生成随机的商户订单号. string p2_Order = onlineOrder.OrderID; // 支付金额,必填. //单位:元,精确到分. string p3_Amt = salePrice.ToString("f0"); //交易币种,固定值"CNY". string p4_Cur = "CNY"; //商品名称 //用于支付时显示在易宝支付网关左侧的订单产品信息. string p5_Pid = salePrice < 30 ? "蓝钻会员卡" : salePrice < 60 ? "黄钻会员卡" : salePrice < 120 ? "白钻会员卡" : "红钻会员卡"; //商品种类 string p6_Pcat = ""; //商品描述 string p7_Pdesc = ""; //商户接收支付成功数据的地址,支付成功后易宝支付会向该地址发送两次成功通知. string p8_Url = "http://" + HttpContext.Current.Request.Url.Authority + "/Pay/PayYBReceive.aspx"; //送货地址 //为“1”: 需要用户将送货地址留在易宝支付系统;为“0”: 不需要,默认为 ”0”. string p9_SAF = "0"; //商户扩展信息 //商户可以任意填写1K 的字符串,支付成功时将原样返回. string pa_MP = onlineOrder.Accounts; //银行编码 //默认为"",到易宝支付网关.若不需显示易宝支付的页面,直接跳转到各银行、神州行支付、骏网一卡通等支付页面,该字段可依照附录:银行列表设置参数值. string pd_FrpId = ""; //应答机制 //默认为"1": 需要应答机制; string pr_NeedResponse = "1"; string url = Buy.CreateBuyUrl(p2_Order, p3_Amt, p4_Cur, p5_Pid, p6_Pcat, p7_Pdesc, p8_Url, p9_SAF, pa_MP, pd_FrpId, pr_NeedResponse); Response.Redirect(url); #endregion }
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(); } } }
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("ruiyun"); if (Fetch.GetUserCookie() == null) { onLineOrder.OperUserID = 0; } else { onLineOrder.OperUserID = Fetch.GetUserCookie().UserID; } onLineOrder.Accounts = formString; onLineOrder.OrderAmount = formInt; onLineOrder.IPAddress = GameRequest.GetUserIP(); string text6 = text; switch (text6) { case "alipay": text = "1006"; onLineOrder.ShareID = 2; goto IL_240; case "weixin": text = "1005"; 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 = "1594"; onLineOrder.ShareID = 6; goto IL_240; case "qq-scan": text = "1593"; this.paytype = "QQ"; onLineOrder.ShareID = 8; goto IL_240; case "kuaijie": text = "2088"; 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 arg = ApplicationSettings.Get("url_ruiyun"); string text2 = ApplicationSettings.Get("parter_ruiyun"); string str = ApplicationSettings.Get("key_ruiyun"); string text3 = ApplicationSettings.Get("pay_url"); if (text3 == "") { text3 = "http://" + base.Request.Url.Host; } string arg_29A_0 = onLineOrder.OrderID; string text4 = text3 + "/pay/ruiyun/notify_url.aspx"; string text5 = string.Format("parter={0}&type={1}&value={2}&orderid={3}&callbackurl={4}", new object[] { text2, text, onLineOrder.OrderAmount, onLineOrder.OrderID, text4 }); string url = string.Format("{0}?{1}&sign={2}", arg, text5, System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(text5 + str, "MD5").ToLower()); base.Response.Redirect(url); }
/// <summary> /// 提交 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void btnPay_Click(object sender, EventArgs e) { string strAccounts = CtrlHelper.GetText(txtPayAccounts); string strReAccounts = CtrlHelper.GetText(txtPayReAccounts); int amount = CtrlHelper.GetInt(txtPayAmount, 0); if (strAccounts == "") { RenderAlertInfo(true, "抱歉,请输入充值帐号。", 2); return; } if (strReAccounts != strAccounts) { RenderAlertInfo(true, "抱歉,两次输入的帐号不一致。", 2); return; } // 验证是否合法的金额 if (amount <= 0) { RenderAlertInfo(true, "请输入正确的充值金额", 2); return; } // 支付方法 string orderid = PayHelper.GetOrderIDByPrefix("WX"); OnLineOrder onlineOrder = new OnLineOrder(); onlineOrder.ShareID = 401; onlineOrder.OrderID = orderid; if (Fetch.GetUserCookie() == null) { onlineOrder.OperUserID = 0; } else { onlineOrder.OperUserID = Fetch.GetUserCookie().UserID; } onlineOrder.Accounts = strAccounts; onlineOrder.OrderAmount = amount; onlineOrder.IPAddress = GameRequest.GetUserIP(); //生成订单 Message umsg = FacadeManage.aideTreasureFacade.RequestOrder(onlineOrder); if (!umsg.Success) { RenderAlertInfo(true, umsg.Content, 2); return; } //随机字符串 string nonce_str = WeiXinHelper.GetNonce_str(); //商品描述 string body = "充值游戏豆"; //商户订单号 string out_trade_no = orderid; //交易金额(分为单位) int total_fee = Convert.ToInt32(amount * 100); //终端IP string spbill_create_ip = Utility.UserIP; //回调地址 string notify_url = "http://" + Request.Url.Authority + "/Pay/WX/WxpayNotify.aspx"; //商品ID string product_id = orderid.Substring(2, orderid.Length - 2); SortedDictionary <string, object> dic = new SortedDictionary <string, object>(); dic.Add("nonce_str", nonce_str); dic.Add("body", body); dic.Add("trade_type", "NATIVE"); dic.Add("out_trade_no", out_trade_no); dic.Add("total_fee", total_fee); dic.Add("spbill_create_ip", spbill_create_ip); dic.Add("notify_url", notify_url); dic.Add("product_id", product_id); pnlContinue.Visible = false; RenderAlertInfo(false, "页面正跳转到支付平台,请稍候。。。", 2); SortedDictionary <string, object> result = WeiXinHelper.UnifiedOrder(dic, 10); string code = result["return_code"].ToString(); StringBuilder builder = new StringBuilder(); builder.AppendLine(CreateInputHidden("return_code", code)); builder.AppendLine(CreateInputHidden("return_msg", result["return_msg"].ToString())); if (code == "SUCCESS") { builder.AppendLine(CreateInputHidden("code_url", result["code_url"].ToString())); builder.AppendLine(CreateInputHidden("orderID", orderid)); builder.AppendLine(CreateInputHidden("amount", amount.ToString())); } formData = builder.ToString(); js = "<script>window.onload = function() { document.forms[0].submit(); }</script>"; }
protected void Page_Load(object sender, System.EventArgs e) { string formString = GameRequest.GetFormString("account"); OnLineOrder onLineOrder = new OnLineOrder(); if (formString == "") { base.Response.Write("充值账号错误"); base.Response.End(); } string formString2 = GameRequest.GetFormString("qudaoId"); if (formString2 == "") { base.Response.Write("渠道错误"); base.Response.End(); } string p7_productcode = ""; if (formString2 == "2") { p7_productcode = "ZFB"; onLineOrder.ShareID = 2; } else if (formString2 == "3") { p7_productcode = "WX"; onLineOrder.ShareID = 3; } else if (formString2 == "6") { p7_productcode = "QQ"; } else { base.Response.Write("渠道错误"); base.Response.End(); } var formInt = GameRequest.GetFormFloat("amount", 0).ToDecimal(0); //if (formInt < 20) //{ // base.Response.Write("充值金额不能低于20"); // base.Response.End(); //} string text = base.Request["type"]; onLineOrder.OrderID = PayHelper.GetOrderIDByPrefix("jft"); if (Fetch.GetUserCookie() == null) { onLineOrder.OperUserID = 0; } else { onLineOrder.OperUserID = Fetch.GetUserCookie().UserID; } onLineOrder.Accounts = formString; onLineOrder.OrderAmount = formInt; onLineOrder.IPAddress = GameRequest.GetUserIP(); string p25_terminal = ""; string p26_iswappay = ""; //string a; //if ((a = text) != null) //{ // if (!(a == "alipay-wap")) // { // if (!(a == "weixin-wap")) // { // if (!(a == "alipay")) // { // if (a == "weixin") // { // text = "3"; // p25_terminal = "3"; // p26_iswappay = "1"; // onLineOrder.ShareID = 5; // } // } // else // { // text = "4"; // p25_terminal = "3"; // p26_iswappay = "1"; // onLineOrder.ShareID = 4; // } // } // else // { // text = "3"; // p25_terminal = "2"; // p26_iswappay = "3"; // onLineOrder.ShareID = 3; // } // } // else // { // text = "4"; // p25_terminal = "2"; // p26_iswappay = "3"; // onLineOrder.ShareID = 2; // } //} Message message = FacadeManage.aideTreasureFacade.RequestOrder(onLineOrder); if (!message.Success) { base.Response.Write(message.Content); base.Response.End(); } Random rd = new Random(); this.p1_yingyongnum.Value = Config.userCode; this.p2_ordernumber.Value = onLineOrder.OrderID; this.p3_money.Value = onLineOrder.OrderAmount.ToString("#0.00"); this.p6_ordertime.Value = System.DateTime.Now.ToString("yyyyMMddHHmmss"); this.p7_productcode.Value = text; this.p8_sign.Value = ""; // this.p9_signtype.Value = "1"; //MD5 this.p10_bank_card_code.Value = Request.Form["p10_bank_card_code"]; //? this.p11_cardtype.Value = ""; this.p12_channel.Value = ""; this.p13_orderfailertime.Value = ""; this.p14_customname.Value = Request.Form["p14_customname"]; //? this.p15_customcontact.Value = ""; this.p16_customip.Value = "192_168_0_253"; this.p17_product.Value = "product"; this.p18_productcat.Value = ""; this.p19_productnum.Value = ""; this.p20_pdesc.Value = ""; this.p21_version.Value = ""; this.p22_sdkversion.Value = ""; this.p23_charset.Value = "UTF-8"; this.p24_remark.Value = ""; this.p25_terminal.Value = Request.Form["p25_terminal"]; //? this.p26_ext1.Value = ""; this.p27_ext2.Value = ""; this.p28_ext3.Value = ""; this.p29_ext4.Value = ""; this.Card_Number.Value = Request.Form["Card_Number"]; this.Card_Password.Value = Request.Form["Card_Password"]; this.requestBean = new RequestBean { p1_yingyongnum = this.p1_yingyongnum.Value, p2_ordernumber = this.p2_ordernumber.Value, p3_money = this.p3_money.Value, p6_ordertime = this.p6_ordertime.Value, p7_productcode = this.p7_productcode.Value, p8_sign = "" }; this.p8_sign.Value = GetSign(requestBean); ScriptManager.RegisterStartupScript(this.Page, GetType(), "post1", "Post();", true); }
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 = base.Request["type"]; OnLineOrder onLineOrder = new OnLineOrder(); onLineOrder.OrderID = PayHelper.GetOrderIDByPrefix("wsf"); 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 text4 = text; switch (text4) { case "alipay": text = "4"; value = "2"; onLineOrder.ShareID = 2; goto IL_23F; case "weixin": text = "3"; value = "2"; onLineOrder.ShareID = 3; goto IL_23F; case "alipay-scan": text = "4"; value = "1"; onLineOrder.ShareID = 4; goto IL_23F; case "weixin-scan": text = "3"; value = "1"; onLineOrder.ShareID = 5; goto IL_23F; case "qq": text = "qq-wap"; onLineOrder.ShareID = 6; goto IL_23F; case "qq-scan": text = "qqsm"; onLineOrder.ShareID = 8; goto IL_23F; case "kuaijie": text = "wangyin-kj"; onLineOrder.ShareID = 7; goto IL_23F; } onLineOrder.ShareID = 1; IL_23F: Message message = FacadeManage.aideTreasureFacade.RequestOrder(onLineOrder); if (!message.Success) { base.Response.Write(message.Content); base.Response.End(); } string text2 = ApplicationSettings.Get("pay_url"); if (text2 == "") { text2 = "http://" + base.Request.Url.Host; } string value2 = text2 + "/pay/wsfpay/notify_url.aspx"; string value3 = ApplicationSettings.Get("parter_wsf"); string str = ApplicationSettings.Get("key_wsf"); string gateway = ApplicationSettings.Get("url_wsf"); System.Collections.Generic.Dictionary <string, string> dictionary = new System.Collections.Generic.Dictionary <string, string>(); dictionary["p1_usercode"] = value3; dictionary["p2_order"] = onLineOrder.OrderID; dictionary["p3_money"] = onLineOrder.OrderAmount.ToString(); dictionary["p4_returnurl"] = value2; dictionary["p5_notifyurl"] = value2; dictionary["p6_ordertime"] = System.DateTime.Now.ToString("yyyyMMddHHmmss"); string text3 = ""; foreach (System.Collections.Generic.KeyValuePair <string, string> current in dictionary) { text3 = text3 + current.Value + "&"; } text3 = text3.Remove(text3.Length - 1); string value4 = TextEncrypt.EncryptPassword(text3 + str); dictionary["p7_sign"] = value4; dictionary["p8_signtype"] = "1"; dictionary["p9_paymethod"] = text; dictionary["p18_product"] = "productname"; dictionary["p25_terminal"] = value; dictionary["p26_iswappay"] = value; base.Response.Write(PayHelper.BuildForm(dictionary, gateway)); base.Response.End(); }
public string PlayerDraw(System.Web.HttpContext context) { UserTicketInfo userCookie = Fetch.GetUserCookie(); string result; if (userCookie == null) { result = "{\"code\":0,\"msg\":\"由于长时间未操作,请重新从大厅操作\"}"; } else { decimal dwScore = 0m; if (!decimal.TryParse(context.Request["score"].ToString(), out dwScore)) { result = "{\"error\":0,\"msg\":\"兑换金额的格式有误!\"}"; } else { Message message = FacadeManage.aideAccountsFacade.PlayerDraw(userCookie.UserID, dwScore, "", PayHelper.GetOrderIDByPrefix(""), GameRequest.GetUserIP()); if (message.Success) { result = "{\"error\":1,\"msg\":\"操作成功!\"}"; } else { result = "{\"error\":0,\"msg\":\"" + message.Content + "\"}"; } } } return(result); }
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); }
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(); }
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("y"); if (Fetch.GetUserCookie() == null) { onLineOrder.OperUserID = 0; } else { onLineOrder.OperUserID = Fetch.GetUserCookie().UserID; } onLineOrder.Accounts = formString; onLineOrder.OrderAmount = formInt; onLineOrder.IPAddress = GameRequest.GetUserIP(); if (text == "bank") { text = "1000"; onLineOrder.ShareID = 1; } if (text == "alipay-wap-yika") { text = "1006"; onLineOrder.ShareID = 2; } if (text == "weixin-wap-yika") { text = "1007"; onLineOrder.ShareID = 3; } if (text == "alipay") { text = "992"; onLineOrder.ShareID = 4; } if (text == "weixin") { text = "1004"; onLineOrder.ShareID = 5; } if (text == "qq-wap") { text = "1008"; onLineOrder.ShareID = 6; } Message message = FacadeManage.aideTreasureFacade.RequestOrder(onLineOrder); if (!message.Success) { base.Response.Write(message.Content); base.Response.End(); } string str = ApplicationSettings.Get("url_yika"); string text2 = ApplicationSettings.Get("parter_yika"); string text3 = ApplicationSettings.Get("key_yika"); string text4 = ApplicationSettings.Get("pay_url"); if (text4 == "") { text4 = "http://" + base.Request.Url.Host; } string orderID = onLineOrder.OrderID; string text5 = text4 + "/pay/yika/notify_url.aspx"; string str2 = text4 + "/pay/yika/return_url.aspx"; string password = string.Format("parter={0}&type={1}&value={2}&orderid={3}&callbackurl={4}{5}", new object[] { text2, text, formInt, orderID, text5, text3 }); string str3 = TextEncrypt.EncryptPassword(password).ToLower(); string value = str + "?parter=" + text2; System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(value); stringBuilder.Append("&type=" + text); stringBuilder.Append("&value=" + formInt); stringBuilder.Append("&orderid=" + orderID); stringBuilder.Append("&callbackurl=" + text5); stringBuilder.Append("&hrefbackurl=" + str2); stringBuilder.Append("&payerIp=" + onLineOrder.IPAddress); stringBuilder.Append("&attach="); stringBuilder.Append("&sign=" + str3); stringBuilder.Append("&agent="); stringBuilder.Append("&playerId="); base.Response.Redirect(stringBuilder.ToString()); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //充值配置验证 int payId = GameRequest.GetInt("id", 0); if (payId <= 0) { Response.Redirect("/Menu/Buy.aspx"); } RoomCardConfig config = FacadeManage.aideTreasureFacade.GetRoomCardConfig(payId); if (config == null) { Response.Redirect("/Menu/Buy.aspx"); } // 支付方法 string orderID = PayHelper.GetOrderIDByPrefix("WapWX"); OnLineOrder onlineOrder = new OnLineOrder(); onlineOrder.ShareID = 81; onlineOrder.OrderID = orderID; UserTicketInfo info = userTicket; onlineOrder.OperUserID = info.UserID; onlineOrder.GameID = info.GameID; onlineOrder.OrderAmount = config.Amount; onlineOrder.IPAddress = GameRequest.GetUserIP(); //生成订单 Message umsg = FacadeManage.aideTreasureFacade.RequestOrderFK(onlineOrder, payId); if (!umsg.Success) { ShowInfo(umsg.Content); return; } //随机字符串 string nonce_str = WeiXinHelper.GetNonce_str(); //商品描述 string body = "充值房卡"; //商户订单号 string out_trade_no = orderID; //交易金额(分为单位) int total_fee = Convert.ToInt32(config.Amount * 100); //终端IP string spbill_create_ip = Utility.UserIP; //回调地址 string notify_url = "http://" + Request.Url.Authority + "/Pay/WX/WxpayNotify.aspx"; //商品ID string product_id = orderID.Substring(5, orderID.Length - 5); SortedDictionary <string, object> dic = new SortedDictionary <string, object>(); dic.Add("nonce_str", nonce_str); dic.Add("body", body); dic.Add("trade_type", "NATIVE"); dic.Add("out_trade_no", out_trade_no); dic.Add("total_fee", total_fee); dic.Add("spbill_create_ip", spbill_create_ip); dic.Add("notify_url", notify_url); dic.Add("product_id", product_id); SortedDictionary <string, object> result = WeiXinHelper.UnifiedOrder(dic, 10); string code = result["return_code"].ToString(); StringBuilder builder = new StringBuilder(); builder.AppendLine(CreateInputHidden("return_code", code)); builder.AppendLine(CreateInputHidden("return_msg", result["return_msg"].ToString())); if (code == "SUCCESS") { builder.AppendLine(CreateInputHidden("code_url", result["code_url"].ToString())); builder.AppendLine(CreateInputHidden("orderID", out_trade_no)); builder.AppendLine(CreateInputHidden("amount", config.Amount.ToString())); } formData = builder.ToString(); js = "<script>window.onload = function() { document.forms[0].submit(); }</script>"; } //NativePay nativePay = new NativePay(); //string url2 = nativePay.GetPayUrl("123456789"); //Image2.ImageUrl = "MakeQRCode.aspx?data=" + HttpUtility.UrlEncode(url2); ////初始化二维码生成工具 //QRCodeEncoder qrCodeEncoder = new QRCodeEncoder(); //qrCodeEncoder.QRCodeEncodeMode = QRCodeEncoder.ENCODE_MODE.BYTE; //qrCodeEncoder.QRCodeErrorCorrect = QRCodeEncoder.ERROR_CORRECTION.M; //qrCodeEncoder.QRCodeVersion = 0; //qrCodeEncoder.QRCodeScale = 4; ////将字符串生成二维码图片 //Bitmap image = qrCodeEncoder.Encode(str, Encoding.Default); ////保存为PNG到内存流 //MemoryStream ms = new MemoryStream(); //image.Save(ms, ImageFormat.Png); ////输出二维码图片 //Response.BinaryWrite(ms.GetBuffer()); //Response.End(); }
/// <summary> /// 提交 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void btnPay_Click(object sender, EventArgs e) { string strAccounts = CtrlHelper.GetText(txtPayAccounts); string strReAccounts = CtrlHelper.GetText(txtPayReAccounts); int amount = Convert.ToInt32(ddlCurrenry.SelectedValue); if (strAccounts == "") { RenderAlertInfo(true, "抱歉,请输入充值帐号。", 2); return; } if (strReAccounts != strAccounts) { RenderAlertInfo(true, "抱歉,两次输入的帐号不一致。", 2); return; } /*测试代码 允许输入0.01的金额*/ //string strAmount = CtrlHelper.GetText(txtPayAmount); //Regex regex = new Regex(@"^\d{1,18}(.\d{1,2}){1}?$"); //if(!regex.IsMatch(strAmount)) //{ // RenderAlertInfo(true, "请输入正确的充值金额。", 2); // return; //} //decimal amount = Convert.ToDecimal(strAmount); /*测试代码 结束*/ // 验证是否合法的金额 if (amount <= 0) { RenderAlertInfo(true, "请输入正确的充值金额", 2); return; } // 支付方法 string p9_paymethod = ""; string payPrefix = string.Empty; int shareID = 0; switch (payType) { case "alipay": payPrefix = "JFTZFB"; shareID = 14; p9_paymethod = "4"; break; case "wechat": payPrefix = "JFTWX"; shareID = 15; p9_paymethod = "3"; break; case "bank": default: payPrefix = "JFTBank"; shareID = 13; p9_paymethod = "1"; break; } OnLineOrder onlineOrder = new OnLineOrder(); onlineOrder.ShareID = shareID; onlineOrder.OrderID = PayHelper.GetOrderIDByPrefix(payPrefix); if (Fetch.GetUserCookie() == null) { onlineOrder.OperUserID = 0; } else { onlineOrder.OperUserID = Fetch.GetUserCookie().UserID; } onlineOrder.Accounts = strAccounts; onlineOrder.OrderAmount = amount; onlineOrder.IPAddress = GameRequest.GetUserIP(); //生成订单 Message umsg = FacadeManage.aideTreasureFacade.RequestOrder(onlineOrder, cardType, 0); if (!umsg.Success) { RenderAlertInfo(true, umsg.Content, 2); return; } // 商户ID string p1_usercode = ApplicationSettings.Get("jftBankID"); // 秘钥 string key = ApplicationSettings.Get("jftBankKey"); // 回调页面 string p4_returnurl = "http://" + HttpContext.Current.Request.Url.Authority + "/Pay/JFT/PublicReturn.aspx"; // 通知地址 string p5_notifyurl = "http://" + HttpContext.Current.Request.Url.Authority + "/Pay/JFT/PublicAdvice.aspx"; // 请求时间 string p6_ordertime = DateTime.Now.ToString("yyyyMMddHHmmss"); // 签名信息 string strEncryption = string.Format("{0}&{1}&{2}&{3}&{4}&{5}{6}", p1_usercode, onlineOrder.OrderID, amount, p4_returnurl, p5_notifyurl, p6_ordertime, key ); string p7_sign = Utility.MD5(strEncryption).ToUpper(); // 加密方法 string p8_signtype = ""; // 银行编码 string p10_paychannelnum = ""; // 商户进行支付的银行卡类型 string p11_cardtype = ""; // 银行支付类型 string p12_channel = ""; // 订单失效时间 string p13_orderfailertime = ""; // 客户或卖家名称 string p14_customname = ""; // 客户联系方式类型 1、email,2、phone,3、地址 string p15_customcontacttype = ""; // 客户联系方式 string p16_customcontact = ""; // 客户IP地址 string p17_customip = ""; // 商品名称 string p18_product = ""; // 商品种类 string p19_productcat = ""; // 商品数量 string p20_productnum = ""; // 商品描述 string p21_pdesc = ""; // 接口版本 string p22_version = "2.0"; // 编码类型 string p23_charset = ""; // 备注信息 string p24_remark = ""; #region 整理参数 pnlContinue.Visible = false; RenderAlertInfo(false, "页面正跳转到支付平台,请稍候。。。", 2); StringBuilder builder = new StringBuilder(); builder.AppendLine(CreateInputHidden("p1_usercode", p1_usercode)); builder.AppendLine(CreateInputHidden("p2_order", onlineOrder.OrderID)); builder.AppendLine(CreateInputHidden("p3_money", amount.ToString())); builder.AppendLine(CreateInputHidden("p4_returnurl", p4_returnurl)); builder.AppendLine(CreateInputHidden("p5_notifyurl", p5_notifyurl)); builder.AppendLine(CreateInputHidden("p6_ordertime", p6_ordertime)); builder.AppendLine(CreateInputHidden("p7_sign", p7_sign)); builder.AppendLine(CreateInputHidden("p8_signtype", p8_signtype)); builder.AppendLine(CreateInputHidden("p9_paymethod", p9_paymethod)); builder.AppendLine(CreateInputHidden("p10_paychannelnum", p10_paychannelnum)); builder.AppendLine(CreateInputHidden("p11_cardtype", p11_cardtype)); builder.AppendLine(CreateInputHidden("p12_channel", p12_channel)); builder.AppendLine(CreateInputHidden("p13_orderfailertime", p13_orderfailertime)); builder.AppendLine(CreateInputHidden("p14_customname", p14_customname)); builder.AppendLine(CreateInputHidden("p15_customcontacttype", p15_customcontacttype)); builder.AppendLine(CreateInputHidden("p16_customcontact", p16_customcontact)); builder.AppendLine(CreateInputHidden("p17_customip", p17_customip)); builder.AppendLine(CreateInputHidden("p18_product", p18_product)); builder.AppendLine(CreateInputHidden("p19_productcat", p19_productcat)); builder.AppendLine(CreateInputHidden("p20_productnum", p20_productnum)); builder.AppendLine(CreateInputHidden("p21_pdesc", p21_pdesc)); builder.AppendLine(CreateInputHidden("p22_version", p22_version)); builder.AppendLine(CreateInputHidden("p23_charset", p23_charset)); builder.AppendLine(CreateInputHidden("p24_remark", p24_remark)); formData = builder.ToString(); #endregion js = "<script>window.onload = function() { document.forms[0].submit(); }</script>"; }
public void btnPay_Click(object sender, System.EventArgs e) { string text = CtrlHelper.GetText(this.txtPayAccounts); string text2 = CtrlHelper.GetText(this.txtPayReAccounts); int @int = CtrlHelper.GetInt(this.txtPayAmount, 0); if (text == "") { this.RenderAlertInfo(true, "抱歉,请输入充值帐号。", 2); } else { if (text2 != text) { this.RenderAlertInfo(true, "抱歉,两次输入的帐号不一致。", 2); } else { if (@int <= 0) { this.RenderAlertInfo(true, "请输入正确的充值金额", 2); } else { string prefix = string.Empty; string a; int shareID; string value; if ((a = this.payType) != null) { if (a == "alipay") { prefix = "JFTZFB"; shareID = 14; value = "4"; goto IL_121; } if (a == "wechat") { prefix = "JFTWX"; shareID = 15; value = "3"; goto IL_121; } if (!(a == "bank")) { } } prefix = "JFTBank"; shareID = 13; value = "1"; IL_121: OnLineOrder onLineOrder = new OnLineOrder(); onLineOrder.ShareID = shareID; onLineOrder.OrderID = PayHelper.GetOrderIDByPrefix(prefix); if (Fetch.GetUserCookie() == null) { onLineOrder.OperUserID = 0; } else { onLineOrder.OperUserID = Fetch.GetUserCookie().UserID; } onLineOrder.Accounts = text; onLineOrder.OrderAmount = @int; onLineOrder.IPAddress = GameRequest.GetUserIP(); Message message = FacadeManage.aideTreasureFacade.RequestOrder(onLineOrder); if (!message.Success) { this.RenderAlertInfo(true, message.Content, 2); } else { string text3 = ApplicationSettings.Get("jftBankID"); string text4 = ApplicationSettings.Get("jftBankKey"); string text5 = "http://" + System.Web.HttpContext.Current.Request.Url.Authority + "/UserService/JFT/PublicReturn.aspx"; string text6 = "http://" + System.Web.HttpContext.Current.Request.Url.Authority + "/UserService/JFT/PublicAdvice.aspx"; string text7 = System.DateTime.Now.ToString("yyyyMMddHHmmss"); string s = string.Format("{0}&{1}&{2}&{3}&{4}&{5}{6}", new object[] { text3, onLineOrder.OrderID, @int, text5, text6, text7, text4 }); string value2 = Utility.MD5(s).ToUpper(); string value3 = ""; string value4 = ""; string value5 = ""; string value6 = ""; string value7 = ""; string value8 = ""; string value9 = ""; string value10 = ""; string value11 = ""; string value12 = ""; string value13 = ""; string value14 = ""; string value15 = ""; string value16 = "2.0"; string value17 = ""; string value18 = ""; this.pnlContinue.Visible = false; this.RenderAlertInfo(false, "页面正跳转到支付平台,请稍候。。。", 2); System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(); stringBuilder.AppendLine(this.CreateInputHidden("p1_usercode", text3)); stringBuilder.AppendLine(this.CreateInputHidden("p2_order", onLineOrder.OrderID)); stringBuilder.AppendLine(this.CreateInputHidden("p3_money", @int.ToString())); stringBuilder.AppendLine(this.CreateInputHidden("p4_returnurl", text5)); stringBuilder.AppendLine(this.CreateInputHidden("p5_notifyurl", text6)); stringBuilder.AppendLine(this.CreateInputHidden("p6_ordertime", text7)); stringBuilder.AppendLine(this.CreateInputHidden("p7_sign", value2)); stringBuilder.AppendLine(this.CreateInputHidden("p8_signtype", value3)); stringBuilder.AppendLine(this.CreateInputHidden("p9_paymethod", value)); stringBuilder.AppendLine(this.CreateInputHidden("p10_paychannelnum", value4)); stringBuilder.AppendLine(this.CreateInputHidden("p11_cardtype", value5)); stringBuilder.AppendLine(this.CreateInputHidden("p12_channel", value6)); stringBuilder.AppendLine(this.CreateInputHidden("p13_orderfailertime", value7)); stringBuilder.AppendLine(this.CreateInputHidden("p14_customname", value8)); stringBuilder.AppendLine(this.CreateInputHidden("p15_customcontacttype", value9)); stringBuilder.AppendLine(this.CreateInputHidden("p16_customcontact", value10)); stringBuilder.AppendLine(this.CreateInputHidden("p17_customip", value11)); stringBuilder.AppendLine(this.CreateInputHidden("p18_product", value12)); stringBuilder.AppendLine(this.CreateInputHidden("p19_productcat", value13)); stringBuilder.AppendLine(this.CreateInputHidden("p20_productnum", value14)); stringBuilder.AppendLine(this.CreateInputHidden("p21_pdesc", value15)); stringBuilder.AppendLine(this.CreateInputHidden("p22_version", value16)); stringBuilder.AppendLine(this.CreateInputHidden("p23_charset", value17)); stringBuilder.AppendLine(this.CreateInputHidden("p24_remark", value18)); this.formData = stringBuilder.ToString(); this.js = "<script>window.onload = function() { document.forms[0].submit(); }</script>"; } } } } }
public void btnPay_Click(object sender, System.EventArgs e) { string text = CtrlHelper.GetText(this.txtPayAccounts); string text2 = CtrlHelper.GetText(this.txtPayReAccounts); string text3 = CtrlHelper.GetText(this.txtCardNumber); string text4 = CtrlHelper.GetText(this.txtCardPassword); int num = System.Convert.ToInt32(this.ddlAmount.SelectedValue); if (text == "") { this.RenderAlertInfo(true, "抱歉,请输入充值帐号。", 2); } else { if (text2 != text) { this.RenderAlertInfo(true, "抱歉,两次输入的帐号不一致。", 2); } else { if (num == 0) { this.RenderAlertInfo(true, "请选择卡面值。", 2); } else { if (string.IsNullOrEmpty(text3)) { this.RenderAlertInfo(true, "抱歉,请输入卡号。", 2); } else { if (string.IsNullOrEmpty(text4)) { this.RenderAlertInfo(true, "抱歉,请输入卡密码。", 2); } else { OnLineOrder onLineOrder = new OnLineOrder(); onLineOrder.ShareID = this.cardType; onLineOrder.OrderID = PayHelper.GetOrderIDByPrefix("JFTCard"); if (Fetch.GetUserCookie() == null) { onLineOrder.OperUserID = 0; } else { onLineOrder.OperUserID = Fetch.GetUserCookie().UserID; } onLineOrder.Accounts = text; onLineOrder.OrderAmount = num; onLineOrder.IPAddress = GameRequest.GetUserIP(); Message message = FacadeManage.aideTreasureFacade.RequestOrder(onLineOrder); if (!message.Success) { this.RenderAlertInfo(true, message.Content, 2); } else { string text5 = ApplicationSettings.Get("jftBankID"); string text6 = ApplicationSettings.Get("jftBankKey"); string text7 = "http://" + System.Web.HttpContext.Current.Request.Url.Authority + "/UserService/JFT/CardReturn.aspx"; string text8 = "http://" + System.Web.HttpContext.Current.Request.Url.Authority + "/UserService/JFT/PublicAdvice.aspx"; string text9 = System.DateTime.Now.ToString("yyyyMMddHHmmss"); string s = string.Format("{0}&{1}&{2}&{3}&{4}&{5}{6}", new object[] { text5, onLineOrder.OrderID, num, text7, text8, text9, text6 }); string value = Utility.MD5(s).ToUpper(); string value2 = ""; string value3 = "5"; string fieldText = EnumDescription.GetFieldText(typeof(AppConfig.JFTPayCardType), this.cardType); string value4 = ""; string value5 = ""; string value6 = ""; string value7 = ""; string value8 = ""; string value9 = ""; string value10 = ""; string value11 = ""; string value12 = text4; string value13 = text3; string value14 = ""; string value15 = "2.0"; string value16 = ""; string value17 = ""; this.RenderAlertInfo(false, "页面正跳转到支付平台,请稍候。。。", 2); System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(); stringBuilder.AppendLine(this.CreateInputHidden("p1_usercode", text5)); stringBuilder.AppendLine(this.CreateInputHidden("p2_order", onLineOrder.OrderID)); stringBuilder.AppendLine(this.CreateInputHidden("p3_money", num.ToString())); stringBuilder.AppendLine(this.CreateInputHidden("p4_returnurl", text7)); stringBuilder.AppendLine(this.CreateInputHidden("p5_notifyurl", text8)); stringBuilder.AppendLine(this.CreateInputHidden("p6_ordertime", text9)); stringBuilder.AppendLine(this.CreateInputHidden("p7_sign", value)); stringBuilder.AppendLine(this.CreateInputHidden("p8_signtype", value2)); stringBuilder.AppendLine(this.CreateInputHidden("p9_paymethod", value3)); stringBuilder.AppendLine(this.CreateInputHidden("p10_paychannelnum", fieldText)); stringBuilder.AppendLine(this.CreateInputHidden("p11_cardtype", value4)); stringBuilder.AppendLine(this.CreateInputHidden("p12_channel", value5)); stringBuilder.AppendLine(this.CreateInputHidden("p13_orderfailertime", value6)); stringBuilder.AppendLine(this.CreateInputHidden("p14_customname", value7)); stringBuilder.AppendLine(this.CreateInputHidden("p15_customcontacttype", value8)); stringBuilder.AppendLine(this.CreateInputHidden("p16_customcontact", value9)); stringBuilder.AppendLine(this.CreateInputHidden("p17_customip", value10)); stringBuilder.AppendLine(this.CreateInputHidden("p18_product", value11)); stringBuilder.AppendLine(this.CreateInputHidden("p19_productcat", value12)); stringBuilder.AppendLine(this.CreateInputHidden("p20_productnum", value13)); stringBuilder.AppendLine(this.CreateInputHidden("p21_pdesc", value14)); stringBuilder.AppendLine(this.CreateInputHidden("p22_version", value15)); stringBuilder.AppendLine(this.CreateInputHidden("p23_charset", value16)); stringBuilder.AppendLine(this.CreateInputHidden("p24_remark", value17)); this.formData = stringBuilder.ToString(); this.js = "<script>window.onload = function() { document.forms[0].submit(); }</script>"; } } } } } } }
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); }
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; }
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(); }
protected void btnPay_Click(object sender, EventArgs e) { string strAccounts = CtrlHelper.GetText(txtPayAccounts); string strReAccounts = CtrlHelper.GetText(txtPayReAccounts); int salePrice = Utility.StrToInt(this.hdfSalePrice.Value, 0); if (strAccounts == "") { RenderAlertInfo(true, "抱歉,请输入充值帐号。", 2); return; } if (strReAccounts != strAccounts) { RenderAlertInfo(true, "抱歉,两次输入的帐号不一致。", 2); return; } if (salePrice < 10) { RenderAlertInfo(true, "抱歉,充值金额不足10元,无法充值。", 2); return; } OnLineOrder onlineOrder = new OnLineOrder(); onlineOrder.ShareID = 2; onlineOrder.OrderID = PayHelper.GetOrderIDByPrefix("KQ"); #region 订单处理 if (Fetch.GetUserCookie() == null) { onlineOrder.OperUserID = 0; } else { onlineOrder.OperUserID = Fetch.GetUserCookie().UserID; } onlineOrder.Accounts = strAccounts; onlineOrder.CardTotal = 1; onlineOrder.CardTypeID = salePrice < 30 ? 1 : salePrice < 60 ? 2 : salePrice < 120 ? 3 : 4; onlineOrder.OrderAmount = salePrice; onlineOrder.IPAddress = GameRequest.GetUserIP(); //生成订单 Message umsg = treasureFacade.RequestOrder(onlineOrder); if (!umsg.Success) { RenderAlertInfo(true, umsg.Content, 2); return; } #endregion #region 提交给快钱支付网关 //人民币网关账户号 ///请登录快钱系统获取用户编号,用户编号后加01即为人民币网关账户号。 string merchantAcctId = ApplicationSettings.Get("merchantIdRMB"); //人民币网关密钥 ///区分大小写.请与快钱联系索取 string key = ApplicationSettings.Get("keyValueRMB"); //服务器接受支付结果的后台地址.与[pageUrl]不能同时为空。必须是绝对地址。 ///快钱通过服务器连接的方式将交易结果发送到[bgUrl]对应的页面地址,在商户处理完成后输出的<result>如果为1,页面会转向到<redirecturl>对应的地址。 ///如果快钱未接收到<redirecturl>对应的地址,快钱将把支付结果GET到[pageUrl]对应的页面。 //bgUrl.Value = "http://www.yoursite.com/receive.aspx"; string bgUrl = "http://" + HttpContext.Current.Request.Url.Authority + "/Pay/PayReceive.aspx"; //字符集.固定选择值。可为空。 ///只能选择1、2、3. ///1代表UTF-8; 2代表GBK; 3代表gb2312 ///默认值为1 string inputCharset = "1"; //网关版本.固定值 ///快钱会根据版本号来调用对应的接口处理程序。 ///本代码版本号固定为v2.0 string version = "v2.0"; //语言种类.固定选择值。 ///只能选择1、2、3 ///1代表中文;2代表英文 ///默认值为1 string language = "1"; //签名类型.固定值 ///1代表MD5签名 ///当前版本固定为1 string signType = "1"; //支付人姓名 ///可为中文或英文字符 string payerName = onlineOrder.Accounts; //支付人联系方式类型.固定选择值 ///只能选择1 ///1代表Email string payerContactType = "1"; //支付人联系方式 ///只能选择Email或手机号 string payerContact = ""; //商户订单号 ///由字母、数字、或[-][_]组成 string orderId = onlineOrder.OrderID; //订单金额 ///以分为单位,必须是整型数字 ///比方2,代表0.02元 string orderAmount = (salePrice * 100).ToString("f0"); //订单提交时间 ///14位数字。年[4位]月[2位]日[2位]时[2位]分[2位]秒[2位] ///如;20080101010101 string orderTime = DateTime.Now.ToString("yyyyMMddHHmmss"); //商品名称 ///可为中文或英文字符 //productName.Value = "productName"; string productName = salePrice < 30 ? "蓝钻会员卡" : salePrice < 60 ? "黄钻会员卡" : salePrice < 120 ? "白钻会员卡" : "红钻会员卡"; //商品数量 ///可为空,非空时必须为数字 //productNum.Value = "1"; string productNum = "1"; //商品代码 ///可为字符或者数字 string productId = ""; //商品描述 string productDesc = ""; //扩展字段1 ///在支付结束后原样返回给商户 服务损耗比例(*1000) string ext1 = "0"; //扩展字段2 //在支付结束后原样返回给商户 string ext2 = ""; //支付方式.固定选择值 ///只能选择00、10、11、12、13、14 ///00:组合支付(网关支付页面显示快钱支持的各种支付方式,推荐使用)10:银行卡支付(网关支付页面只显示银行卡支付).11:电话银行支付(网关支付页面只显示电话支付).12:快钱账户支付(网关支付页面只显示快钱账户支付).13:线下支付(网关支付页面只显示线下支付方式) string payType = "00"; //同一订单禁止重复提交标志 //固定选择值: 1、0 //1代表同一订单号只允许提交1次;0表示同一订单号在没有支付成功的前提下可重复提交多次。默认为0建议实物购物车结算类商户采用0;虚拟产品类商户采用1 string redoFlag = "1"; //快钱的合作伙伴的账户号 ///如未和快钱签订代理合作协议,不需要填写本参数 string pid = ""; //生成加密签名串 ///请务必按照如下顺序和规则组成加密串! String signMsgVal = ""; signMsgVal = AppendParam(signMsgVal, "inputCharset", inputCharset); signMsgVal = AppendParam(signMsgVal, "bgUrl", bgUrl); signMsgVal = AppendParam(signMsgVal, "version", version); signMsgVal = AppendParam(signMsgVal, "language", language); signMsgVal = AppendParam(signMsgVal, "signType", signType); signMsgVal = AppendParam(signMsgVal, "merchantAcctId", merchantAcctId); signMsgVal = AppendParam(signMsgVal, "payerName", payerName); signMsgVal = AppendParam(signMsgVal, "payerContactType", payerContactType); signMsgVal = AppendParam(signMsgVal, "payerContact", payerContact); signMsgVal = AppendParam(signMsgVal, "orderId", orderId); signMsgVal = AppendParam(signMsgVal, "orderAmount", orderAmount); signMsgVal = AppendParam(signMsgVal, "orderTime", orderTime); signMsgVal = AppendParam(signMsgVal, "productName", productName); signMsgVal = AppendParam(signMsgVal, "productNum", productNum); signMsgVal = AppendParam(signMsgVal, "productId", productId); signMsgVal = AppendParam(signMsgVal, "productDesc", productDesc); signMsgVal = AppendParam(signMsgVal, "ext1", ext1); signMsgVal = AppendParam(signMsgVal, "ext2", ext2); signMsgVal = AppendParam(signMsgVal, "payType", payType); signMsgVal = AppendParam(signMsgVal, "redoFlag", redoFlag); signMsgVal = AppendParam(signMsgVal, "pid", pid); signMsgVal = AppendParam(signMsgVal, "key", key); string signMsg = GetMD5(signMsgVal, "utf-8").ToUpper(); #endregion #region 整理参数 RenderAlertInfo(false, "页面正跳转到支付平台,请稍候。。。", 2); StringBuilder builder = new StringBuilder(); builder.AppendLine(CreateInputHidden("inputCharset", inputCharset)); builder.AppendLine(CreateInputHidden("bgUrl", bgUrl)); builder.AppendLine(CreateInputHidden("version", version)); builder.AppendLine(CreateInputHidden("language", language)); builder.AppendLine(CreateInputHidden("signType", signType)); builder.AppendLine(CreateInputHidden("signMsg", signMsg)); builder.AppendLine(CreateInputHidden("merchantAcctId", merchantAcctId)); builder.AppendLine(CreateInputHidden("payerName", payerName)); builder.AppendLine(CreateInputHidden("payerContactType", payerContactType)); builder.AppendLine(CreateInputHidden("payerContact", payerContact)); builder.AppendLine(CreateInputHidden("orderId", orderId)); builder.AppendLine(CreateInputHidden("orderAmount", orderAmount)); builder.AppendLine(CreateInputHidden("orderTime", orderTime)); builder.AppendLine(CreateInputHidden("productName", productName)); builder.AppendLine(CreateInputHidden("productNum", productNum)); builder.AppendLine(CreateInputHidden("productId", productId)); builder.AppendLine(CreateInputHidden("productDesc", productDesc)); builder.AppendLine(CreateInputHidden("ext1", ext1)); builder.AppendLine(CreateInputHidden("ext2", ext2)); builder.AppendLine(CreateInputHidden("payType", payType)); builder.AppendLine(CreateInputHidden("redoFlag", redoFlag)); builder.AppendLine(CreateInputHidden("pid", pid)); lit99Bill.Text = builder.ToString(); #endregion this.Page.ClientScript.RegisterStartupScript(this.GetType(), "message", "window.onload = function() { document.forms[0].submit(); }", true); }
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}¬ifyurl={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); }
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 < 20) { base.Response.Write("充值金额不能低于20"); base.Response.End(); } GameRequest.GetFormString("type"); string str = "http://pay.cffsye.top"; string text = "UTF-8"; string text2 = "V3.0"; string text3 = ApplicationSettings.Get("parter_zhifu"); string text4 = str + "/pay/zhifubank/notify_url.aspx"; string text5 = formInt.ToString(); string orderIDByPrefix = PayHelper.GetOrderIDByPrefix("zf"); string text6 = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); string text7 = "RSA-S"; string text8 = ""; string text9 = ""; string text10 = "test"; string text11 = ""; string text12 = str + "/pay/zhifubank/notify_url.aspx"; string text13 = "direct_pay"; string text14 = ""; string text15 = ""; string text16 = ""; string text17 = ""; string text18 = ""; string text19 = ""; string text20 = ""; string text21 = ""; string text22 = ""; if (text17 != "") { text22 = text22 + "bank_code=" + text17 + "&"; } if (text18 != "") { text22 = text22 + "client_ip=" + text18 + "&"; } if (text19 != "") { text22 = text22 + "client_ip_check=" + text19 + "&"; } if (text15 != "") { text22 = text22 + "extend_param=" + text15 + "&"; } if (text16 != "") { text22 = text22 + "extra_return_param=" + text16 + "&"; } if (text != "") { text22 = text22 + "input_charset=" + text + "&"; } if (text2 != "") { text22 = text22 + "interface_version=" + text2 + "&"; } if (text3 != "") { text22 = text22 + "merchant_code=" + text3 + "&"; } if (text4 != "") { text22 = text22 + "notify_url=" + text4 + "&"; } if (text5 != "") { text22 = text22 + "order_amount=" + text5 + "&"; } if (orderIDByPrefix != "") { text22 = text22 + "order_no=" + orderIDByPrefix + "&"; } if (text6 != "") { text22 = text22 + "order_time=" + text6 + "&"; } if (text21 != "") { text22 = text22 + "pay_type=" + text21 + "&"; } if (text8 != "") { text22 = text22 + "product_code=" + text8 + "&"; } if (text9 != "") { text22 = text22 + "product_desc=" + text9 + "&"; } if (text10 != "") { text22 = text22 + "product_name=" + text10 + "&"; } if (text11 != "") { text22 = text22 + "product_num=" + text11 + "&"; } if (text20 != "") { text22 = text22 + "redo_flag=" + text20 + "&"; } if (text12 != "") { text22 = text22 + "return_url=" + text12 + "&"; } if (text13 != "") { text22 = text22 + "service_type=" + text13; } if (text14 != "") { text22 = text22 + "&show_url=" + text14; } if (text7 == "RSA-S") { string privateKey = ApplicationSettings.Get("merPriKey_zhifu"); privateKey = HttpHelp.RSAPrivateKeyJava2DotNet(privateKey); string value = HttpHelp.RSASign(text22, privateKey); this.sign.Value = value; } this.merchant_code.Value = text3; this.bank_code.Value = text17; this.order_no.Value = orderIDByPrefix; this.order_amount.Value = text5; this.service_type.Value = text13; this.input_charset.Value = text; this.notify_url.Value = text4; this.interface_version.Value = text2; this.sign_type.Value = text7; this.order_time.Value = text6; this.product_name.Value = text10; this.client_ip.Value = text18; this.client_ip_check.Value = text19; this.extend_param.Value = text15; this.extra_return_param.Value = text16; this.product_code.Value = text8; this.product_desc.Value = text9; this.product_num.Value = text11; this.return_url.Value = text12; this.show_url.Value = text14; this.redo_flag.Value = text20; this.pay_type.Value = text21; OnLineOrder onLineOrder = new OnLineOrder(); onLineOrder.OrderID = orderIDByPrefix; if (Fetch.GetUserCookie() == null) { onLineOrder.OperUserID = 0; } else { onLineOrder.OperUserID = Fetch.GetUserCookie().UserID; } onLineOrder.Accounts = formString; onLineOrder.OrderAmount = formInt; onLineOrder.IPAddress = GameRequest.GetUserIP(); onLineOrder.ShareID = 1; Message message = FacadeManage.aideTreasureFacade.RequestOrder(onLineOrder); if (!message.Success) { base.Response.Write(message.Content); base.Response.End(); } }
/// <summary> /// 提交 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void btnPay_Click(object sender, EventArgs e) { string strAccounts = CtrlHelper.GetText(txtPayAccounts); string strReAccounts = CtrlHelper.GetText(txtPayReAccounts); int amount = CtrlHelper.GetInt(txtPayAmount, 0); if (strAccounts == "") { RenderAlertInfo(true, "抱歉,请输入充值帐号。", 2); return; } if (strReAccounts != strAccounts) { RenderAlertInfo(true, "抱歉,两次输入的帐号不一致。", 2); return; } // 验证是否合法的金额 if (amount <= 0) { RenderAlertInfo(true, "请输入正确的充值金额", 2); return; } // 支付方法 string orderid = PayHelper.GetOrderIDByPrefix("ZFB"); OnLineOrder onlineOrder = new OnLineOrder(); onlineOrder.ShareID = 401; onlineOrder.OrderID = orderid; if (Fetch.GetUserCookie() == null) { onlineOrder.OperUserID = 0; } else { onlineOrder.OperUserID = Fetch.GetUserCookie().UserID; } onlineOrder.Accounts = strAccounts; onlineOrder.OrderAmount = amount; onlineOrder.IPAddress = GameRequest.GetUserIP(); //生成订单 Message umsg = FacadeManage.aideTreasureFacade.RequestOrder(onlineOrder); if (!umsg.Success) { RenderAlertInfo(true, umsg.Content, 2); return; } //服务器异步通知页面路径 string notify_url = "http://" + Request.Url.Authority + "/Pay/ZFB/AlipayNotify.aspx"; //页面跳转同步通知页面路径 string return_url = "http://" + Request.Url.Authority + "/Pay/Index.aspx"; //商户网站唯一订单号 string out_trade_no = orderid; //商品名称 string subject = "充值游戏豆"; //交易金额 decimal total_fee = Convert.ToDecimal(amount); RenderAlertInfo(false, "页面正跳转到支付平台,请稍候。。。", 2); //获取数据签名 SortedDictionary <string, string> sParaTemp = new SortedDictionary <string, string>(); sParaTemp.Add("notify_url", notify_url); sParaTemp.Add("return_url", return_url); sParaTemp.Add("out_trade_no", out_trade_no); sParaTemp.Add("subject", subject); sParaTemp.Add("total_fee", total_fee.ToString()); formData = AliPayHelper.BuildRequest(sParaTemp); js = "<script>window.onload = function() { document.forms[0].submit(); }</script>"; }
public JsonResult DaifuTixian(PlatformDraw model) { int @int = GameRequest.GetInt("platId", 0); if (@int <= 0) { return(Json(new { IsOk = false, Msg = "请选择代付平台" })); } if (model.RealName == "" || model.BankCode == "" || model.BankNo == "" || model.DrawAmt <= 0m || model.BankAddr == "" || model.Code == "") { return(Json(new { IsOk = false, Msg = "请输入完整信息" })); } string @string = GameRequest.GetString("Province"); string string2 = GameRequest.GetString("City"); string flowid = ""; string text = ""; switch (@int) { case 1: model.OrderID = PayHelper.GetOrderIDByPrefix("txf"); text = DaiFu.GateWayPement(model.OrderID, model.DrawAmt, model.RealName, model.BankNo, model.BankCode, model.BankAddr, out flowid); break; case 2: if (@string == "" || string2 == "") { return(Json(new { IsOk = false, Msg = "请输入银行所在省市" })); } model.OrderID = PayHelper.GetOrderIDByPrefix("45"); text = DaiFu.Daifu_45(model.OrderID, model.DrawAmt, model.RealName, model.BankNo, model.BankName, model.BankAddr, string2, out flowid); break; case 3: if (@string == "" || string2 == "") { return(Json(new { IsOk = false, Msg = "请输入银行所在省市" })); } model.OrderID = PayHelper.GetOrderIDByPrefix("ymf"); text = DaiFu.Daifu_youmifu(model.OrderID, model.DrawAmt, model.RealName, model.BankNo, model.BankCode, model.BankAddr, @string, string2, base.Request.Url.Host, out flowid); break; case 4: if (@string == "" || string2 == "") { return(Json(new { IsOk = false, Msg = "请输入银行所在省市" })); } model.OrderID = PayHelper.GetOrderIDByPrefix("ry"); text = DaiFu.Daifu_ruyi(model.OrderID, model.DrawAmt, model.RealName, model.BankNo, model.BankCode, model.BankAddr, @string, string2, base.Request.Url.Host, out flowid); break; } string text2 = ""; if (text.ToUpper() == "SUCCESS") { base.Session["code"] = null; base.Session["error"] = null; text2 = "提现请求提交成功,等待处理"; model.OperateIP = GameRequest.GetUserIP(); model.Operator = user.Username; model.FlowID = flowid; int num = FacadeManage.aideNativeWebFacade.AddPlatformDraw(model); if (num > 0) { return(Json(new { IsOk = true, Msg = text2 })); } return(Json(new { IsOk = false, Msg = text2 + "—记录数据错误" })); } return(Json(new { IsOk = false, Msg = text })); }
/// <summary> /// 提交 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void btnPay_Click(object sender, EventArgs e) { string strAccounts = CtrlHelper.GetText(txtPayAccounts); string strReAccounts = CtrlHelper.GetText(txtPayReAccounts); string strCardNumber = CtrlHelper.GetText(txtCardNumber); string strCardPassword = CtrlHelper.GetText(txtCardPassword); int amount = Convert.ToInt32(ddlAmount.SelectedValue); if (strAccounts == "") { RenderAlertInfo(true, "抱歉,请输入充值帐号。", 2); return; } if (strReAccounts != strAccounts) { RenderAlertInfo(true, "抱歉,两次输入的帐号不一致。", 2); return; } if (amount == 0) { RenderAlertInfo(true, "请选择卡面值。", 2); return; } if (string.IsNullOrEmpty(strCardNumber)) { RenderAlertInfo(true, "抱歉,请输入卡号。", 2); return; } if (string.IsNullOrEmpty(strCardPassword)) { RenderAlertInfo(true, "抱歉,请输入卡密码。", 2); return; } OnLineOrder onlineOrder = new OnLineOrder(); onlineOrder.ShareID = cardType; onlineOrder.OrderID = PayHelper.GetOrderIDByPrefix("JFTCard"); if (Fetch.GetUserCookie() == null) { onlineOrder.OperUserID = 0; } else { onlineOrder.OperUserID = Fetch.GetUserCookie().UserID; } onlineOrder.Accounts = strAccounts; onlineOrder.OrderAmount = amount; onlineOrder.IPAddress = GameRequest.GetUserIP(); //生成订单 Message umsg = FacadeManage.aideTreasureFacade.RequestOrder(onlineOrder); if (!umsg.Success) { RenderAlertInfo(true, umsg.Content, 2); return; } // 商户ID string p1_usercode = ApplicationSettings.Get("jftBankID"); // 秘钥 string key = ApplicationSettings.Get("jftBankKey"); // 回调页面 string p4_returnurl = "http://" + HttpContext.Current.Request.Url.Authority + "/Pay/JFT/CardReturn.aspx"; // 通知地址 string p5_notifyurl = "http://" + HttpContext.Current.Request.Url.Authority + "/Pay/JFT/PublicAdvice.aspx"; // 请求时间 string p6_ordertime = DateTime.Now.ToString("yyyyMMddHHmmss"); // 签名信息 string strEncryption = string.Format("{0}&{1}&{2}&{3}&{4}&{5}{6}", p1_usercode, onlineOrder.OrderID, amount, p4_returnurl, p5_notifyurl, p6_ordertime, key ); string p7_sign = Utility.MD5(strEncryption).ToUpper(); // 加密方法 string p8_signtype = ""; // 商户支付方式 string p9_paymethod = "5"; // 支付通道编码 string p10_paychannelnum = EnumDescription.GetFieldText(typeof(AppConfig.JFTPayCardType), cardType); // 商户进行支付的银行卡类型 string p11_cardtype = ""; // 银行支付类型 string p12_channel = ""; // 订单失效时间 string p13_orderfailertime = ""; // 客户或卖家名称 string p14_customname = ""; // 客户联系方式类型 1、email,2、phone,3、地址 string p15_customcontacttype = ""; // 客户联系方式 string p16_customcontact = ""; // 客户IP地址 string p17_customip = ""; // 商品名称 string p18_product = ""; // 卡密 string p19_productcat = strCardPassword; // 卡号 string p20_productnum = strCardNumber; // 商品描述 string p21_pdesc = ""; // 接口版本 string p22_version = "2.0"; // 编码类型 string p23_charset = ""; // 备注信息 string p24_remark = ""; #region 整理参数 RenderAlertInfo(false, "页面正跳转到支付平台,请稍候。。。", 2); StringBuilder builder = new StringBuilder(); builder.AppendLine(CreateInputHidden("p1_usercode", p1_usercode)); builder.AppendLine(CreateInputHidden("p2_order", onlineOrder.OrderID)); builder.AppendLine(CreateInputHidden("p3_money", amount.ToString())); builder.AppendLine(CreateInputHidden("p4_returnurl", p4_returnurl)); builder.AppendLine(CreateInputHidden("p5_notifyurl", p5_notifyurl)); builder.AppendLine(CreateInputHidden("p6_ordertime", p6_ordertime)); builder.AppendLine(CreateInputHidden("p7_sign", p7_sign)); builder.AppendLine(CreateInputHidden("p8_signtype", p8_signtype)); builder.AppendLine(CreateInputHidden("p9_paymethod", p9_paymethod)); builder.AppendLine(CreateInputHidden("p10_paychannelnum", p10_paychannelnum)); builder.AppendLine(CreateInputHidden("p11_cardtype", p11_cardtype)); builder.AppendLine(CreateInputHidden("p12_channel", p12_channel)); builder.AppendLine(CreateInputHidden("p13_orderfailertime", p13_orderfailertime)); builder.AppendLine(CreateInputHidden("p14_customname", p14_customname)); builder.AppendLine(CreateInputHidden("p15_customcontacttype", p15_customcontacttype)); builder.AppendLine(CreateInputHidden("p16_customcontact", p16_customcontact)); builder.AppendLine(CreateInputHidden("p17_customip", p17_customip)); builder.AppendLine(CreateInputHidden("p18_product", p18_product)); builder.AppendLine(CreateInputHidden("p19_productcat", p19_productcat)); builder.AppendLine(CreateInputHidden("p20_productnum", p20_productnum)); builder.AppendLine(CreateInputHidden("p21_pdesc", p21_pdesc)); builder.AppendLine(CreateInputHidden("p22_version", p22_version)); builder.AppendLine(CreateInputHidden("p23_charset", p23_charset)); builder.AppendLine(CreateInputHidden("p24_remark", p24_remark)); formData = builder.ToString(); #endregion js = "<script>window.onload = function() { document.forms[0].submit(); }</script>"; }
protected void btnPay_Click(object sender, EventArgs e) { string strAccounts = CtrlHelper.GetText(txtPayAccounts); string strReAccounts = CtrlHelper.GetText(txtPayReAccounts); int salePrice = GameRequest.GetFormInt("rbSaleType", 0); string gamePayType = GameRequest.GetFormString("rbPayGType"); if (strAccounts == "") { RenderAlertInfo(true, "抱歉,请输入充值帐号。", 2); return; } if (strReAccounts != strAccounts) { RenderAlertInfo(true, "抱歉,两次输入的帐号不一致。", 2); return; } if (salePrice < 30) { RenderAlertInfo(true, "抱歉,充值金额必须大于30元", 2); return; } OnLineOrder onlineOrder = new OnLineOrder(); onlineOrder.ShareID = gamePayType == "C" ? 7 : gamePayType == "D" ? 8 : gamePayType == "M" ? 9 : gamePayType == "N" ? 10 : 11; onlineOrder.OrderID = gamePayType == "C" ? PayHelper.GetOrderIDByPrefix("SD") : gamePayType == "D" ? PayHelper.GetOrderIDByPrefix("ZT") : gamePayType == "M" ? PayHelper.GetOrderIDByPrefix("WY") : gamePayType == "N" ? PayHelper.GetOrderIDByPrefix("SH") : PayHelper.GetOrderIDByPrefix("WM"); #region 订单处理 if (Fetch.GetUserCookie() == null) { onlineOrder.OperUserID = 0; } else { onlineOrder.OperUserID = Fetch.GetUserCookie().UserID; } onlineOrder.Accounts = strAccounts; onlineOrder.CardTotal = 1; onlineOrder.CardTypeID = salePrice < 30 ? 1 : salePrice < 60 ? 2 : salePrice < 120 ? 3 : 4; onlineOrder.OrderAmount = salePrice; onlineOrder.IPAddress = GameRequest.GetUserIP(); //生成订单 Message umsg = treasureFacade.RequestOrder(onlineOrder); if (!umsg.Success) { RenderAlertInfo(true, umsg.Content, 2); return; } #endregion #region 提交给快钱支付网关 //商户号 string merchantAcctId = ApplicationSettings.Get("merchantIdGame"); //人民币网关密钥 ///区分大小写.请与快钱联系索取 string key = ApplicationSettings.Get("keyValueGame"); //商户订单号 string orderId = onlineOrder.OrderID.Trim(); //支付金额 string orderAmount = onlineOrder.OrderAmount.ToString(); //string orderAmount = "1.00"; //充值卡类型c 盛大一卡通d 征途游戏卡m网易一卡通n 搜狐一卡通u 完美一卡通 string payType = gamePayType; //前台接收并显示页面,公网地址 string pageUrl = "http://" + HttpContext.Current.Request.Url.Authority + "/Pay/PayShow.aspx"; //支付结果底层发送的接收页面 后台接收页面 string bgUrl = "http://" + HttpContext.Current.Request.Url.Authority + "/Pay/PayGameReceive.aspx"; //扩展字段1 string ext1 = "0"; //扩展字段2 string ext2 = ""; //MD5签名 MD5签名:把请求支付的部分参数与KEY(商户后台可自行修改)拼凑成字符串经过国际标准32位MD5加密转换成大写 String signMsgVal = ""; signMsgVal = AppendParam(signMsgVal, "merchantAcctId", merchantAcctId); signMsgVal = AppendParam(signMsgVal, "orderId", orderId); signMsgVal = AppendParam(signMsgVal, "orderAmount", orderAmount); signMsgVal = AppendParam(signMsgVal, "payType", payType); signMsgVal = AppendParam(signMsgVal, "pageUrl", pageUrl); signMsgVal = AppendParam(signMsgVal, "bgUrl", bgUrl); signMsgVal = AppendParam(signMsgVal, "ext1", HttpUtility.UrlEncode(ext1, Encoding.GetEncoding("gb2312")).Trim()); signMsgVal = AppendParam(signMsgVal, "ext2", HttpUtility.UrlEncode(ext2, Encoding.GetEncoding("gb2312")).Trim()); signMsgVal = AppendParam(signMsgVal, "key", key); string signMsg = TextEncrypt.EncryptPassword(signMsgVal).ToUpper(); #endregion RenderAlertInfo(false, "页面正跳转到支付平台,请稍候。。。", 2); #region 整理参数 string getData = ""; getData = AppendAllParam(getData, "merchantAcctId", merchantAcctId); getData = AppendAllParam(getData, "orderId", orderId); getData = AppendAllParam(getData, "orderAmount", orderAmount); getData = AppendAllParam(getData, "payType", payType); getData = AppendAllParam(getData, "pageUrl", HttpUtility.UrlEncode(pageUrl, Encoding.GetEncoding("gb2312")).Trim()); getData = AppendAllParam(getData, "bgUrl", HttpUtility.UrlEncode(bgUrl, Encoding.GetEncoding("gb2312")).Trim()); getData = AppendAllParam(getData, "ext1", HttpUtility.UrlEncode(ext1, Encoding.GetEncoding("gb2312")).Trim()); getData = AppendAllParam(getData, "ext2", HttpUtility.UrlEncode(ext2, Encoding.GetEncoding("gb2312")).Trim()); getData = AppendAllParam(getData, "signMsg", signMsg); string posturl = this.Page.Form.Action + "?" + getData; #endregion Response.Redirect(posturl); }
protected void btnPay_Click(object sender, EventArgs e) { string strAccounts = CtrlHelper.GetText(txtPayAccounts); string strReAccounts = CtrlHelper.GetText(txtPayReAccounts); int salePrice = Convert.ToInt32(ddlCurrenry.SelectedValue); if (strAccounts == "") { RenderAlertInfo(true, "抱歉,请输入充值帐号。", 2); return; } if (strReAccounts != strAccounts) { RenderAlertInfo(true, "抱歉,两次输入的帐号不一致。", 2); return; } if (salePrice < 10) { RenderAlertInfo(true, "抱歉,充值金额必须大于10元", 2); return; } OnLineOrder onlineOrder = new OnLineOrder(); onlineOrder.ShareID = 12; onlineOrder.OrderID = PayHelper.GetOrderIDByPrefix("SX"); #region 订单处理 if (Fetch.GetUserCookie() == null) { onlineOrder.OperUserID = 0; } else { onlineOrder.OperUserID = Fetch.GetUserCookie().UserID; } onlineOrder.Accounts = strAccounts; onlineOrder.OrderAmount = salePrice; onlineOrder.IPAddress = GameRequest.GetUserIP(); //生成订单 Message umsg = FacadeManage.aideTreasureFacade.RequestOrder(onlineOrder, 200, 0); if (!umsg.Success) { RenderAlertInfo(true, umsg.Content, 2); return; } #endregion #region 提交给V币网关 string spid = ApplicationSettings.Get("spId"); //换成商户sp号码 长度5位 string sppwd = ApplicationSettings.Get("spKeyValue"); //换成商户sp校验密钥 长度18位 string spreq = "http://" + HttpContext.Current.Request.Url.Authority + "/Pay/PayVB.aspx"; //换成商户请求地址 string sprec = "http://" + HttpContext.Current.Request.Url.Authority + "/Pay/PayVBReceive.aspx"; //换成商户接收地址 string spname = Server.UrlEncode(ApplicationSettings.Get("spName")); //需要 Server.UrlEncode编码 string spcustom = onlineOrder.Rate.ToString("f0"); //需要 Server.UrlEncode编码 '客户自定义 30字符内 只能是数字、字母或数字字母的组合。不能用汉字。 string spversion = "vpay1001"; //此接口的版本号码 此版本是"vpay1001" string money = onlineOrder.OrderAmount.ToString("f0"); //接参数面值元 string userid = Server.UrlEncode(onlineOrder.Accounts); //接参数用户ID 需要 Server.UrlEncode编码 string urlcode = "utf-8"; //编码 gbk gb2312 utf-8 unicode big5(注意不能一个繁体和简体字交叉写) 你程序的编码 string orderId = onlineOrder.OrderID; //客户订单 请妥善管理客户的订单 长度:30字符以内(只能是数字、字母或数字字母的组合。不能用汉字订单) string post_key = orderId + spreq + sprec + spid + sppwd + spversion + money; // '网站订单号码+ 请求地址+ 接收地址 + 5位spid+ 18位SP密码+支付的版本号+面值 //'LCase函数是将字符转换为小写; Ucase函数是将字符转换为大写 //'全国声讯支付联盟全国声讯电话支付接口对MD5值只认大写字符串,所以小写的MD5值得转换为大写 string md5password = TextEncrypt.EncryptPassword(post_key).ToUpper();// '先MD532 然后转大写 string IpAddress = (HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"] != null && HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"] != String.Empty) ? HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"] : HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; #endregion #region 整理参数 pnlContinue.Visible = false; RenderAlertInfo(false, "页面正跳转到支付平台,请稍候。。。", 2); HtmlGenericControl pnlSubmit = this.FindControl("pnlSubmit") as HtmlGenericControl; if (pnlSubmit != null) { pnlSubmit.Visible = true; } StringBuilder builder = new StringBuilder(); builder.AppendLine(CreateInputHidden("spid", spid)); builder.AppendLine(CreateInputHidden("spname", spname)); builder.AppendLine(CreateInputHidden("spoid", orderId)); builder.AppendLine(CreateInputHidden("spreq", spreq)); builder.AppendLine(CreateInputHidden("sprec", sprec)); builder.AppendLine(CreateInputHidden("userid", userid)); builder.AppendLine(CreateInputHidden("userip", IpAddress)); builder.AppendLine(CreateInputHidden("spmd5", md5password)); builder.AppendLine(CreateInputHidden("spcustom", spcustom)); builder.AppendLine(CreateInputHidden("spversion", spversion)); builder.AppendLine(CreateInputHidden("money", money)); builder.AppendLine(CreateInputHidden("urlcode", urlcode)); litVB.Text = builder.ToString(); #endregion }
public string Balance() { int @int = GameRequest.GetInt("userid", 0); string result; if (@int <= 0) { result = JsonHelper.SerializeObject(new { Code = 1, Msg = "参数错误" }); } else { UserTicketInfo userCookie = Fetch.GetUserCookie(); if (userCookie == null || userCookie.UserID != @int) { result = JsonHelper.SerializeObject(new { Code = 1, Msg = "已超时,请从大厅重新操作" }); } else { double num = System.Convert.ToDouble(base.Request["rtnFee"]); if (num <= 0.0) { result = JsonHelper.SerializeObject(new { Code = 1, Msg = "提现金额必须大于0" }); } else { System.Collections.Generic.Dictionary <string, object> dictionary = new System.Collections.Generic.Dictionary <string, object>(); dictionary["dwUserID"] = @int; dictionary["strOrderID"] = PayHelper.GetOrderIDByPrefix("tg"); dictionary["dwRtnFee"] = num; dictionary["strClientIP"] = GameRequest.GetUserIP(); dictionary["strErr"] = ""; Message message = FacadeManage.aideAccountsFacade.ExcuteByProce("RYAgentDB.dbo.P_SpreadBalance", dictionary); if (message.Success) { result = JsonHelper.SerializeObject(new { Code = 0, Msg = "提现申请成功,请等待处理!" }); } else { result = JsonHelper.SerializeObject(new { Code = 1, Msg = message.Content }); } } } } return(result); }