rEfLeKs, вот ещё один нарыл
<?
session_start();
$_SESSION['login'] = 'dm';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "https://api.xsolla.com/merchant/merchants/13969/token"
;
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 30 );
curl_setopt($ch, CURLOPT_TIMEOUT,5 );
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC );
$username = "13969";
$password = "";
curl_setopt($curl, CURLOPT_USERPWD, $username . ":" . $password);
curl_setopt ($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt ($curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($curl, CURLOPT_HEADER, true);
curl_setopt($curl, CURLOPT_POST, true);
/*
{"user":{"id":{"value":"dm"}},"settings":{"project_id":"15123"}}
*/
$arr = array
(
"user" => array
(
"id" => array
(
"value" => $_SESSION['login']
)
),
"settings" => array
(
"project_id" => $_GET['id']
)
);
$params=json_encode($arr);
curl_setopt($curl, CURLOPT_POSTFIELDS, $params );
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type:application/json', 'Accept: application/json') );
$result=curl_exec ($curl);
curl_close ($curl);
print_r($result);
?>