关于我们

质量为本、客户为根、勇于拼搏、务实创新

< 返回新闻公共列表

发起微信支付接收的代码

发布时间:2019-11-20 10:29:04

<%@ WebHandler Language="C#" Class="DTcms.Web.dev.wxnetpayreceive" %>

//上面这个wxnetpayreceive 可以自定义

using System;

using System.Collections.Generic;

using System.Web;

using System.Web.SessionState;

using System.IO;

using System.Text;

using System.Data;

using System.Data.Sql;

using System.Data.SqlClient;

using DTcms.Common;

using DTcms.DBUtility;

using NetWing.Common.Data.SQLServer;

using NetWing.Common.Request;

using DTcms.API.Payment.wxpay;//必须引入微信支付类

namespace DTcms.Web.dev

{

    /// <summary> 

    /// 支付展会定金 的摘要说明 

    /// </summary> 

    //wxnetpayreceive 这个类可以自定义 必须和上面保持一致

    public class wxnetpayreceive : IHttpHandler, IRequiresSessionState

    {

        public void ProcessRequest(HttpContext context)

        {

            context.Response.ContentType = "text / plain"; 

            WxPayData notifyData = NativePay.GetNotifyData();

            string transaction_id = notifyData.GetValue("transaction_id").ToString(); //微信支付订单号

                                                                                      //获取订单信息

            string order_no = notifyData.GetValue("out_trade_no").ToString(); //商户订单号

            string total_fee = notifyData.GetValue("total_fee").ToString(); //获取总金额

            //这里写支付成功或失败业务逻辑

            //这里写支付成功或失败业务逻辑

        }

        public bool IsReusable

        {

            get

            {

                return false;

            }

        }

    }

}



/template/Home/Zkeys/PC/Static