<?php
	header('Content-type: text/html; charset=utf-8');
	$path="../../../../../";
	include("".$path."deppo/tools/script/cevir.php");
	$path2="config/"; include("".$path."config/map.php");
	include("".$path."deppo/tools/script/fonksiyon".$ver.".php");
	$sx=tanim("pay+paynkolay","n1",0); 
	$merchantSecretKey=tanim("pay+paynkolay","n2",0);
	foreach ($_POST as $key => $value){
		//echo $key; echo ":"; echo $value; echo "<br>";
	}
	$responseCode = $_POST['RESPONSE_CODE'];
	$referanceCode = $_POST['REFERENCE_CODE'];
	$ErrMsg = $_POST['BANK_MESSAGE'];
//	$ch = curl_init();
//	$arrData = array(
//	  "sx" => $sx,
//	  "referenceCode" => $REFERENCE_CODE
//	);
//	curl_setopt($ch, CURLOPT_URL,"https://paynkolaytest.nkolayislem.com.tr/Vpos/v1/CompletePayment");
//	curl_setopt($ch, CURLOPT_POST, 1);
//	curl_setopt($ch, CURLOPT_POSTFIELDS, $arrData);
//	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
//	$server_output = curl_exec($ch);
//	var_dump($server_output);
if($responseCode=="2"){
	echo "<script>window.location.href=\"".$_GET["burl"]."ok/".$referanceCode."\"</script>";
	//echo "Ödeme Islemi Basarili";
}else{
	echo "<script>window.location.href=\"".$_GET["burl"]."err/".base64_encode($ErrMsg)."\"</script>";
	//echo "Ödeme Islemi Basarisiz. Hata = ".$ErrMsg;
}
?>