Php 经过广泛的沙箱测试后,未调用PayPal notify_url

Php 经过广泛的沙箱测试后,未调用PayPal notify_url,php,paypal,paypal-ipn,paypal-sandbox,Php,Paypal,Paypal Ipn,Paypal Sandbox,我正在为一个慈善棋盘游戏活动设计一个网站,人们可以现场观看该活动,并可以向慈善机构(儿童游戏)捐款,以迫使玩家连续玩60小时。由于捐款将直接用于儿童游戏,我需要使用notify_url设置来传递我的IPN通知url;我们以前做过两次马拉松,没有遇到任何问题,但最近我们将其移植到了PHP 现在,在过去的几个月里,我一直在使用沙箱对该站点进行广泛的测试,一切都很顺利。距离马拉松只有几周的时间了,所以我切换到实际的PayPal系统,发起了一次测试捐赠,现在我遇到了一个问题:出于某种原因,PayPal根

我正在为一个慈善棋盘游戏活动设计一个网站,人们可以现场观看该活动,并可以向慈善机构(儿童游戏)捐款,以迫使玩家连续玩60小时。由于捐款将直接用于儿童游戏,我需要使用notify_url设置来传递我的IPN通知url;我们以前做过两次马拉松,没有遇到任何问题,但最近我们将其移植到了PHP

现在,在过去的几个月里,我一直在使用沙箱对该站点进行广泛的测试,一切都很顺利。距离马拉松只有几周的时间了,所以我切换到实际的PayPal系统,发起了一次测试捐赠,现在我遇到了一个问题:出于某种原因,PayPal根本没有点击通知url。我已经通过暂时切换回沙盒验证了URL,一切正常。我还在侦听器代码中添加了一些对error_log的调用,以查看它是否只是在代码中的某个地方被捕获,但我发现它根本没有被命中

如果有人能在这里就我能做什么提出任何建议,我将不胜感激。很明显,我的时间有点紧,所以如果您能尽快回复,我将不胜感激

编辑:以下是相关代码:

if (isset($_GET['paypalipn'])) {
  // tell PHP to log errors to ipn_errors.log in this directory
  ini_set('log_errors', true);
  ini_set('error_log', dirname(__FILE__).'/ipn_errors.log');

  // intantiate the IPN listener
  $listener = new IpnListener();

  // tell the IPN listener to use the PayPal test sandbox
  $listener->use_sandbox = false;

  error_log("here");

  // try to process the IPN POST
  try {
    $listener->requirePostMethod();
    $verified = $listener->processIpn();
  } catch (Exception $e) {
    error_log($e->getMessage());
    exit(0);
  }

  error_log("here2");

  // Process the IPN
  if ($verified) {

      error_log("here3");

      $errmsg = '';   // stores errors from fraud checks

      // Split the custom variable
      $split_custom = explode("&", $_POST['custom']);
      $custom_array = array();
      for ($i = 0; $i<count($split_custom); $i++) {
        $current_set = explode("=", $split_custom[$i]);
        $custom_array[$current_set[0]] = $current_set[1];
      } 

      error_log("here4");

      if (!isset($custom_array['game'])) {
        $custom_array['game'] = 0;
      }
      if (!isset($custom_array['player'])) {
        $custom_array['player'] = 0;
      }

      error_log("here5");

      if (!empty($errmsg)) {

          // manually investigate errors from the fraud checking
          $body = "IPN failed fraud checks: \n$errmsg\n\n";
          $body .= $listener->getTextReport();
          mail('jafawcett@gmail.com', 'IPN Fraud Warning', $body);

      } else {

          mail('jafawcett@gmail.com', 'Successful IPN', $listener->getTextReport());
      }

      error_log("donor_un: ".$custom_array['donor_un']);
      process_donation($_POST['mc_gross'], $custom_array['player'], $custom_array['game'],     $custom_array['donor_name'], $_POST['payer_email'], $custom_array['donor_un']);

  } else {
      // manually investigate the invalid IPN
      mail('jafawcett@gmail.com', 'Invalid IPN', $listener->getTextReport());
  }

}
if(设置($\u GET['paypalipn'])){
//告诉PHP将错误记录到此目录中的ipn_errors.log
ini_集('log_errors',true);
ini_集('error_log',dirname('uuu FILE.'.'/ipn_errors.log');
//插入IPN侦听器
$listener=新的IpnListener();
//告诉IPN侦听器使用PayPal测试沙箱
$listener->use_sandbox=false;
错误日志(“此处”);
//尝试处理IPN POST
试一试{
$listener->requirePostMethod();
$verified=$listener->processIpn();
}捕获(例外$e){
错误日志($e->getMessage());
出口(0);
}
错误日志(“此处2”);
//处理IPN
如果($已核实){
错误日志(“此处3”);
$errmsg='';//存储欺诈检查中的错误
//拆分自定义变量
$split_custom=explode(&,$_POST['custom']);
$custom_array=array();
对于($i=0;$igetTextReport();
邮件('jafawcett@gmail.com“,”知识产权欺诈警告“,$body);
}否则{
邮件('jafawcett@gmail.com“,”成功的IPN“,$listener->getExtreport());
}
错误日志(“施主联合国:.$custom联合国数组['施主联合国]);
处理捐款($邮寄['mc_gross']、$定制阵列['player']、$定制阵列['game']、$定制阵列['Provider_name']、$邮寄['payer_email']、$定制阵列['Provider_un']);
}否则{
//手动调查无效的IPN
邮件('jafawcett@gmail.com“,”无效IPN“,$listener->getExtreport());
}
}
对于ipn listener类,我使用的是Micah Carrick创建的类,可在此处获得:
我们遇到了同样的问题

几个月来,它工作得非常好,脚本也没有被修改。PayPal IPN也在PayPal帐户中启用,我们的IPN今天早上刚刚停止


PayPal可能有问题,我们仍在努力解决。

我询问了PayPal的直接联系人,得到了以下回复

关于IPN问题,我们昨晚发生了一次中断,已经修复 大约凌晨1-2点,IPN延迟,因为我们有一个备份队列 在大约250万个尚未发出的IPN中,我们目前 正在处理这些IPN。我希望很快就能正常工作


您还可以看到很多人在谈论。

发布您目前掌握的代码。很抱歉,按一下submit可快速:/