<?php
require_once('../IyzipayBootstrap.php');
require_once('config.php');
# create request class
$request = new \Iyzipay\Request\CreateThreedsPaymentRequest();
$request->setLocale(\Iyzipay\Model\Locale::TR);
$request->setConversationId($_SESSION["Order_No"]);
$request->setPaymentId($_POST["paymentId"]);
$request->setConversationData($_POST["conversationData"]);
# make request
$threedsPayment = \Iyzipay\Model\ThreedsPayment::create($request, Config::options());
# print result
//print_r($threedsPayment);
if ($threedsPayment->getStatus()=="success"){
	echo "<script>window.location.href='".$_GET["burl"]."ok/".$_POST["paymentId"]."'</script>"; 
}else{
	echo "<script>window.location.href='".$_GET["burl"]."err/".$threedsPayment->geterrorCode()."'</script>"; 	
}