<?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");
$bol = explode(' / ',$_POST["Card_Expiry"]); $ay=$bol[0]; $yil=$bol[1];
$pkadi=tanim("pay+paratika","n1",0);
$psifr=tanim("pay+paratika","n2",0);
$pkod=tanim("pay+paratika","n3",0);
$url = 'https://vpos.paratika.com.tr/paratika/api/v2';
$data = array(
     'ACTION' => 'QUERYBIN',
     'MERCHANT' => $pkod,
     'MERCHANTUSER' => $pkadi,
     'MERCHANTPASSWORD' => $psifr,
     'BIN' => "554960"
);
$options = array(
    'http' => array(
        'header' => "Content-type: application/x-www-form-urlencoded\r\n",
        'method' => 'POST',
        'content' => http_build_query($data)
    )
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result === FALSE) {
    echo "An error occured!";
}
//echo http_build_query($data);
//var_dump(json_decode($result));
$resultObject = json_decode($result);
$sessionToken=$resultObject->{'sessionToken'};
//echo "Error Code:" . $resultObject->{'errorCode'} . "<br>";
//echo "Error Message: " . $resultObject->{'errorMsg'} . "<br>";
Print_r($resultObject);
echo $resultObject->{'bin'}->{'cardNetwork'};
?>