付款页面的notify页面回调不到。但是根目录下的notify页面就可以,这是怎么回事,求大神指点!!这是我的支付页面:
<?php
namespace WeiXin\Controller;
use WeiXin\Controller\CommonController;
Vendor("WxPayPubHelper.WxPayPubHelper");
class CPayController extends CommonController {

    public function index(){

//使用jsapi接口
$jsApi = new \JsApi_pub();

//=========步骤1:网页授权获取用户openid============
//通过code获得openid
//if (!isset($_GET['code']))
if(session('?WxOpenId')===false)
{
//触发微信返回code码
#$url = $jsApi->createOauthUrlForCode(\WxPayConf_pub::JS_API_CALL_URL);
#Header("Location: $url"); 

echo('此用户还未授权');
}else
{
//获取code码,以获取openid
#$code = $_GET['code'];
#$jsApi->setCode($code);
#$openid = $jsApi->getOpenId();

$openid = session('WxOpenId');
}

//=========步骤2:使用统一支付接口,获取prepay_id============
//使用统一支付接口
$unifiedOrder = new \UnifiedOrder_pub();

//设置统一支付接口参数
//设置必填参数
//appid已填,商户无需重复填写
//mch_id已填,商户无需重复填写
//noncestr已填,商户无需重复填写
//spbill_create_ip已填,商户无需重复填写
//sign已填,商户无需重复填写
$unifiedOrder->setParameter("openid","$openid");//商品描述
$unifiedOrder->setParameter("body","用户充值");//商品描述
//自定义订单号,此处仅作举例
$timeStamp = time();
$total_fee = (int)I('total',1);
$out_trade_no = \WxPayConf_pub::APPID."$timeStamp";
$unifiedOrder->setParameter("out_trade_no","$out_trade_no");//商户订单号 
$unifiedOrder->setParameter("total_fee","$total_fee");//总金额
$unifiedOrder->setParameter("notify_url","http://******.***.cn/notify_url.php");//通知地址 
#$unifiedOrder->setParameter("notify_url",\WxPayConf_pub::NOTIFY_URL);//通知地址 
$unifiedOrder->setParameter("trade_type","JSAPI");//交易类型
//非必填参数,商户可根据实际情况选填
//$unifiedOrder->setParameter("sub_mch_id","XXXX");//子商户号  
//$unifiedOrder->setParameter("device_info","XXXX");//设备号 
//$unifiedOrder->setParameter("attach","XXXX");//附加数据 
//$unifiedOrder->setParameter("time_start","XXXX");//交易起始时间
//$unifiedOrder->setParameter("time_expire","XXXX");//交易结束时间 
//$unifiedOrder->setParameter("goods_tag","XXXX");//商品标记 
//$unifiedOrder->setParameter("openid","XXXX");//用户标识
//$unifiedOrder->setParameter("product_id","XXXX");//商品ID

$prepay_id = $unifiedOrder->getPrepayId();
//=========步骤3:使用jsapi调起支付============
// $jsApi->setPrepayId($prepay_id);
//
// $jsApiParameters = $jsApi->getParameters();
// //echo $jsApiParameters;
// $this -> assign('jsApiParameters',$jsApiParameters);
// $this -> display();
//通过prepay_id获取调起微信支付所需的参数
    $jsApi->setPrepayId($prepay_id);
    $jsApiParameters = $jsApi->getParameters();
    
    $wxconf = json_decode($jsApiParameters, true);
    
    if ($wxconf['package'] == 'prepay_id=') {
        $this->ajaxReturn(array('error_msg' => '当前订单存在异常,不能使用支付'));
    }
    if(IS_AJAX){
        $this->ajaxReturn(array(
            'status' => 'ok',
            'wxconf' => $wxconf,
        ));
    }
    
    $this->display();
}
public function upgold(){
if(session('WxPayState')=='seccuss')
{
if(session('WxPayUpdate') == 1){
echo('金豆更新成功');
}else{
echo('金豆更新失败');
}
}else{
echo('支付回调失败');
}
}

#异步回调
public function notify(){
//使用通用通知接口
$notify = new \Notify_pub();

//存储微信的回调
$xml = $GLOBALS['HTTP_RAW_POST_DATA'];
$notify->saveData($xml);

//验证签名,并回应微信。
//对后台通知交互时,如果微信收到商户的应答不是成功或超时,微信认为通知失败,
//微信会通过一定的策略(如30分钟共8次)定期重新发起通知,
//尽可能提高通知的成功率,但微信不保证通知最终能成功。
if($notify->checkSign() == FALSE){
$notify->setReturnParameter("return_code","FAIL");//返回状态码
$notify->setReturnParameter("return_msg","签名失败");//返回信息
}else{
$notify->setReturnParameter("return_code","SUCCESS");//设置返回码
}
$returnXml = $notify->returnXml();
#echo $returnXml;

//==商户根据实际情况设置相应的处理流程,此处仅作举例=======

//以log文件形式记录回调信息
$log_name = SITE_PATH."./Data/Notify/notify_url.log";#.date('Y-m-d',time()).".log";//log文件路径
$this->log_result($log_name,"【接收到的notify通知】:\n".$xml."\n");

if($notify->checkSign() == TRUE){
        if ($notify->data["return_code"] == "FAIL") {
            //此处应该更新一下订单状态,商户自行增删操作
            //$this->log_result($log_name, "【return_code返回值为fail】:\n".$xml."\n");
            //更新订单数据【通信出错】设为无效订单
            
            // 返回状态码
            $notify->setReturnParameter("return_code","FAIL");
            // 返回信息
            $notify->setReturnParameter("return_msg","签名失败");
        } else if($notify->data["result_code"] == "FAIL"){
            //此处应该更新一下订单状态,商户自行增删操作
            //$this->log_result($log_name, "【result_code返回值为fail】:\n".$xml."\n");
            //更新订单数据【通信出错】设为无效订单
            
            // 返回状态码
            $notify->setReturnParameter("return_code","FAIL");
            // 返回信息
            $notify->setReturnParameter("return_msg","签名失败");
        } else{
            //支付成功后的逻辑操作

            //openid
            $openid = $notify->data['openid'];
            //交易金额,单位分
            $price  = $notify->data['total_fee'];
            
            session('WxPayState','seccuss');
            $res = M('Member')->where(array('m_wxopenid' => $openid))->setInc('m_gold',$price);
if($res){
session('WxPayUpdate',1);
             #钱包记录
WalletRecord(1,$price,'用户充值'.$price.'金豆');
}

            $this->log_result($log_name, "【支付成功】:\n".$xml."\n\n");
            
            $notify->setReturnParameter("return_code","SUCCESS");
        }
    } else {
        // 返回状态码
        $notify->setReturnParameter("return_code","FAIL");
        // 返回信息
        $notify->setReturnParameter("return_msg","签名失败");
    }
}
#打印log
private function log_result($file,$word) 
{
    $fp = fopen($file,"a");
    flock($fp, LOCK_EX) ;
    fwrite($fp,"执行日期:".strftime("%Y-%m-%d-%H:%M:%S",time())."\n".$word."\n\n");
    flock($fp, LOCK_UN);
    fclose($fp);
}
}
异步通知方法notify(),没有起作用:
notify_url.php我是这么通知的:$_GET['m'] = 'WeiXin';
$_GET['c'] = 'CPay';
$_GET['a'] = 'notify';
include_once("index.php");
但是这样却可以通知到:
<?php
/**
 * 通用通知接口demo
 * ====================================================
 * 支付完成后,微信会把相关支付和用户信息发送到商户设定的通知URL,
 * 商户接收回调信息后,根据需要设定相应的处理流程。
 * 
 * 这里举例使用log文件形式记录回调信息。
*/
include_once("System/Core/Library/Vendor/WxPayPubHelper/WxPayPubHelper.php");    //使用通用通知接口
$notify = new Notify_pub(); //存储微信的回调
$xml = $GLOBALS['HTTP_RAW_POST_DATA'];
$notify->saveData($xml);

//验证签名,并回应微信。
//对后台通知交互时,如果微信收到商户的应答不是成功或超时,微信认为通知失败,
//微信会通过一定的策略(如30分钟共8次)定期重新发起通知,
//尽可能提高通知的成功率,但微信不保证通知最终能成功。
if($notify->checkSign() == FALSE){
$notify->setReturnParameter("return_code","FAIL");//返回状态码
$notify->setReturnParameter("return_msg","签名失败");//返回信息
}else{
$notify->setReturnParameter("return_code","SUCCESS");//设置返回码
}
$returnXml = $notify->returnXml();
#echo $returnXml;

//==商户根据实际情况设置相应的处理流程,此处仅作举例=======

//以log文件形式记录回调信息
$log_ = new Log_();
$log_name="./Data/Notify/notify_url2.log";//log文件路径
$log_->log_result($log_name,"【接收到的notify通知】:\n".$xml."\n"); if($notify->checkSign() == TRUE){
if ($notify->data["return_code"] == "FAIL") {
//此处应该更新一下订单状态,商户自行增删操作
$log_->log_result($log_name, "【return_code返回值为fail】:\n".$xml."\n");
//更新订单数据【通信出错】设为无效订单

// 返回状态码
$notify->setReturnParameter("return_code","FAIL");
// 返回信息
$notify->setReturnParameter("return_msg","签名失败");
} else if($notify->data["result_code"] == "FAIL"){
//此处应该更新一下订单状态,商户自行增删操作
$log_->log_result($log_name, "【result_code返回值为fail】:\n".$xml."\n");
//更新订单数据【通信出错】设为无效订单

// 返回状态码
$notify->setReturnParameter("return_code","FAIL");
// 返回信息
$notify->setReturnParameter("return_msg","签名失败");
} else{
//openid
$openid = $notify->data['openid'];
//交易金额,单位分
$price = $notify->data['total_fee'];



//支付成功后的逻辑操作
$log_->log_result($log_name, "【支付成功】:\n".$xml."\n\r\n\r[".$price."]");

$notify->setReturnParameter("return_code","SUCCESS");
}
} else {
// 返回状态码
$notify->setReturnParameter("return_code","FAIL");
// 返回信息
$notify->setReturnParameter("return_msg","签名失败");
}

class Log_
{
// 打印log
function  log_result($file,$word) 
{
    $fp = fopen($file,"a");
    flock($fp, LOCK_EX) ;
    fwrite($fp,"执行日期:".strftime("%Y-%m-%d-%H:%M:%S",time())."\n".$word."\n\n");
    flock($fp, LOCK_UN);
    fclose($fp);
}
}
?>
求大神指点迷津,跪拜,叩首!