Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titleПример кода
Code Block
languagephp
<?php
declare(strict_types=1);

$curl = curl_init();

// ---------- ПЕРЕМЕННЫЕ
$client_request_id = '0.13740000 1615280116'; 
$api_key = 'PL-111111'; 
$api_password = 'bf2a05b80dd649bdb365fe2d242e4cd8'; 

curl_setopt_array (($curl, [
    CURLOPT_URL => 'https://sign.platon.ua/api/v1/smart-id/status',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => 'utf-8',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => [
        'action' => 'GET_SMART_ID_STATUS',
        'client_key' =>PL-7306844',> $api_key,
        'client_request_id' => '202007-0912-5634',$client_request_id,
        'hash' => '********************************',
)md5(strtoupper(strrev($api_password).strrev($client_request_id))),
    ],
]);

$response = curl_exec($curl);

if (! $response) {
    echo "Error --> ".curl_error($curl)."\n";
}

curl_close($curl);
echo "Success --> \n";
var_dump(json_decode($response));

...

Синхронный ответ

Expand
Code Block
["action"]=>"GET_SMART_ID_STATUS" 
["client_request_id"]=>"0.92410500 1615368966" 
["result"]=>"ACCEPTED" 
["status"]=>"SUCCESS"

...