Post by volkanador » Mon Sep 06, 2010 1:01 am

Hi when the vpos provider bank send me a callback then its doesnt work at ie its automaticly continue to homepage. I found the problem and its because of a turkish charachter like "Onaylandı" (Thats mean "Confirmed") and when im try to change in manually letter "ı" to "i" its work. But i cant figure out this because this word not placed in my codes its coming from vpos provider. I cant solve it . anyone can help me ?
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'));
		}
	}
}
?>
	
	
	
	

Newbie

Posts

Joined
Tue May 04, 2010 9:30 pm

Post by Miguelito » Mon Sep 06, 2010 5:40 am

I think there's function(s) in php to remove other than "basic" characters from a string so that should help you...

The Finnish OpenCart Forum
"Real programmers don't document. If it was hard to write, it should be hard to understand."


Active Member

Posts

Joined
Sun Jan 10, 2010 10:11 pm

Post by volkanador » Wed Sep 08, 2010 4:25 pm

Thanks for the answer Miguelito but its doesnt work still cand found a solution. Any other recommend(s) ?

Newbie

Posts

Joined
Tue May 04, 2010 9:30 pm

Post by Miguelito » Wed Sep 08, 2010 7:25 pm

What functions have you tried? I think you need to urlencode the GET response you receive from vpos provider.

The Finnish OpenCart Forum
"Real programmers don't document. If it was hard to write, it should be hard to understand."


Active Member

Posts

Joined
Sun Jan 10, 2010 10:11 pm
Who is online

Users browsing this forum: No registered users and 13 guests