$templateEngine->assign('paymentgateways', $paymentgateways); $templateEngine->display('wizard_initial.tpl'); break; case 'confirmselectionpage': if (isset($_POST['selectionconfirmed'])) { // We have a form submitted, check it's valid and move to the next step if ($_POST['selectionconfirmed'] == 'correct') { // We can continue with payment $_SESSION['wizardpage'] = 'paymentpage'; $_SESSION['selectionconfirmed'] = TRUE; // TODO store selection in database yet? i.e. make user but don't give them access to it's details until we've gotten payment? reload_page(); exit; } else { // Selection is not confirmed, start again restart_wizard(); } } $templateEngine->assign('selectedgateway', $_SESSION['selectedpaymentgateway']); $templateEngine->assign('selectedvoucher', $_SESSION['selectedvoucher']); $templateEngine->display('wizard_confirmselection.tpl'); break; case 'paymentpage': //TODO Create user account and lock it here, so it's ready for the plugin to do with as needed (i.e. send details) //var_dump($_SESSION); //var_dump($_POST); //var_dump($vouchers); if (!isset($_SESSION['PendingAccount'])) { /* Create our locked random user */ $MaxMb = $vouchers[$_SESSION['selectedvoucher']]['MaxMb']; $MaxTime = $vouchers[$_SESSION['selectedvoucher']]['MaxTime'];
private function processConfirmSelectionPage() { if (isset($_POST['selectionconfirmed'])) { // We have a form submitted, check it's valid and move to the next step if ($_POST['selectionconfirmed'] == 'correct') { // We can continue with payment $this->state->wizardPage = 'paymentpage'; $this->state->selectionConfirmed = true; // TODO store selection in database yet? i.e. make user but don't give them access to it's details until we've gotten payment? $this->reloadPage(); exit; } else { // Selection is not confirmed, start again restart_wizard(); } } $this->templateEngine->assign('selectedgateway', $this->state->selectedPaymentGateway); $this->templateEngine->assign('selectedvoucher', $this->state->selectedVoucher); $this->templateEngine->display('wizard_confirmselection.tpl'); }