<?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");
	$sql = mysqli_query($conn, "select * from genel where ne='banka' and s1=".$_SESSION["Order_Bank_Id"]." and s2=1"); $rsb = mysqli_fetch_assoc($sql);
?>
<body onload="javascript:moveWindow()">
	<form name="pay_form" method="post" action="<?php echo $rsb["n6"]?>">
		<?php
			$postParams = array();
			foreach ($_POST as $key => $value){
				array_push($postParams, $key);
				echo "<input type=\"hidden\" name=\"" .$key ."\" value=\"" .$value."\" /><br />";
			}
			
			natcasesort($postParams);		
			
			$hashval = "";					
			foreach ($postParams as $param){				
				$paramValue = $_POST[$param];
				$escapedParamValue = str_replace("|", "\\|", str_replace("\\", "\\\\", $paramValue));	
					
				$lowerParam = strtolower($param);
				if($lowerParam != "hash" && $lowerParam != "encoding" )	{
					$hashval = $hashval . $escapedParamValue . "|";
				}
			}
			
			$storeKey = $rsb["n5"];
			$escapedStoreKey = str_replace("|", "\\|", str_replace("\\", "\\\\", $storeKey));	
			$hashval = $hashval . $escapedStoreKey;
			
			$calculatedHashValue = hash('sha512', $hashval);  
			$hash = base64_encode (pack('H*',$calculatedHashValue));
			
			echo "<input type=\"hidden\" name=\"HASH\" value=\"" .$hash."\" /><br />";			
		
		?>
	</form>
	
	  <script type="text/javascript" language="javascript">
        function moveWindow() {
           document.pay_form.submit();
        }
    </script>
</body>