function restore() { global $Itemid, $mainframe; $paypal_session_id = JRequest::getVar('return'); DT_Session::restoreFromPayment($paypal_session_id); $paymethod = DT_Session::get('register.payment.method'); $paymentClass = DT_Session::get('register.payment.method'); require_once JPATH_SITE . '/components/com_dtregister/lib/payment/' . $paymentClass . '.php'; $payment = new $paymentClass(); $baseurl = str_replace('components/com_dtregister/', '', Juri::base()); if ($payment->success()) { $mainframe->redirect($baseurl . "index.php?option=com_dtregister&controller=payment&task=success&Itemid={$Itemid}"); } else { $mainframe->redirect($baseurl . "index.php?option=com_dtregister&controller=payment&task=cancel&Itemid={$Itemid}"); } }