public function postRequest() { $token = JSession::checkToken(); if (!$token) { die('Invail request'); } $app = jfactory::getApplication(); AImporter::helper('email'); AImporter::classes('order/custom'); $order = new BookproCustomOrder(); $order->orderinfo = $this->input->get('orderinfo', array(), 'array'); $order->customer = $_POST; $db = JFactory::getDbo(); if ($order->save()) { $mail = new EmailHelper($order->table->id); $mail->sendMail(); $app->enqueueMessage(JText::_('COM_BOOKPRO_CUSTOM_THANKS_FOR_BOOKING')); } $app->redirect('index.php?option=com_bookpro&view=customservice'); return; }
function ext_exit() { global $mainframe; if (class_exists('jfactory')) { $app = jfactory::getApplication(); $app->close(); } if (is_callable(array($mainframe, 'close'))) { $mainframe->close(); } else { session_write_close(); exit; } }
/** * Processes the sale payment * */ function _processSale() { $this->autoload(); JbPaymentLib::write_log('nbd.txt', 'IPN: ' . json_encode($_REQUEST)); $input = jfactory::getApplication()->input; $status = $input->getString('nbd_transactionStatus'); if ($status == 'COMPLETE') { $order_number = $input->getString('_itemId'); $order_jb = $this->_getOrder($order_number); $order_jb->pay_status = 'SUCCESS'; $order_jb->order_status = 'CONFIRMED'; $order_jb->tx_id = $tnxref; $order_jb->store(); return $order_jb; } else { die; } }