shell
окружении c curl
EMAIL=email@example.ru
NAME=Name
PHONE=+79xxxxxxxxxx
curl -X POST -H "Content-Type: application/json; charset=UTF-8" https://proverkacheka.nalog.ru:9999/v1/mobile/users/signup -d "{\"email\":\"$EMAIL\", \"name\": \"$NAME\", \"phone\": \"$PHONE\"}" -i
PHONE=+79xxxxxxxxxx
PASS=555xxx
FN=87100001017610xx
FDP=41709130xx
FD=128xx
DERVICEID=curl
DEVICEOS=linux
curl -H "Device-Id: $DERVICEID" -H "Device-OS: $DEVICEOS" "https://$PHONE:$PASS@proverkacheka.nalog.ru:9999/v1/inns/*/kkts/*/fss/$FN/tickets/$FD?fiscalSign=$FDP&sendToEmail=no" -i
curl_setopt($ch, CURLOPT_USERPWD, "8(800)555-35-35" . ":" . "554400");
$base = "https://proverkacheka.nalog.ru:9999";
$derviceId = uniqid();
$deviceOS = "Android 4.4.4";
$protocol = "2";
$clientVersion = "1.4.1.3";
$userAgent = "okhttp/3.0.1";
$fn = $_GET["fn"];
$fd = $_GET["fd"];
$fs = $_GET["fs"];
$query = http_build_query([
'fiscalSign' => $fs,
'sendToEmail' => "no"
]);
$ch = curl_init("$base/v1/inns/*/kkts/*/fss/$fn/tickets/$fd?".$query);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Device-Id: $derviceId",
"Device-OS: $deviceOS",
"Version: $protocol",
"ClientVersion: $clientVersion",
"ClientVersion: $clientVersion",
]);
curl_setopt($ch, CURLOPT_USERPWD, "8(800)555-35-35" . ":" . "554400");
$result = curl_exec($ch);
$json = json_decode($result);
var_dump($json);
function curlRequest($url)
{
$myCurl = curl_init();
curl_setopt_array($myCurl, array(
CURLOPT_URL => $url,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_RETURNTRANSFER => true,
));
$response = curl_exec($myCurl);
curl_close($myCurl);
return $response;
}
$url = 'http://www.cbr-xml-daily.ru/daily_json.js';
$contents = curlRequest($url);
$data = json_decode($contents, true);
var_dump($data);