function displayPaymentForm($queuedPaymentId, &$queuedPayment)
{
if (!$this->isConfigured()) {
return false;
}
$schedConf =& Request::getSchedConf();
$user =& Request::getUser();
$params = array('business' => $this->getSetting($schedConf->getConferenceId(), $schedConf->getId(), 'selleraccount'), 'item_name' => $queuedPayment->getDescription(), 'amount' => $queuedPayment->getAmount(), 'quantity' => 1, 'no_note' => 1, 'no_shipping' => 1, 'currency_code' => $queuedPayment->getCurrencyCode(), 'lc' => String::substr(Locale::getLocale(), 3), 'custom' => $queuedPaymentId, 'notify_url' => Request::url(null, null, 'payment', 'plugin', array($this->getName(), 'ipn')), 'return' => $queuedPayment->getRequestUrl(), 'cancel_return' => Request::url(null, null, 'payment', 'plugin', array($this->getName(), 'cancel')), 'first_name' => $user ? $user->getFirstName() : '', 'last_name' => $user ? $user->getLastname() : '', 'item_number' => 1, 'cmd' => '_xclick');
$templateMgr =& TemplateManager::getManager();
switch ($queuedPayment->getType()) {
case QUEUED_PAYMENT_TYPE_REGISTRATION:
// Provide registration-specific details to template.
$registrationDao =& DAORegistry::getDAO('RegistrationDAO');
$registrationOptionDao =& DAORegistry::getDAO('RegistrationOptionDAO');
$registrationTypeDao =& DAORegistry::getDAO('RegistrationTypeDAO');
$registration =& $registrationDao->getRegistration($queuedPayment->getAssocId());
if (!$registration || $registration->getUserId() != $queuedPayment->getUserId() || $registration->getSchedConfId() != $queuedPayment->getSchedConfId()) {
break;
}
$registrationOptionIterator =& $registrationOptionDao->getRegistrationOptionsBySchedConfId($schedConf->getId());
$registrationOptionCosts = $registrationTypeDao->getRegistrationOptionCosts($registration->getTypeId());
$registrationOptionIds = $registrationOptionDao->getRegistrationOptions($registration->getRegistrationId());
$templateMgr->assign('registration', $registration);
$templateMgr->assign('registrationType', $registrationTypeDao->getRegistrationType($registration->getTypeId()));
$templateMgr->assign('registrationOptions', $registrationOptionIterator->toArray());
$templateMgr->assign('registrationOptionCosts', $registrationOptionCosts);
$templateMgr->assign('registrationOptionIds', $registrationOptionIds);
}
$templateMgr->assign('params', $params);
$templateMgr->assign('paypalFormUrl', $this->getSetting($schedConf->getConferenceId(), $schedConf->getId(), 'paypalurl'));
$templateMgr->display($this->getTemplatePath() . 'paymentForm.tpl');
}