array('project_id' => 22901)); $data = array( "user" => array( "country" => array( "value" => "US" ) ), "settings" => array( "project_id" => $id, "language" => "en", "currency" => "USD", "ui" => array( "size" => "medium" ) ), "purchase" => array( "pin_codes" => array( "codes" => array( array( "digital_content" => $code ) ) ) )); $payload = json_encode($data); $options = array( //CURLOPT_CUSTOMREQUEST =>"POST", //set request type post or get CURLOPT_POST => true, //set to GET CURLOPT_POSTFIELDS => $payload, CURLOPT_RETURNTRANSFER => true, // return web page CURLOPT_HEADER => false, // don't return headers CURLOPT_FOLLOWLOCATION => true, // follow redirects CURLOPT_ENCODING => "", // handle all encodings CURLOPT_AUTOREFERER => true, // set referer on redirect CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect CURLOPT_TIMEOUT => 120, // timeout on response CURLOPT_MAXREDIRS => 10, // stop after 10 redirects CURLOPT_USERPWD => "35537:axti13RkDsyxVOQW", CURLOPT_HTTPHEADER => array('Content-type: application/json') ); $ch = curl_init( "https://api.xsolla.com/merchant/merchants/35537/token" ); curl_setopt_array( $ch, $options ); $content = curl_exec( $ch ); $err = curl_errno( $ch ); $errmsg = curl_error( $ch ); $header = curl_getinfo( $ch ); curl_close( $ch ); return $content; } $result = json_decode(get_web_page( 21509,"hof" )); $tokenHof = $result->token; $result = json_decode(get_web_page( 21606,"HoFWildcardsDLC" )); $tokenDlc = $result->token; $result = json_decode(get_web_page( 23799,"hof2" )); $tokenHof2 = $result->token; ?> Defiant Development - Shop