protected void Page_Load(object sender, EventArgs e) { string key = System.Configuration.ConfigurationSettings.AppSettings["DayKey"]; //密钥 string merId = System.Configuration.ConfigurationSettings.AppSettings["DayMerId"]; //商户ID string status = GameRequest.GetFormString("status"); //交易状态 string sign = GameRequest.GetFormString("sign"); //签名 string orderId = GameRequest.GetFormString("orderId"); //订单号 float payMoney = GameRequest.GetFormFloat("payMoney", 0); //金额 string operDate = GameRequest.GetFormString("operDate"); //订单日期 string userName = GameRequest.GetFormString("userName"); //用户名 string showUrl = "http://" + HttpContext.Current.Request.Url.Authority + "/Pay/PayShow.aspx"; //交易完成后提示地址 string signStr = merId + "|" + orderId + "|" + status + "|" + payMoney + "|" + operDate + "|" + userName + "|" + key; string testSign = EncryptMD5(signStr, false, 32); //计算签名 ReturnDayDetailInfo result = new ReturnDayDetailInfo( ); result.OrderID = orderId; result.PayMoney = Convert.ToDecimal(payMoney); result.Sign = sign; result.UserName = userName; result.PayType = 1; result.Status = status; //天天付支付结果入库 treasureFacade.WriteReturnDayDetail(result); if (signStr == testSign) { //交易状态为005时表示交易完成 if (status == "055") { ShareDetialInfo detailInfo = new ShareDetialInfo( ); detailInfo.OrderID = orderId; detailInfo.IPAddress = Utility.UserIP; Message umsg = treasureFacade.FilliedOnline(detailInfo, 0); if (umsg.Success) { rtnUrl = showUrl + "?msg=1";//在线充值成功 } else { rtnUrl = showUrl + "?msg=2";//在线充值成功,数据正在更新中 } } else { rtnOk = 1; rtnUrl = showUrl + "?msg=3"; //在线充值失败! } } }
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); }