public function action_result() { $this->auto_render = FALSE; $id_order = Core::request('id_order'); //retrieve info for the item in DB $order = new Model_Order(); $order = $order->where('id_order', '=', $id_order)->where('status', '=', Model_Order::STATUS_CREATED)->limit(1)->find(); if ($order->loaded()) { //its a fraud...lets let him know if ($order->is_fraud() === TRUE) { Alert::set(Alert::ERROR, __('We had, issues with your transaction. Please try paying with another paymethod.')); $this->redirect(Route::url('default', array('controller' => 'ad', 'action' => 'checkout', 'id' => $order->id_order))); } //correct payment? if (($result = paguelofacil::check_result()) === TRUE) { //mark as paid $order->confirm_payment('paguelofacil', Core::request('Oper')); //redirect him to his ads Alert::set(Alert::SUCCESS, __('Thanks for your payment!')); $this->redirect(Route::url('oc-panel', array('controller' => 'profile', 'action' => 'orders'))); } else { Alert::set(Alert::INFO, __('Transaction not successful!')); $this->redirect(Route::url('default', array('controller' => 'ad', 'action' => 'checkout', 'id' => $order->id_order))); } } else { Alert::set(Alert::INFO, __('Order could not be loaded')); $this->redirect(Route::url('default', array('controller' => 'ad', 'action' => 'checkout', 'id' => $order->id_order))); } }
</li> <?php } ?> <?php if (($robokassa = robokassa::button($order)) != '') { ?> <li class="text-right"><?php echo $robokassa; ?> </li> <?php } ?> <?php if (($paguelofacil = paguelofacil::button($order)) != '') { ?> <li class="text-right"><?php echo $paguelofacil; ?> </li> <?php } ?> <?php if (($mp = MercadoPago::button($order)) != '') { ?> <li class="text-right"><?php echo $mp; ?> </li>