shop.balmet.com

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

payza.php (1418B)


      1 <?php
      2 class ControllerExtensionPaymentPayza extends Controller {
      3 	public function index() {
      4 		$data['button_confirm'] = $this->language->get('button_confirm');
      5 
      6 		$this->load->model('checkout/order');
      7 
      8 		$order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']);
      9 
     10 		$data['action'] = 'https://secure.payza.com/checkout';
     11 
     12 		$data['ap_merchant'] = $this->config->get('payment_payza_merchant');
     13 		$data['ap_amount'] = $this->currency->format($order_info['total'], $order_info['currency_code'], $order_info['currency_value'], false);
     14 		$data['ap_currency'] = $order_info['currency_code'];
     15 		$data['ap_purchasetype'] = 'Item';
     16 		$data['ap_itemname'] = $this->config->get('config_name') . ' - #' . $this->session->data['order_id'];
     17 		$data['ap_itemcode'] = $this->session->data['order_id'];
     18 		$data['ap_returnurl'] = $this->url->link('checkout/success');
     19 		$data['ap_cancelurl'] = $this->url->link('checkout/checkout', '', true);
     20 
     21 		return $this->load->view('extension/payment/payza', $data);
     22 	}
     23 
     24 	public function callback() {
     25 		if (isset($this->request->post['ap_securitycode']) && ($this->request->post['ap_securitycode'] == $this->config->get('payment_payza_security'))) {
     26 			$this->load->model('checkout/order');
     27 
     28 			$this->model_checkout_order->addOrderHistory($this->request->post['ap_itemcode'], $this->config->get('payment_payza_order_status_id'));
     29 		}
     30 	}
     31 }