<?php
$bol = explode(' / ',$_POST["Card_Expiry"]); $ay=$bol[0]; $yil=$bol[1];
$shopCode 			= $rsb["n1"];  						//Banka tarafindan verilen isyeri numarasi
$purchaseAmount = sprice($_POST["Total"]);      //Islem tutari
$currency 				= "949"; 								// Kur Bilgisi - 949 TL
if($_POST["oid"]==""){
	$orderId="SID_".rand(1000,9999)."";
}else{
	$orderId = $_POST["oid"];      						//Siparis Numarasi
}
$okUrl 					= "".$_POST["aurl"]."/deppo/tools/vpos/denizbank/return.php?burl=".$_POST["burl"]."";      //Islem basariliysa dönülecek isyeri sayfasi  (3D isleminin ve ödeme isleminin sonucu)
$failUrl 					= "".$_POST["aurl"]."/deppo/tools/vpos/denizbank/return.php?burl=".$_POST["burl"]."";		//Islem basarisiz ise dönülecek isyeri sayfasi (3D isleminin ve ödeme isleminin sonucu)
$rnd 						= microtime();    					//Tarih veya her seferinde degisen bir deger güvenlik amaçli
if($_POST["Installment"]=="1"){
	$installmentCount="";
}else{
	$installmentCount = $_POST["Installment"];	//
}
$txnType 				= "Auth";    							//Islem tipi
$merchantPass 	= $rsb["n5"];  						//isyeri 3D anahtari
$hashstr = $shopCode . $orderId . $purchaseAmount . $okUrl . $failUrl .$txnType. $installmentCount  .$rnd . $merchantPass;
$hash = base64_encode(pack('H*',sha1($hashstr)));
?>
<body onload="document.PayForm.submit();">
            <form method="post" name="PayForm" action="https://spos.denizbank.com/mpi/default.aspx" style="display:none;">
                <table>
                    <tr>
                        <td>Kredi Kart Numarasi:</td>
                        <td><input type="text" name="Pan" size="20" value="<?php echo str_replace(' ','',$_POST["Card_Number"])?>"/>
                    </tr> 
                    <tr>
                        <td>Güvenlik Kodu:</td>
                        <td><input type="text" name="Cvv2" size="4" value="<?php echo $_POST["Card_Cvv"]?>"/></td>
                    </tr>
                    
                    <tr>
                        <td>Son Kullanma Tarihi (MMYY):</td>
                        <td><input type="text" name="Expiry" value="<?php echo $ay; echo substr($yil,-2);?>"/></td>
                    </tr>              
                    <tr>
                        <td>Visa/MC secimi</td>
                        <td>
						<select name="CardType">
                            <option value="0">Visa</option>
                            <option value="1">MasterCard</option>
                        </select>
                    </tr> 
                    <tr>
                        <td align="center" colspan="2">
                            <input type="submit" value="Gönder"/>
                        </td>
                    </tr> 
                </table>
                <input type="hidden" name="ShopCode" value="<?php  echo $shopCode ?>" />
                <input type="hidden" name="PurchAmount" value="<?php  echo $purchaseAmount ?>" />
                <input type="hidden" name="Currency" value="<?php  echo $currency ?>" />
                <input type="hidden" name="OrderId" value="<?php  echo $orderId ?>" />	
                <input type="hidden" name="OkUrl" value="<?php  echo $okUrl ?>" />
                <input type="hidden" name="FailUrl" value="<?php  echo $failUrl ?>" />
                <input type="hidden" name="Rnd" value="<?php  echo $rnd ?>" />
                <input type="hidden" name="Hash" value="<?php  echo $hash ?>" />
                <input type="hidden" name="TxnType" value="<?php  echo $txnType ?>" />
                <input type="hidden" name="InstallmentCount" value="<?php  echo $installmentCount ?>" />
                <input type="hidden" name="SecureType" value="3DPay" />
                <input type="hidden" name="Lang" value="tr" />
            </form>