gpt4 book ai didi

php - 广泛的沙盒测试后未调用 PayPal notify_url

转载 作者:太空宇宙 更新时间:2023-11-03 16:36:01 27 4
gpt4 key购买 nike

我正在为一项慈善棋盘游戏事件设计一个网站,人们可以在其中现场观看事件,还可以向慈善机构(Child's Play)捐款,以迫使玩家连续玩 60 小时。因为捐款是直接捐给 Child's Play 的,所以我需要使用 notify_url 设置来传入我的 IPN 通知 URL;我们之前已经完成了两次马拉松比赛并且没有遇到任何问题,但我们最近将其移植到了 PHP。

现在,在过去的几个月里,我一直在使用沙箱对网站进行广泛的测试,一切都运行良好。离马拉松只有几个星期了,所以我切换到实际的 PayPal 系统,启动了测试捐赠,现在我遇到了一个问题:出于某种原因,PayPal 根本没有点击 notify_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());
}

}

对于 ipn 监听器类,我使用的是 Micah Carrick 创建的类,可在此处获取: https://github.com/Quixotix/PHP-PayPal-IPN

最佳答案

我就此事询问了我在 PayPal 的直接联系人并得到了以下回复...

In regards to the IPN issue, we had an outage last night. It was fixed at about 1-2am, the IPN’s are delayed because we had a backed up queue of about 2.5 million IPN’s which did not send out. We are currently working through these IPN’s. I’d expect normal functionality shortly.

您还可以看到很多人在谈论 this issue on Twitter .

关于php - 广泛的沙盒测试后未调用 PayPal notify_url,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14567768/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com