私はチャリティーボードゲームイベントのウェブサイトをデザインしています。このイベントでは、イベントをライブで視聴でき、チャイルドプレイ(チャイルドプレイ)に寄付して、プレーヤーに60時間継続してプレイさせることができます。寄付は直接Child'sPlayに送られるため、notify_url設定を使用してIPN通知URLを渡す必要があります。このマラソンはこれまでに2回行ったことがあり、問題はありませんでしたが、最近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で入手できるクラスを使用しています。