zoukankan      html  css  js  c++  java
  • 微信公众号支付回调页面处理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();
    }
  • 相关阅读:
    链接工作过程
    编译器工作过程
    图像边缘提取
    剑指32-1 从上到下打印二叉树
    剑指31 栈的压入 弹出序列
    剑指30 包含min函数的栈
    剑指28 对称的二叉树(暂留)
    asp.net core获取当前请求的完整url
    安装启动consul代理,consul后台管理
    asp.net core用命令方式启动项目
  • 原文地址:https://www.cnblogs.com/shenbing/p/6197929.html
Copyright © 2011-2022 走看看