Garanti Ortak Ödeme sayfası - callback() ta hata

macroman

OpenCart-TR
Katılım
2 Tem 2010
Mesajlar
3
Tepkime puanı
0
Puanları
0
s.a. 2 haftadır OpenChart ile ilgileniyorum, 1.4.8 sürümünü yükledim ve Garanti bankası ortak öndeme sayfası için modül hazırlıyorum. Ortak ödeme sayfasının açılmasında bir problemim yok yalnız geri dönüş için başarı durumunda 'index.php?route=checkout/success', hata durumunda 'index.php?route=checkout/failed' sayfalarına yaptığım yönlendirmelerde "Aradığınız Sayfa Bulunamadı." hatası alıyorum. "catalog\controller\payment\GarantiOrtakOdeme.php" içerisindeki callback() fonksiyonu içerisinden ayarlandığını biliyorum ama sanırım aynı fonksiyonu ortak ödeme sayfasını açarken post verilerini gönderdiğim için biraz karışıklık oluyor.

PHP:
$this->data['continue'] = HTTPS_SERVER . 'index.php?route=checkout/success';
				if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/payment/GarantiOrtakOdeme_success.tpl')) {
					$this->template = $this->config->get('config_template') . '/template/payment/GarantiOrtakOdeme_success.tpl';
				} else {
					$this->template = 'default/template/payment/paypoint_success.tpl';
				}

ve
PHP:
$this->data['continue'] = HTTPS_SERVER . 'index.php?route=checkout/cart';
				if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/payment/GarantiOrtakOdeme_failure.tpl')) {
					$this->template = $this->config->get('config_template') . '/template/payment/GarantiOrtakOdeme_failure.tpl';
				} else {
					$this->template = 'default/template/payment/GarantiOrtakOdeme_failure.tpl';
				}
satırlarının işimi görmesi lazım ama çalışmıyor. yada sanırım ben henüz tam idrak edemedim, aşağıda callback() fonksiyonunun tam içeriği var biri yardım edebilirse seviniri.

PHP:
	public function callback() {
		if ( 	( isset($this->request->post['HASHPARAMS']) AND isset($this->request->post['HASHPARAMSVAL']) AND $this->request->post['hashparam'] ) OR ( isset($this->request->post['mdStatus'] ) OR  isset($this->request->post['mdErrorMsg']) ) ) {
			$this->language->load('payment/GarantiOrtakOdeme');
			if (!isset($this->request->server['HTTPS']) || ($this->request->server['HTTPS'] != 'on')) {
				$this->data['base'] = HTTP_SERVER;
			} else {
				$this->data['base'] = HTTPS_SERVER;
			}
			$this->data['charset'] = $this->language->get('charset');
			$this->data['language'] = $this->language->get('code');
			$this->data['direction'] = $this->language->get('direction');

			$mdStatus 		= $this->request->post["mdStatus"];
			$hashparams		= $this->request->post["HASHPARAMS"];
			$hashparamsval	= $this->request->post["HASHPARAMSVAL"];
			$hashparam 		= $this->request->post["HASH"];
			$storekey		= $this->config->get('GarantiOrtakOdemeSayfasiStoreKey');
			$paramsval		= "";
			$index1			= 0;
			$index2			= 0;
			
			while($index1 < strlen($hashparams)){
				$index2 = strpos($hashparams,":",$index1);
				$vl = $_POST[substr($hashparams,$index1,$index2- $index1)];
				if($vl == null)
				$vl = "";
				$paramsval = $paramsval . $vl; 
				$index1 = $index2 + 1;
			}
			$storekey 	= $this->config->get('GarantiOrtakOdemeSayfasiStoreKey');
			$hashval 	= $paramsval.$storekey;
			$hash = base64_encode(pack('H*',sha1($hashval)));
			$this->data['title'] = $this->language->get('heading_title');
			
			if( ($paramsval == $hashparamsval || $hashparam == $hash) AND ($mdStatus == 1 || $mdStatus == 2 || $mdStatus == 3 || $mdStatus == 4) AND  $this->request->post['Response'] == 'Approved' ) {
				

				
				$this->load->library('encryption');
				$encryption = new Encryption($this->config->get('config_encryption'));
				$order_id = $encryption->decrypt($this->request->get['order_id']);
				$this->load->model('checkout/order');
				$this->model_checkout_order->confirm($order_id, $this->config->get('config_order_status_id'));
				
				//
					$message = '';
				//

				$this->model_checkout_order->update($order_id, $this->config->get('GarantiOrtakOdeme_order_status_id'), $message, FALSE);
				
				$this->data['text_message'] = $this->language->get('goos_success_text');
				$this->data['text_header']  = $this->language->get('goos_success_header');
				$this->data['text_success_wait'] = sprintf($this->language->get('goos_success_wait'), HTTP_SERVER . 'index.php?route=checkout/success');
				
				$this->data['continue'] = HTTPS_SERVER . 'index.php?route=checkout/success';
				if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/payment/GarantiOrtakOdeme_success.tpl')) {
					$this->template = $this->config->get('config_template') . '/template/payment/GarantiOrtakOdeme_success.tpl';
				} else {
					$this->template = 'default/template/payment/paypoint_success.tpl';
				}	
				$this->response->setOutput($this->render(TRUE), $this->config->get('config_compression'));			
			}
			else {
				$this->data['text_header']  = $this->language->get('goos_failure_header');
				if 	( in_array( $this->request->post["ProcReturnCode"] , array ( 4, 7 , 34, 36, 37, 38, 41, 43, 75, 76) ) ){
					$this->data['text_failure'] = $this->language->get('goos_error_0');
				} else {
					$this->data['text_failure'] = $this->request->post['ErrMsg'];
				}	

				$this->data['text_failure_wait'] = $this->language->get('goos_failure_wait');
				
				$this->data['continue'] = HTTPS_SERVER . 'index.php?route=checkout/cart';
				if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/payment/GarantiOrtakOdeme_failure.tpl')) {
					$this->template = $this->config->get('config_template') . '/template/payment/GarantiOrtakOdeme_failure.tpl';
				} else {
					$this->template = 'default/template/payment/GarantiOrtakOdeme_failure.tpl';
				}	
				
				$this->response->setOutput($this->render(TRUE), $this->config->get('config_compression'));
			}		
		}
		else {
			$this->load->library('encryption');
			$encryption = new Encryption($this->config->get('config_encryption'));
			if (isset($this->request->post['custom'])) {
				$order_id = $encryption->decrypt($this->request->post['custom']);
			} else {
				$order_id = 0;
			}
			$this->load->model('checkout/order');
			$order_info = $this->model_checkout_order->getOrder($order_id);
			if ($order_info) {
				$request = 'cmd=_notify-validate';
			
				foreach ($this->request->post as $key => $value) {
					$request .= '&' . $key . '=' . urlencode(stripslashes(html_entity_decode($value, ENT_QUOTES, 'UTF-8')));
				}
					
				if (extension_loaded('curl')) {
					if (!$this->config->get('GarantiOrtakOdemeSayfasi_test')) {
						$ch = curl_init('http://www.deneme.com/deneme.php');
					} else {
						$addr  = $this->config->get('GarantiOrtakOdemeSayfasiAcsessURL');
						$ch = curl_init($addr);
					}
	
					curl_setopt($ch, CURLOPT_POST, true);
					curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
					curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
					curl_setopt($ch, CURLOPT_HEADER, false);
					curl_setopt($ch, CURLOPT_TIMEOUT, 30);
					curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
			
					$response = curl_exec($ch);
				
					if (strcmp($response, 'VERIFIED') == 0 || $this->request->post['payment_status'] == 'Completed') {
						$this->model_checkout_order->confirm($order_id, $this->config->get('GarantiOrtakOdemeSayfasi_order_status_id'));
					} else {
						$this->model_checkout_order->confirm($order_id, $this->config->get('config_order_status_id'));
					}
						
					curl_close($ch);
				} else {
					$header  = 'POST /cgi-bin/webscr HTTP/1.0' . "\r\n";
					$header .= 'Content-Type: application/x-www-form-urlencoded' . "\r\n";
					$header .= 'Content-Length: ' . strlen(utf8_decode($request)) . "\r\n";
					$header .= 'Connection: close'  ."\r\n\r\n";
					
					if (!$this->config->get('GarantiOrtakOdemeSayfasi_test')) {
						$fp = fsockopen('www.deneme.com', 80, $errno, $errstr, 30);
					} else {
						$fp = fsockopen('ccpos.garanti.com.tr', 80, $errno, $errstr, 30);
					}
				
					if ($fp) {
						fputs($fp, $header . $request);
					
						while (!feof($fp)) {
							$response = fgets($fp, 1024);
						
							if (strcmp($response, 'VERIFIED') == 0) {
								$this->model_checkout_order->confirm($order_id, $this->config->get('GarantiOrtakOdemeSayfasi_order_status_id'));
							} else {
								$this->model_checkout_order->confirm($order_id, $this->config->get('config_order_status_id'));
							}
						}
						
						fclose($fp);
					}
					else {  echo  $errno . ' - ' . $errstr; }
				}
			}
		}
	}
 

admin

Administrator
Yönetici
Katılım
13 Ağu 2009
Mesajlar
3,200
Tepkime puanı
1
Puanları
38
Yaş
38
Konum
Bursa
Web sitesi
www.opencart-tr.com
Başarılı ya da başarısız durumlar için tanımladığın tpl dosyaları mevcut mu?
 

macroman

OpenCart-TR
Katılım
2 Tem 2010
Mesajlar
3
Tepkime puanı
0
Puanları
0
eka7a' Alıntı:
Başarılı ya da başarısız durumlar için tanımladığın tpl dosyaları mevcut mu?

evet


-- Edit --

Hata nerde bulamadım ama sıfırdan başka türlü bidaha yazdım şimdi çalışıyor, teşekürler
 

misyon

OpenCart-TR
Katılım
16 Haz 2010
Mesajlar
2
Tepkime puanı
0
Puanları
0
ccpos.garanti.com.tr bu adres yanlış olmalı garanti ortak ödem için başka bir adres kullanıyor neyse zaten sorunu çözmüşsün
 

macroman

OpenCart-TR
Katılım
2 Tem 2010
Mesajlar
3
Tepkime puanı
0
Puanları
0
Bu kadar eski bir konuyu yukarı taşımak istemezdim ama hala benden Ortak Ödeme sayfası hakkında yardım için mail atanlar var, ben bir defaya mahsus ihtiyaç doğrultusunda yazdım sonrada opencart la işim olmadı. Kodların yedeği elimde mevcut fakat hangi sürüme uyumludur, çalışması için standart dosyalarda bi değişiklik yaptım mı, hatırlamıyorum bi problem olursada yardım edecek vakte sahip değilim. Ben hallederim diyorsanız kodlar burada diyecem anaaa dosya yükleme yokmuş burda...


neyse buralara attım artık silinene kadar indirecek indirsin

http://rapidshare.com/files/446681023/Garanti_ortak___deme.rar
http://www.speedyshare.com/files/26730814/Garanti_ortak_deme.rar
http://hotfile.com/dl/102642926/8e4fbe7/Garanti_ortak_deme.rar.html
http://www.fileserve.com/file/8yJCsgR

tek hatırladığım nokta taksitli satış için garantiyle anlaşmadıysanız, post ile verileri gönderirken taksit diye bişi olmayacak; gönderirken <input name=taksit value= 1> veya value = 0 gibi bir değer gitmicek, aksi halde hata veriyordu. Bu kodu yazdığım yerin taksit anlaşması yoktu o yüzden bööle. taksit için geliştirecektim ama gerek yok dediler, benimde başka işlerim çıkınca kaldı bööle
 

MUSTANG.3

OpenCart-TR
Katılım
24 Eki 2009
Mesajlar
37
Tepkime puanı
0
Puanları
0
macroman' Alıntı:
Bu kadar eski bir konuyu yukarı taşımak istemezdim ama hala benden Ortak Ödeme sayfası hakkında yardım için mail atanlar var, ben bir defaya mahsus ihtiyaç doğrultusunda yazdım sonrada opencart la işim olmadı. Kodların yedeği elimde mevcut fakat hangi sürüme uyumludur, çalışması için standart dosyalarda bi değişiklik yaptım mı, hatırlamıyorum bi problem olursada yardım edecek vakte sahip değilim. Ben hallederim diyorsanız kodlar burada diyecem anaaa dosya yükleme yokmuş burda...


neyse buralara attım artık silinene kadar indirecek indirsin

http://rapidshare.com/files/446681023/Garanti_ortak___deme.rar
http://www.speedyshare.com/files/26730814/Garanti_ortak_deme.rar
http://hotfile.com/dl/102642926/8e4fbe7/Garanti_ortak_deme.rar.html
http://www.fileserve.com/file/8yJCsgR

tek hatırladığım nokta taksitli satış için garantiyle anlaşmadıysanız, post ile verileri gönderirken taksit diye bişi olmayacak; gönderirken <input name=taksit value= 1> veya value = 0 gibi bir değer gitmicek, aksi halde hata veriyordu. Bu kodu yazdığım yerin taksit anlaşması yoktu o yüzden bööle. taksit için geliştirecektim ama gerek yok dediler, benimde başka işlerim çıkınca kaldı bööle

Kurulumu tamamladım yalnız Ortak Ödeme Sayfası erişim adresi: bölümüne hangi linki vereceğim onu bilmmiyorum...
macroman arkadaşımızın verdiği modüle yardımcı olabilecek arkadaşlar varmı acaba !
 

kodinternet

OpenCart-TR
Katılım
20 Şub 2013
Mesajlar
26
Tepkime puanı
0
Puanları
0
Arkadaşlar indirenlerden ya da konuyu paylaşan arkadaştan kodları tekrar paylaşmanız mümkün mü?
 
Üst