shop.balmet.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

cheque.php (1256B)


      1 <?php
      2 class ControllerExtensionPaymentCheque extends Controller {
      3 	public function index() {
      4 		$this->load->language('extension/payment/cheque');
      5 
      6 		$data['payable'] = $this->config->get('payment_cheque_payable');
      7 		$data['address'] = nl2br($this->config->get('config_address'));
      8 
      9 		return $this->load->view('extension/payment/cheque', $data);
     10 	}
     11 
     12 	public function confirm() {
     13 		$json = array();
     14 		
     15 		if ($this->session->data['payment_method']['code'] == 'cheque') {
     16 			$this->load->language('extension/payment/cheque');
     17 
     18 			$this->load->model('checkout/order');
     19 
     20 			$comment  = $this->language->get('text_payable') . "\n";
     21 			$comment .= $this->config->get('payment_cheque_payable') . "\n\n";
     22 			$comment .= $this->language->get('text_address') . "\n";
     23 			$comment .= $this->config->get('config_address') . "\n\n";
     24 			$comment .= $this->language->get('text_payment') . "\n";
     25 			
     26 			$this->model_checkout_order->addOrderHistory($this->session->data['order_id'], $this->config->get('payment_cheque_order_status_id'), $comment, true);
     27 			
     28 			$json['redirect'] = $this->url->link('checkout/success');
     29 		}
     30 		
     31 		$this->response->addHeader('Content-Type: application/json');
     32 		$this->response->setOutput(json_encode($json));
     33 	}
     34 }