/** * Payment * @param id of order * @return void */ public function payment($id) { // Check user permission if (user::is_logged()) { $payment = new Payment_Model(); $order = new Order_Model(); $payment_id = $order->get_payment($id); $shipping = new Shipping_Model(); if ($payment->get_type($payment_id) == "pre") { // Paying inside shop (e.g. paypal, credit card) //continue here if ($order->get_status($id) == "none") { // go to payment now // TODO: payment module implementation } else { // Settings & View $this->set_title(Kohana::lang('eshop.already_paid')); $this->add_breadcrumb(Kohana::lang('eshop.already_paid'), NULL); $this->template->content = new View('cart_paid'); } } else { // Paying outside shop (e.g. bank transfer) => finish here // Show message about success // Settings & View $this->set_title(Kohana::lang('eshop.payment')); $this->add_breadcrumb(Kohana::lang('eshop.payment'), '/cart/payment'); $this->template->content = new View('cart_post'); $this->template->content->vsymbol = $id; $this->template->content->payment = $payment->get_info($payment_id); } } }
/** * Return type of payment method * @return string * @param integer */ public function get_type($id) { $payment = new Payment_Model(); return $payment->get_type($id); }