/** * Notify payment function * * @return void */ public function notify_payment() { require_once JPATH_BASE . '/administrator/components/com_redshop/helpers/order.php'; $app = JFactory::getApplication(); $db = JFactory::getDbo(); $request = JRequest::get('request'); $Itemid = JRequest::getVar('Itemid'); $objOrder = new order_functions(); JPluginHelper::importPlugin('redshop_payment'); $dispatcher = JDispatcher::getInstance(); $results = $dispatcher->trigger('onNotifyPayment' . $request['payment_plugin'], array($request['payment_plugin'], $request)); $msg = $results[0]->msg; if (array_key_exists("order_id_temp", $results[0])) { $order_id = $results[0]->order_id_temp; } else { $order_id = $results[0]->order_id; } $objOrder->changeorderstatus($results[0]); $model = $this->getModel('order_detail'); $resetcart = $model->resetcart(); /* * Plugin will trigger onAfterNotifyPayment */ $dispatcher->trigger('onAfterNotifyPayment' . $request['payment_plugin'], array($request['payment_plugin'], $order_id)); if ($request['payment_plugin'] == "rs_payment_payer") { die("TRUE"); } if ($request['payment_plugin'] != "rs_payment_worldpay") { // New checkout flow $redirect_url = JRoute::_(JURI::base() . "index.php?option=com_redshop&view=order_detail&layout=receipt&Itemid={$Itemid}&oid=" . $order_id); $this->setRedirect($redirect_url, $msg); } }
public function notify_payment() { $app = JFactory::getApplication(); $request = JRequest::get('request'); require_once JPATH_BASE . '/components/com_redshop/helpers/order.php'; $objOrder = new order_functions(); JPluginHelper::importPlugin('redshop_payment'); $dispatcher = JDispatcher::getInstance(); $results = $dispatcher->trigger('onNotifyPayment' . $request['payment_plugin'], array($request['payment_plugin'], $request)); $msg = $results[0]->msg; $objOrder->changeorderstatus($results[0]); $redirect_url = JRoute::_(JURI::base() . "index.php?option=com_redshop&view=order_detail&task=edit&cid[]=" . $request['orderid']); $app->redirect($redirect_url, $msg); }