微信公众号支付回调页面处理asp.net

1.在商家微信商户通中配置回调url

2.在提交订单时传入的回调页面中获取支付成功后或支付失败后的参数,对订单进行处理

protected void Page_Load(object sender, EventArgs e) 
{ 
  //接收维修支付通知页面 
  Stream s = Request.InputStream; 
  byte[] b = new byte[s.Length]; 
  s.Read(b, 0, (int)s.Length); 
  string result = System.Text.Encoding.UTF8.GetString(b); 
  if (GetXMLInnerText(result, “return_code”) == “SUCCESS”) { 
  //这里没有验证签名 
  string orderId = GetXMLInnerText(result, “out_trade_no”); 
  string appid = GetXMLInnerText(result, “appid”); 
  string bank_type = GetXMLInnerText(result, “bank_type”); 
  // string cash_fee = GetXMLInnerText(result, “cash_fee”); 
  string fee_type = GetXMLInnerText(result, “fee_type”); 
  string mch_id = GetXMLInnerText(result, “mch_id”); 
  string openid = GetXMLInnerText(result, “openid”); 
  string total_fee = GetXMLInnerText(result, “total_fee”); 
  string transaction_id = GetXMLInnerText(result, “transaction_id”); 
  string time_end = GetXMLInnerText(result, “time_end”); 
  /// 对获取到支付成功的订单进行处理 
  …… 
  /// 
  //告诉微信收到支付成功果
   Response.Write("<xml><return_code><![CDATA[SUCCESS]]></return_code></xml>");
s.Flush(); s.Close(); s.Dispose();
}