rEfLeKs, скрипт такой же
<?
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.xsolla.com/merchant/merchants/28418/token');
$h = array("Content-Type: application/json"
curl_setopt($curl, CURLOPT_HTTPHEADER, $h);
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_USERPWD, '28418:Bzd4L4xY95I6xPdC');
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
curl_setopt($curl, CURLOPT_POST, true);
$json = array("user" => array("id" => array("value" => $user['id'])), "settings" => array("project_id" => 17545));
$json = json_encode($json);
curl_setopt($curl, CURLOPT_POSTFIELDS, $json);
$token = json_decode(curl_exec($curl))->token;
curl_close($curl);
?>
<li><a href="https://secure.xsola.com/paystation2/?access_token=<?=$toke?>"><img src="/images/icon/gold.png" alt="">Купить через XSOLLA</a></li></div>
<div class="block_outer center" style="margin:7px 4px 7px 4px;"><b>Купить золото</b></div>
Anred, угу , сейчас еще попробую
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);
?>