$ch=curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.paytr.com/odeme/api/get-token");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1) ;
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_vals);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
    curl_setopt($ch, CURLOPT_TIMEOUT, 20);
$result = @curl_exec($ch);

echo "giden<pre>";print_r( $result); echo "</pre>";die();

if(curl_errno($ch))
die("PAYTR IFRAME connection error. err:".curl_error($ch));

curl_close($ch);

$result=json_decode($result,1);

if($result['status']=='success')
$token=$result['token'];
    else
die("PAYTR IFRAME failed. reason:".$result['reason']);
bu kodu dener misin