pages/payment/PaymentHandler.inc.php

Go to the documentation of this file.
00001 <?php
00002 
00016 // $Id$
00017 
00018 
00019 import('handler.Handler');
00020 
00021 class PaymentHandler extends Handler {
00025    function PaymentHandler() {
00026       parent::Handler();
00027 
00028       $this->addCheck(new HandlerValidatorConference($this));
00029       $this->addCheck(new HandlerValidatorSchedConf($this));      
00030    }
00031 
00035    function plugin($args) {
00036       $this->validate();
00037       $this->setupTemplate();
00038       
00039       $paymentMethodPlugins =& PluginRegistry::loadCategory('paymethod');
00040       $paymentMethodPluginName = array_shift($args);
00041       if (empty($paymentMethodPluginName) || !isset($paymentMethodPlugins[$paymentMethodPluginName])) {
00042          Request::redirect(null, null, 'index');
00043       }
00044 
00045       $paymentMethodPlugin =& $paymentMethodPlugins[$paymentMethodPluginName];
00046       if (!$paymentMethodPlugin->isConfigured()) {
00047          Request::redirect(null, null, 'index');
00048       }
00049 
00050       $paymentMethodPlugin->handle($args);
00051    }
00052 
00056    function landing($args) {
00057       $this->validate();
00058       $this->setupTemplate();
00059 
00060       $user =& Request::getUser();
00061       $schedConf =& Request::getSchedConf();
00062       if (!$user || !$schedConf) Request::redirect(null, null, 'index');
00063 
00064       $registrationDao =& DAORegistry::getDAO('RegistrationDAO');
00065       $registrationId = $registrationDao->getRegistrationIdByUser($user->getId(), $schedConf->getId());
00066       $registration =& $registrationDao->getRegistration($registrationId);
00067 
00068       $templateMgr =& TemplateManager::getManager();
00069       $templateMgr->assign('message', ($registration && $registration->getDatePaid()) ? 'schedConf.registration.landingPaid' : 'schedConf.registration.landingUnpaid');
00070       $templateMgr->assign('backLink', Request::url(null, null, 'index'));
00071       $templateMgr->assign('backLinkLabel', 'common.continue');
00072       $templateMgr->display('common/message.tpl');
00073    }
00074 }
00075 
00076 ?>

Generated on 25 Jul 2013 for Open Conference Systems by  doxygen 1.4.7