sizlerden bir ricam olucak
eğer anlıyanınız varsa bu konuda yardımcı olabilirseniz sevinrim.
Benim sitenin kodları
<?php
//Bunlar fonksiyona gidecek değişkenler:
//API Kullanıcı Adı : xxxx
//API Şifre : sifre
//Üye İşyeri Numarası: isyerino
//Hedef Sunucu Adresi :https://vpos.est.com.tr/servlet/cc5ApiServer
if($_POST['gonder']){
$baglan=@mysql_connect("localhost","user","user") or die ("mysql_connect error sb");
$db_sec=@mysql_select_db("user",$baglan) or die ("Select database error sb");
$dilkod=mysql_query("SET NAMES 'latin5'");
if($_POST['s']=="1-S") $tutar=39;
if($_POST['s']=="6-S") $tutar=79;
if($_POST['s']=="12-S") $tutar=109;
if($_POST['s']=="1-G") $tutar=49;
if($_POST['s']=="6-G") $tutar=89;
if($_POST['s']=="12-G") $tutar=119;
$ApiName="apiname"; // Bankanın verdiği kullanıcı adı
$Password="apisifre"; // Bankanın verdiği parola
$ClientID="cliend"; // Bankanın verdiği istemci numarası
$rs=mysql_query("SHOW TABLE STATUS LIKE 'kredisatis'");
$rec = mysql_fetch_assoc($rs);
$OrderPreID=$rec['Auto_increment']; // Sipariş kodu, bu her sipariş için unique olmalı
// Eğer ilk seferde provizyon alınamazsa ikinci seferde
// sipariş numarası da değiştirilerek gönderilmelidir.
$CCNumber=$_POST['c1'].$_POST['c2'].$_POST['c3'].$_POST['c4']; // Kredi Kartı numarası
$CCMonth=$_POST['c5']; // Kart son kullanma tarihi ay
$CCYear=$_POST['c6']; // Kart son kullanma tarihi yıl
$Cvv2=$_POST['c7']; // Kart CVV2 kodu
$Total=$tutar; // Sipariş tutarı
$CCName=$_POST['adi']." ".$_POST['soyadi']; // Kart sahibinin adı
// Onay mesajı ve Hata Kodları, isterseniz bu kısımlara başka fonksiyonlar ekleyebilirsiniz.
// (Veritabanını güncelleme, yönlendirme vs...)
$Approved="Onay alındı";
$Error[0]="XML dosyası açılamadı";
$Error[1]="Bankadan yanıt alınamadı";
$Error[2]="Bankadan Onay alınamadı. Dönüş kodu: $ReturnCode";
$Error[3]="CURL çalıştırılamadı";
// Xml içeriğini parse etmek için gerekli fonksiyon
// PHP5'in kendi fonksiyonları var fakat bu hem PHP4 hem de PHP5 uyumlu.
function GetAttribute($XML,$Tag) {
$StartTag = "<".$Tag.">";
$EndTag = "</".$Tag.">";
$StartPosition = strpos($XML, $StartTag);
if ($StartPosition === false) {
return false;
}
$EndPosition = strpos($XML, $EndTag);
$EndPosition = $EndPosition+strlen($EndTag);
$Position = $EndPosition;
$EndPosition = $EndPosition-$StartPosition;
$EndPosition = $EndPosition - strlen($EndTag);
$Tag = substr ($XML, $StartPosition, $EndPosition);
$Tag = substr ($Tag, strlen($StartTag));
return $Tag;
}
// Ana fonksiyon bu:
// return fonksiyonu yerine kendi sisteminize adapte etmek için gerekli kodları yazabilirsiniz.
function EST_XML_Request($ApiName, $Password,$ClientID,$OrderPreID,$CCNumber,$CCMonth,$CCYear,$Cvv2,$Total,$CCName){
$URL = "https://vpos.est.com.tr/servlet/cc5ApiServer";
$XMLFile="request.xml";
$XMLContent=@fread(@fopen($XMLFile, r), @filesize($XMLFile));
if(!$XMLContent){
return $Error[0];
} else {
$XMLContent=str_replace("{APINAME}",$ApiName,$XMLContent);
$XMLContent=str_replace("{PASSWORD}",$Password,$XMLContent);
$XMLContent=str_replace("{CLIENTID}",$ClientID,$XMLContent);
$XMLContent=str_replace("{ORDERID}",$OrderPreID,$XMLContent) ;
$XMLContent=str_replace("{CCNUMBER}",$CCNumber,$XMLContent);
$XMLContent=str_replace("{CCMONTH}",$CCMonth,$XMLContent);
$XMLContent=str_replace("{CCYEAR}",$CCYear,$XMLContent);
$XMLContent=str_replace("{CVV2}",$Cvv2,$XMLContent);
$XMLContent=str_replace("{TOTAL}",$Total,$XMLContent);
$XMLContent=str_replace("{CCNAME}",$CCName,$XMLContent);
$Parameters = "DATA=".$XMLContent;
if($CurlHolder = curl_init()){
curl_setopt($CurlHolder, CURLOPT_URL,$URL); // Sanal Pos'a bağlanıyoruz
curl_setopt($CurlHolder, CURLOPT_SSL_VERIFYHOST,2); // SSL sertifikasındaki IP'yi kontrol ediyoruz
curl_setopt($CurlHolder, CURLOPT_RETURNTRANSFER,1); // Dönen sonucu ekrana yazdırmaması için 1 olmalı
curl_setopt($CurlHolder, CURLOPT_TIMEOUT, 30); // Zaman aşımı
curl_setopt($CurlHolder, CURLOPT_POSTFIELDS, $Parameters); // Veriyi gönderiyoruz.
$XMLResponse = curl_exec($CurlHolder); // Dönen sonucu değişkene aktarıyoruz
if(!$XMLResponse){
return $Error[1];
} else {
$ReturnCode = GetAttribute($XMLResponse,"ProcReturnCode"); // İşlem Kodu
$OrderID = GetAttribute($XMLResponse,"OrderId"); // Gönderdiğimiz sipariş kodu aynen geri dönmesi lazım
$Response = GetAttribute($XMLResponse,"Response"); // Sonuç
/////////////////////////
$aciklama=$Response;
$user_id=$_POST['user_id'];
$fldIslemTarih="d.m.Y";
$fldIslemSaat="H:i:s";
$satis_rumuz=$_SESSION['partner_kullanici'];
$sql="INSERT INTO kredisatis (user_id, rumuz, trankod, islem_no, batch_no, islem_tarih, islem_saat, retrrefno, provizyon, tutar, aciklama, site_kod) VALUES ('$user_id', '$satis_rumuz', '$FldTranKod', '$fldIslemNo', '$fldBatchNo', '$fldIslemTarih', '$fldIslemSaat', '$fldRetrRefNo', '$provizyon_kod', '$tutar', '$aciklama', '1')";
$kredisatis_ekle=mysql_query($sql) or die("$sql");
//////////////////////////
if($Response=="Approved" && $ReturnCode=="00"){
///ödeme başarılı
if($_POST['s'] and $_POST['user_id']){
$simdi=mktime(date("H"),date("i"),date("s"),date("m"),date("d"),date("Y"));
$sure_yetki=explode('-',$_POST['s']);
$yukseltilen_tarih=$simdi+(2592000*$sure_yetki[0]);
$user_id=$_POST['user_id'];
$bitis_tarih_update=mysql_query("update kullanici set bitis_tarih=$yukseltilen_tarih, yetki='$sure_yetki[1]' where kullanici_id='$user_id'") or die("hata");
//üyelik yükseltmenin ortaklık sistemine etkisi
$uye_ref_code=@mysql_result(mysql_query("select ref_code from kullanici where kullanici_id='$user_id'"),0,"ref_code");
if($uye_ref_code<>""){
if($sure_yetki[1]=="S") $yukselt_puan=1000; $yukselt_tur="SILVER";
if($sure_yetki[1]=="G") $yukselt_puan=1300; $yukselt_tur="GOLD";
$hit_ip=getenv("REMOTE_ADDR");
$hit_zaman=date("Y-m-d H:i:s");
$hit_tarih=date("Y-m-d");
$hit_ekle=mysql_query("INSERT INTO ortak_hit (hit_zaman, hit_tarih, hit_ip, hit_tur, ref_code, yaptigi_uye, hit_puan, hit_durum, hit_key) VALUES ('$hit_zaman', '$hit_tarih', '$hit_ip', '$yukselt_tur', '$uye_ref_code', '$user_id', '$yukselt_puan','1', '1')");
$u_id=@mysql_result(mysql_query("select kullanici_id from ortak where ref_code='$uye_ref_code'"),0,"kullanici_id");
$alacak=$yukselt_puan*0.01;
$hesap_aktar_sorgu=mysql_query("INSERT INTO ortak_hesap (islem_tarih, islem_zaman, borc, alacak, ortak_id) VALUES ('$hit_tarih','$hit_zaman', '0', '$alacak', '$u_id')") or die("hesap aktarma hatası");
$kullanici_ref_code_update=mysql_query("update kullanici set ref_code='' where kullanici_id='$user_id'");
}
if($bitis_tarih_update){
echo("<script>
alert('ödeme tamamlandı teşekkür ederiz');
window.open('http://www.siteadi.com/exit.php', 'zevkli');
window.close();
</script>");
}
}
///
//return $Approved;
} else {
return $Error[2];
}
}
} else {
return $Error[3];
}
}
}
// Fonksiyonu çağırıp sonucu ekrana yazdırıyoruz.
echo EST_XML_Request($ApiName,$Password,$ClientID,$OrderPreID,$CCNumber,$CCMonth,$CCYear,$Cvv2,$Total,$CCName);
mysql_close($baglan);
}
else{
?>
<form action="<?php echo($_SERVER['PHP_SELF']);?>" method="post" onSubmit="return formkontrol(this);">
<input type="hidden" name="user_id" value="<? echo $_GET['user_id']; ?>"/>
<table border="0" id="table1" cellspacing="0" cellpadding="0">
<tr>
<td width="750" background="img/bg_uyelikyukselt_ust.jpg" height="125" align="center"><p class="tit"><span style="font-size: 30pt; font-weight: 700">Kredi
Kartı İle Ödeme</span></p></td>
</tr>
<tr>
<td width="750"><table border="0" width="100%" id="table2" cellspacing="0" cellpadding="0">
<tr>
<td width="18"> </td>
<td width="350" valign="top"><table border="0" width="100%" id="table3" cellspacing="0" cellpadding="0">
<tr>
<td><img border="0" src="img/tit_uyeyuksel_silver.gif" width="350" height="37" /></td>
</tr>
<tr>
<td bgcolor="#F1F2F3"><table border="0" width="100%" id="table4" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
<tr>
<td><table border="0" width="100%" id="table83" cellspacing="0" cellpadding="0">
<tr>
<td width="20"> </td>
<td><table border="0" width="100%" id="table57" cellspacing="0" cellpadding="0">
<tr>
<td height="33"><table border="0" id="table58" cellspacing="0" cellpadding="0">
<tr>
<td width="16"><input name="s" type="radio" value="1-S" id="radio3" <? if($_GET['s']=="1-S") echo "checked"; ?> /></td>
<td width="7"> </td>
<td><p class="kimlik_nickname"><b>1
aylık üyelik</b> <font color="#0066FF"><b>(39
YTL)</b></font></p></td>
</tr>
</table></td>
</tr>
<tr>
<td height="33"><table border="0" id="table59" cellspacing="0" cellpadding="0">
<tr>
<td width="16"><input name="s" type="radio" value="3-S" id="radio4" <? if($_GET['s']=="3-S") echo "checked"; ?> /></td>
<td width="7"> </td>
<td><p class="kimlik_nickname"><b>6
aylık üyelik</b> <font color="#0066FF"><b>(79
YTL)</b></font></p></td>
</tr>
</table></td>
</tr>
<tr>
<td height="33"><table border="0" id="table60" cellspacing="0" cellpadding="0">
<tr>
<td width="16"><input name="s" type="radio" value="6-S" id="radio2" <? if($_GET['s']=="6-S") echo "checked"; ?> /></td>
<td width="7"> </td>
<td><p class="kimlik_nickname"><b>12
aylık üyelik</b> <font color="#0066FF"><b>(109
YTL)</b></font></p></td>
</tr>
</table></td>
</tr>
</table></td>
<td width="20"> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td><img border="0" src="img/tit_uyeyuksel_silver_kapa.gif" width="350" height="10" /></td>
</tr>
</table></td>
<td width="14" valign="top"> </td>
<td width="350" valign="top"><table border="0" width="100%" id="table7" cellspacing="0" cellpadding="0">
<tr>
<td><img border="0" src="img/tit_uyeyuksel_gold.gif" width="350" height="37" /></td>
</tr>
<tr>
<td bgcolor="#F8F6EA"><table border="0" width="100%" id="table8" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
<tr>
<td><table border="0" width="100%" id="table95" cellspacing="0" cellpadding="0">
<tr>
<td width="20"> </td>
<td><table border="0" width="100%" id="table69" cellspacing="0" cellpadding="0">
<tr>
<td height="33"><table border="0" id="table70" cellspacing="0" cellpadding="0">
<tr>
<td width="16"><input name="s" type="radio" value="1-G" id="radio6" <? if($_GET['s']=="1-G") echo "checked"; ?> /></td>
<td width="7"> </td>
<td><p class="kimlik_nickname"><b>1
aylık üyelik</b> <font color="#F77E30"><b>(49
YTL)</b></font></p></td>
</tr>
</table></td>
</tr>
<tr>
<td height="33"><table border="0" id="table71" cellspacing="0" cellpadding="0">
<tr>
<td width="16"><input name="s" type="radio" value="3-G" id="radio7" <? if($_GET['s']=="3-G") echo "checked"; ?> /></td>
<td width="7"> </td>
<td><p class="kimlik_nickname"><b>6
aylık üyelik</b> <font color="#F77E30"><b>(89
YTL)</b></font></p></td>
</tr>
</table></td>
</tr>
<tr>
<td height="33"><table border="0" id="table72" cellspacing="0" cellpadding="0">
<tr>
<td width="16"><input name="s" type="radio" value="6-G" id="radio8" <? if($_GET['s']=="6-G") echo "checked"; ?> /></td>
<td width="7"> </td>
<td><p class="kimlik_nickname"><b>12 aylık üyelik</b> <font color="#F77E30"><b>(119
YTL)</b></font></p></td>
</tr>
</table></td>
</tr>
</table></td>
<td width="20"> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td><img border="0" src="img/tit_uyeyuksel_gold_kapa.gif" width="350" height="10" /></td>
</tr>
</table></td>
<td width="18"> </td>
</tr>
<tr>
<td width="18" height="22"> </td>
<td width="350" valign="top" height="22"> </td>
<td width="14" valign="top" height="22"> </td>
<td width="350" valign="top" height="22"> </td>
<td width="18" height="22"> </td>
</tr>
<tr>
<td width="18"> </td>
<td width="350" valign="top" align="right"><table border="0" id="table111" cellspacing="0" cellpadding="0">
<tr>
<td><img border="0" src="img/kk.jpg" width="171" height="187" /></td>
<td width="15"> </td>
</tr>
</table></td>
<td width="14" valign="top"> </td>
<td width="350" valign="top"><table border="0" width="100%" id="table102" cellspacing="0" cellpadding="0">
<tr>
<td height="28"><table border="0" id="table103" cellspacing="0" cellpadding="0">
<tr>
<td width="100" height="28"><p class="btn02">Adınız *</p></td>
<td><input name="adi" type="text" id="adi" style="font-family: Trebuchet MS; font-size: 10pt; color: #CE49A9; border: 1px solid #CCCCCC; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px" size="34" /></td>
</tr>
</table></td>
</tr>
<tr>
<td height="28"><table border="0" id="table104" cellspacing="0" cellpadding="0">
<tr>
<td width="100" height="28"><p class="btn02">Soyadınız *</p></td>
<td><input name="soyadi" type="text" id="soyadi" style="font-family: Trebuchet MS; font-size: 10pt; color: #CE49A9; border: 1px solid #CCCCCC; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px" size="34" /></td>
</tr>
</table></td>
</tr>
<tr>
<td height="28"><table border="0" id="table105" cellspacing="0" cellpadding="0">
<tr>
<td width="100" height="28"><p class="btn02">Kart No *</p></td>
<td><table border="0" width="100%" id="table110" cellspacing="0" cellpadding="0">
<tr>
<td><input name="c1" type="text" id="c1" style="font-family: Trebuchet MS; font-size: 10pt; color: #CE49A9; border: 1px solid #CCCCCC; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px" size="5" maxlength="4" /></td>
<td width="10"> </td>
<td><input name="c2" type="text" id="c2" style="font-family: Trebuchet MS; font-size: 10pt; color: #CE49A9; border: 1px solid #CCCCCC; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px" size="5" maxlength="4" /></td>
<td width="10"> </td>
<td><input name="c3" type="text" id="c3" style="font-family: Trebuchet MS; font-size: 10pt; color: #CE49A9; border: 1px solid #CCCCCC; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px" size="5" maxlength="4" /></td>
<td width="10"> </td>
<td><input name="c4" type="text" id="c4" style="font-family: Trebuchet MS; font-size: 10pt; color: #CE49A9; border: 1px solid #CCCCCC; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px" size="5" maxlength="4" /></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td height="28"><table border="0" id="table106" cellspacing="0" cellpadding="0">
<tr>
<td width="100" height="28"><p class="btn02">Son. Kul. Tar.*</p></td>
<td><table border="0" id="table109" cellspacing="0" cellpadding="0">
<tr>
<td><span style="border-left-style:none; border-left-width:medium; border-top-style:none; border-top-width:medium; border-bottom-style:none; border-bottom-width:medium; padding-left:5; padding-right:5; padding-top:0; padding-bottom:0">
<select name="c5" class="ari9_gri" id="c5" style="font-family: Trebuchet MS; font-size: 10pt; color: #616161; border: 1px solid #CCCCCC; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px">
<option value="01">01</option>
<option value="02">02</option>
<option value="03">03</option>
<option value="04">04</option>
<option value="05">05</option>
<option value="06">06</option>
<option value="07">07</option>
<option value="08">08</option>
<option value="09">09</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select>
<select name="c6" class="ari9_gri" id="select2" style="font-family: Trebuchet MS; font-size: 10pt; color: #616161; border: 1px solid #CCCCCC; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px">
<option value="07">2007</option>
<option value="08">2008</option>
<option value="09">2009</option>
<option value="10">2010</option>
<option value="11">2011</option>
<option value="12">2012</option>
<option value="13">2013</option>
<option value="14">2014</option>
</select>
</span></td>
<td width="12"> </td>
<td><p class="btn02"></p></td>
<td width="10"> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td height="28"><table border="0" id="table107" cellspacing="0" cellpadding="0">
<tr>
<td width="100" height="28"><p class="btn02">CVC No *</p></td>
<td><input name="c7" type="text" id="c7" style="font-family: Trebuchet MS; font-size: 10pt; color: #CE49A9; border: 1px solid #CCCCCC; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px" size="5" /></td>
</tr>
</table></td>
</tr>
<tr>
<td height="8"><p class="cins_cift"></p></td>
</tr>
<tr>
<td height="28"><table border="0" id="table108" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td width="100" height="28"><p class="btn02"></p></td>
<td align="right"><p class="btn02">
<input name="gonder" type="submit" id="gonder" value="::::: ÖDEMEYİ YAP ::::::" />
</p></td>
</tr>
</table></td>
</tr>
</table></td>
<td width="18"> </td>
</tr>
<tr>
<td width="18"> </td>
<td width="350" valign="top"><p class="btn02 style1"> Güzenlik ve Gizlilik Prensiplerimiz</p></td>
<td width="14" valign="top"> </td>
<td width="350" valign="top"> </td>
<td width="18"> </td>
</tr>
</table></td>
</tr>
<tr>
<td width="750"><table border="0" width="100%" id="table9" cellspacing="0" cellpadding="0">
<tr>
<td width="18"> </td>
<td><ul>
<li>
<div align="justify"><font class="btn02 style1">Kredi kartı numaranız, en yüksek güvenlikli sayfalarda, 128 bit şifrelenmiş olarak alınır</font></div>
</li>
<li>
<div align="justify"><font class="btn02 style1">Kredi kartı bilgileriniz kesinlike sistem veritabanında ( kayıtlarında ) tutulmaz .Girmiş olduğunuz kredi kartı bilgileri doğrudan bankaya gönderilir.</font></div>
</li>
<li>
<div align="justify"><font class="btn02 style1">Üyeliğiniz bittikten sonra sizden habersiz , sizin onayınız olmadan hiç bir şekilde kredi kartınızdan para çekilip üyeliğiniz uzatılmaz.</font></div>
</li>
<li>
<div align="justify"><font class="btn02 style1">Kredi kartı bilgilerinizi sadece site üzerinde doldurduğunuz ödeme formunda kullanınız. Başka hiç bir yoldan (telefon, e-posta, faks, vb.) kredi kartı bilgileriniz tarafımızca istenilmeyecektir.</font></div>
</li>
<li>
<div align="justify"><font class="btn02 style1">Formu doldurduktan sonra sadece 1 kere gönder butonuna tıklayınız.</font></div>
</li>
<li>
<div align="justify"><font class="btn02 style1">Dikkat : Üyelik satışlarımız kesindir.Üyelik iptali yalnızca site yönetimi'nin takdirine kalmıştır.</font></div>
</li>
</ul></td>
<td width="18"> </td>
</tr>
</table></td>
</tr>
</table>
</form>
<?
}
?>Yukarıdaki kodlar Benim satış sayfasının kodları
aşağıdakilerde örnek firma tarafından verilen kodlar