樱井莉亚作品-巨屌 自慰 C#微信支付完成前端回调告知notify
黑.丝.足.交
你的位置:樱井莉亚作品 > 黑.丝.足.交 > 巨屌 自慰 C#微信支付完成前端回调告知notify
巨屌 自慰 C#微信支付完成前端回调告知notify
发布日期:2024-08-20 04:55    点击次数:205

巨屌 自慰 C#微信支付完成前端回调告知notify

protected void Page_Load(object sender, EventArgs e){  try  {    string ip = GetWebClientIp();//赢得客户端IP     String xmlData = GetPostStr();//赢得申请数据        DBHelper.WriteLog("WX-Callback", "xmlData:" + xmlData, ip);        if (String.IsNullOrWhiteSpace(xmlData))    {      this.Response.Write("申请数据不成为空!");//复返微信就业器       return;    }        //把数据重新复返给客户端     DataSet ds = new DataSet();    StringReader stram = new StringReader(xmlData);    XmlTextReader datareader = new XmlTextReader(stram);    ds.ReadXml(datareader);    if (ds.Tables[0].Rows[0]["return_code"].ToString() == "SUCCESS")    {      string wx_appid = "";//微信通达平台审核通过的哄骗APPID       string wx_mch_id = "";//微信支付分拨的商户号       string wx_nonce_str = "";//立时字符串,不长于32位       string wx_sign = "";//签名,详见签名算法       string wx_result_code = "";//SUCCESS/FAIL       string wx_return_code = "";      string wx_openid = "";//用户在商户appid下的独一标志       string wx_is_subscribe = "";//用户是否存眷公众账号,Y-存眷,N-未存眷巨屌 自慰,仅在公众账号类型支付灵验       string wx_trade_type = "";// APP       string wx_bank_type = "";// 银行类型巨屌 自慰,接管字符串类型的银行标志巨屌 自慰,银行类型见银行列表       string wx_fee_type = "";// 货币类型,稳妥ISO4217圭表的三位字母代码,默许东谈主民币:CNY,其他值列表详见货币类型       string wx_transaction_id = "";//微信支付订单号       string wx_out_trade_no = "";//商户系统的订单号,与申请一致。       string wx_time_end = "";// 支付完成时间,设施为yyyyMMddHHmmss,如2009年12月25日9点10分10秒暗示为20091225091010。其他详见时间法规       int wx_total_fee = -1;// 订单总金额,单元为分       int wx_cash_fee = -1;//现款支付金额订单现款支付金额,详见支付金额            #region 数据融会,夺目signstr组合排序,从小到大胪列,临了添加key密钥            //列 是否存在       string signstr = "";//需要前边的字符串            //wx_appid       if (ds.Tables[0].Columns.Contains("appid"))      {        wx_appid = ds.Tables[0].Rows[0]["appid"].ToString();        if (!string.IsNullOrEmpty(wx_appid))        {          signstr += "appid=" + wx_appid;        }      }            //wx_bank_type       if (ds.Tables[0].Columns.Contains("bank_type"))      {        wx_bank_type = ds.Tables[0].Rows[0]["bank_type"].ToString();        if (!string.IsNullOrEmpty(wx_bank_type))        {          signstr += "&bank_type=" + wx_bank_type;        }      }      //wx_cash_fee       if (ds.Tables[0].Columns.Contains("cash_fee"))      {        wx_cash_fee = Convert.ToInt32(ds.Tables[0].Rows[0]["cash_fee"].ToString());                signstr += "&cash_fee=" + wx_cash_fee;      }            //wx_fee_type       if (ds.Tables[0].Columns.Contains("fee_type"))      {        wx_fee_type = ds.Tables[0].Rows[0]["fee_type"].ToString();        if (!string.IsNullOrEmpty(wx_fee_type))        {          signstr += "&fee_type=" + wx_fee_type;        }      }            //wx_is_subscribe       if (ds.Tables[0].Columns.Contains("is_subscribe"))      {        wx_is_subscribe = ds.Tables[0].Rows[0]["is_subscribe"].ToString();        if (!string.IsNullOrEmpty(wx_is_subscribe))        {          signstr += "&is_subscribe=" + wx_is_subscribe;        }      }            //wx_mch_id       if (ds.Tables[0].Columns.Contains("mch_id"))      {        wx_mch_id = ds.Tables[0].Rows[0]["mch_id"].ToString();        if (!string.IsNullOrEmpty(wx_mch_id))        {          signstr += "&mch_id=" + wx_mch_id;        }      }            //wx_nonce_str       if (ds.Tables[0].Columns.Contains("nonce_str"))      {        wx_nonce_str = ds.Tables[0].Rows[0]["nonce_str"].ToString();        if (!string.IsNullOrEmpty(wx_nonce_str))        {          signstr += "&nonce_str=" + wx_nonce_str;        }      }            //wx_openid       if (ds.Tables[0].Columns.Contains("openid"))      {        wx_openid = ds.Tables[0].Rows[0]["openid"].ToString();        if (!string.IsNullOrEmpty(wx_openid))        {          signstr += "&openid=" + wx_openid;        }      }            //wx_out_trade_no       if (ds.Tables[0].Columns.Contains("out_trade_no"))      {        wx_out_trade_no = ds.Tables[0].Rows[0]["out_trade_no"].ToString();        if (!string.IsNullOrEmpty(wx_out_trade_no))        {          signstr += "&out_trade_no=" + wx_out_trade_no;        }      }            //wx_result_code        if (ds.Tables[0].Columns.Contains("result_code"))      {        wx_result_code = ds.Tables[0].Rows[0]["result_code"].ToString();        if (!string.IsNullOrEmpty(wx_result_code))        {          signstr += "&result_code=" + wx_result_code;        }      }            //wx_return_code        if (ds.Tables[0].Columns.Contains("return_code"))      {        wx_return_code = ds.Tables[0].Rows[0]["return_code"].ToString();        if (!string.IsNullOrEmpty(wx_return_code))        {          signstr += "&return_code=" + wx_return_code;        }      }            //wx_sign        if (ds.Tables[0].Columns.Contains("sign"))      {        wx_sign = ds.Tables[0].Rows[0]["sign"].ToString();      }            //wx_time_end       if (ds.Tables[0].Columns.Contains("time_end"))      {        wx_time_end = ds.Tables[0].Rows[0]["time_end"].ToString();        if (!string.IsNullOrEmpty(wx_time_end))        {          signstr += "&time_end=" + wx_time_end;        }      }            //wx_total_fee       if (ds.Tables[0].Columns.Contains("total_fee"))      {        wx_total_fee = Convert.ToInt32(ds.Tables[0].Rows[0]["total_fee"].ToString());                signstr += "&total_fee=" + wx_total_fee;      }            //wx_trade_type       if (ds.Tables[0].Columns.Contains("trade_type"))      {        wx_trade_type = ds.Tables[0].Rows[0]["trade_type"].ToString();        if (!string.IsNullOrEmpty(wx_trade_type))        {          signstr += "&trade_type=" + wx_trade_type;        }      }            //wx_transaction_id       if (ds.Tables[0].Columns.Contains("transaction_id"))      {        wx_transaction_id = ds.Tables[0].Rows[0]["transaction_id"].ToString();        if (!string.IsNullOrEmpty(wx_transaction_id))        {          signstr += "&transaction_id=" + wx_transaction_id;        }      }            #endregion            //追加key 密钥       signstr += "&key=" + System.Web.Configuration.WebConfigurationManager.AppSettings["wx_key"].ToString();            string md5 = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(signstr, "MD5").ToUpper();            //签名正确       if (wx_sign == md5)      {        //签名正确,更新土产货数据库订单景象         bool success = DBHelper.UpdateOrderState(wx_out_trade_no, wx_transaction_id, wx_total_fee);                if (success)        {          DBHelper.WriteLog("WX-Callback", "回调改革订单景象见效!", ip);          this.Response.Write(this.CreateResult(true, ""));//复返微信就业器           }          else          {            string refData = "out_trade_no=" + wx_out_trade_no + ",total_fee=" + wx_total_fee.ToString();            DBHelper.WriteLog("WX-Callback", "回调改革订单景象失败!" + refData, ip);            this.Response.Write(this.CreateResult(false, "改革订单景象失败"));//复返微信就业器             }          }          else          {            DBHelper.WriteLog("WX-Callback", "回调接口发现签名空虚!", ip);            this.Response.Write(this.CreateResult(false, "回调接口发现签名空虚!"));//复返微信就业器             }          }          else          {            this.Response.Write(this.CreateResult(false, "回调函数发现微信接口复返FAIL"));//复返微信就业器             }          }          catch (Exception ex)          {            this.Response.Write(ex.Message);          }        }                //开始:C/S框架网(www.csframework.com) QQ:23404761卡通动漫

上一篇:没有了

下一篇:巨屌 av 荫藏再深也不惧 WMI木马查杀实战