} } /* * PayPal IPN transactions are purely B2B, so most of the leaguerunner codebase isn't needed. * The main functions are: * - Update registration payments * - ensure registrations/payments are matched up for players */ // Check Request for IPN if ($_GET['q'] == 'ipn') { require_once "Handler/PaypalHandler.php"; // PayPal has its own logger $paypal_log = new KLogger($_SERVER['DOCUMENT_ROOT'] . '/' . $CONFIG['paths']['base_url'] . '/logs/paypal', Klogger::DEBUG); $paypal_log->logInfo('Received IPN Request'); $handler = new PaypalHandler(); $status = $handler->process(); // success could have multiple payments to log if ($status['status'] == true) { foreach ($status['message'] as $payment) { $paypal_log->logInfo('Registration #' . $payment->order_id . ' - ' . $payment->payment_amount . ' paid in full'); } } else { $paypal_log->logError($status['message']); $paypal_log->logDebug(print_r(debug_backtrace(), true)); } // no more IPN processing required exit; } // Set some template defaults global $smarty; $smarty->assign('app_name', variable_get('app_name', 'Leaguerunner'));