Here is the sample Link : http://www.domain.com/index.php?route=p ... =Onaylandı
Here is the codes :
Code: Select all
<?php
class ControllerPaymentykbpos extends Controller {
protected function index() {
$this->data['button_confirm'] = $this->language->get('button_confirm');
$this->data['button_back'] = $this->language->get('button_back');
$this->load->model('checkout/order');
$order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']);
$this->load->library('encryption');
$this->data['action'] = 'https://www.posnet.domain***.com/3DSWebService/OOS';
$this->data['mid'] = $this->config->get('mid');
$this->data['tid'] = $this->config->get('tid');
$this->data['vftCode'] = $this->config->get('vftCode');
$this->data['posnetID'] = $this->config->get('posnetID');
$this->data['currencyCode'] = $this->config->get('currencyCode');
$this->data['lang'] = $this->config->get('lang');
$this->data['instalment'] = $this->config->get('instalment');
$this->data['callback'] = $this->config->get('callback');
$this->data['donusb'] = $this->config->get('donusb');
$this->data['donusx'] = $this->config->get('donusx');
$this->data['order_id'] = $order_info['order_id'];
$this->data['amount'] = $this->currency->format($order_info['total'], $order_info['currency'], $order_info['value'], FALSE);
$this->data['currency'] = $order_info['currency'];
$this->data['description'] = $this->config->get('config_name') . ' - #' . $order_info['order_id'];
$this->data['name'] = $order_info['payment_firstname'] . ' ' . $order_info['payment_lastname'];
if (!$order_info['payment_address_2']) {
$this->data['address'] = $order_info['payment_address_1'] . ', ' . $order_info['payment_city'] . ', ' . $order_info['payment_zone'];
} else {
$this->data['address'] = $order_info['payment_address_1'] . ', ' . $order_info['payment_address_2'] . ', ' . $order_info['payment_city'] . ', ' . $order_info['payment_zone'];
}
$this->data['postcode'] = $order_info['payment_postcode'];
$this->data['country'] = $order_info['payment_iso_code_2'];
$this->data['telephone'] = $order_info['telephone'];
$this->data['email'] = $order_info['email'];
$this->data['tranType'] = $this->config->get('tranType');
if ($this->request->get['route'] != 'checkout/guest_step_3') {
$this->data['back'] = HTTP_SERVER . 'index.php?route=checkout/payment';
} else {
$this->data['back'] = HTTP_SERVER . 'index.php?route=checkout/guest_step_2';
}
$this->id = 'payment';
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/payment/ykbpos.tpl')) {
$this->template = $this->config->get('config_template') . '/template/payment/ykbpos.tpl';
} else {
$this->template = 'default/template/payment/ykbpos.tpl';
}
$this->render();
}
public function callback() {
$this->language->load('payment/ykbpos');
$this->data['title'] = sprintf($this->language->get('heading_title'), $this->config->get('config_name'));
if (!isset($this->request->server['HTTP']) || ($this->request->server['HTTP'] != 'on')) {
$this->data['base'] = HTTP_SERVER;
} else {
$this->data['base'] = HTTP_SERVER;
}
$this->data['charset'] = $this->language->get('charset');
$this->data['language'] = $this->language->get('code');
$this->data['direction'] = $this->language->get('direction');
$this->data['heading_title'] = sprintf($this->language->get('heading_title'), $this->config->get('config_name'));
$this->data['text_response'] = $this->language->get('text_response');
$this->data['text_success'] = $this->language->get('text_success');
$this->data['text_success_wait'] = sprintf($this->language->get('text_success_wait'), HTTP_SERVER . 'index.php?route=checkout/success');
$this->data['text_failure'] = $this->language->get('text_failure');
$this->data['text_failure_wait'] = sprintf($this->language->get('text_failure_wait'), HTTP_SERVER . 'index.php?route=checkout/cart');
if ($this->request->get['route'] != 'checkout/guest_step_3') {
$this->data['text_failure_wait'] = sprintf($this->language->get('text_failure_wait'), HTTP_SERVER . 'index.php?route=checkout/payment');
} else {
$this->data['text_failure_wait'] = sprintf($this->language->get('text_failure_wait'), HTTP_SERVER . 'index.php?route=checkout/guest_step_2');
}
$returncode = $_GET['returncode'];
if (isset($this->request->get['returncode']) && $this->request->get['returncode'] == 1) {
$xid = $_GET['xid'];
$order_id =substr($xid,17);
$this->load->model('checkout/order');
$this->model_checkout_order->confirm($this->session->data['order_id'], $this->config->get('config_order_status_id'));
$message = '';
$this->model_checkout_order->update($order_id, $this->config->get('ykbpos_order_status_id'), $message, FALSE);
$this->data['continue'] = HTTP_SERVER . 'index.php?route=checkout/success';
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/payment/ykbpos_success.tpl')) {
$this->template = $this->config->get('config_template') . '/template/payment/ykbpos_success.tpl';
} else {
$this->template = 'default/template/payment/ykbpos_success.tpl';
}
$this->response->setOutput($this->render(TRUE), $this->config->get('config_compression'));
} else {
$this->data['continue'] = HTTP_SERVER . 'index.php?route=checkout/cart';
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/payment/ykbpos_failure.tpl')) {
$this->template = $this->config->get('config_template') . '/template/payment/ykbpos_failure.tpl';
} else {
$this->template = 'default/template/payment/ykbpos_failure.tpl';
}
$this->response->setOutput($this->render(TRUE), $this->config->get('config_compression'));
}
}
}
?>