-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathkk-odeme-sonuc.php
55 lines (43 loc) · 1.42 KB
/
kk-odeme-sonuc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
@session_start();
@ob_start();
define("DATA", "data/");
define("SAYFA", "include/");
define("SINIF", "admin/class/");
include_once(DATA . "baglanti.php");
define("SITE", $siteurl);
/***********************************************/
include_once('IyzipayBootstrap.php');
IyzipayBootstrap::init();
class Config
{
public static function options()
{
$options = new \Iyzipay\Options();
$options->setApiKey("iyzico api key buraya girilecek");
$options->setSecretKey("iyzico secret key buraya girilecek");
$options->setBaseUrl("https://sandbox-api.iyzipay.com"); /* Base url demo ödeme altyapısı için verilen url'dir. */
return $options;
}
}
$siparisKodu="";
$token=$_POST['token'];
$siparis_no=$_SESSION["siparisKodu"];
$request = new \Iyzipay\Request\RetrieveCheckoutFormRequest();
$request->setLocale(\Iyzipay\Model\Locale::TR);
$request->setConversationId("$siparis_no");
$request->setToken("$token");
$checkoutForm = \Iyzipay\Model\CheckoutForm::retrieve($request, Config::options());
//print_r($checkoutForm->getStatus());
echo $odeme_durum=$checkoutForm->getPaymentStatus();
echo "<br>";
$islem_no=$checkoutForm->getpaymentId();
if ($odeme_durum=="FAILURE") {
echo "Başarısız Ödeme...";
} elseif ($odeme_durum=="SUCCESS") {
?>
<meta http-equiv="refresh" content="0;url=<?=SITE?>kk-kayit">
<?php
/*echo "Başarılı Ödeme işlem numaranız :".$islem_no;*/
}
?>