Добрый вечер столкнулся с проблемой вывода токенов xsolla
кто знает в чем дело (токен пустой)
[cit]<?php
$DR = $_SERVER['DOCUMENT_ROOT'];
$_includ = array ('common','functions','user');
foreach ($_includ as $includ)
{
$includs = $DR.'/system/'.$includ.'.php';
include_once $includs;
}
$foot = $DR.'/system/f.php';
$head = $DR.'/system/h.php';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.xsolla.com/merchant/merchants/23330/token');
$h = array("Accept: application/json","Content-Type:application/json"
;
curl_setopt($curl, CURLOPT_HTTPHEADER, $h);
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_USERPWD, '23330:7E3h4UbtGtTAKS5E');
$json = array("user" => array("id" => array("value" => $user['id'],"hidden" => true)),
"settings" => array("project_id" => 16541),
);
$zapr = json_encode($json);
curl_setopt($curl, CURLOPT_POSTFIELDS, $zapr);
$out = curl_exec($curl);
curl_close($curl);
$f = json_decode($out);[/cit]
echo $f->token; //token null - ?
?>