Example #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //创建支付应答对象
        ResponseHandler resHandler = new ResponseHandler(Context);
        resHandler.Init();
        resHandler.SetKey(WeixinPayUtil.Key, WeixinPayUtil.AppKey);

        //判断签名
        if (resHandler.IsWXsignfeedback())
        {
            //回复服务器处理成功
            Response.Write("OK");
            Response.Write("OK:" + resHandler.GetDebugInfo());
        }
        else {
            //sha1签名失败
            Response.Write("fail");
            Response.Write("fail:" + resHandler.GetDebugInfo());
        }
        Response.End();
    }
Example #2
0
        public ActionResult FeedBack()
        {
            //创建支付应答对象
            ResponseHandler resHandler = new ResponseHandler(null);
            resHandler.Init();
            resHandler.SetKey(WeixinPayInfo.Key, WeixinPayInfo.AppKey);

            //判断签名
            if (resHandler.IsWXsignfeedback())
            {
                //回复服务器处理成功
                Response.Write("OK");
                Response.Write("OK:" + resHandler.GetDebugInfo());
            }
            else
            {
                //sha1签名失败
                Response.Write("fail");
                Response.Write("fail:" + resHandler.GetDebugInfo());
            }
            return null;
        }