cod.php (652B)
1 <?php 2 class ControllerExtensionPaymentCod extends Controller { 3 public function index() { 4 return $this->load->view('extension/payment/cod'); 5 } 6 7 public function confirm() { 8 $json = array(); 9 10 if ($this->session->data['payment_method']['code'] == 'cod') { 11 $this->load->model('checkout/order'); 12 13 $this->model_checkout_order->addOrderHistory($this->session->data['order_id'], $this->config->get('payment_cod_order_status_id')); 14 15 $json['redirect'] = $this->url->link('checkout/success'); 16 } 17 18 $this->response->addHeader('Content-Type: application/json'); 19 $this->response->setOutput(json_encode($json)); 20 } 21 }