Mistake:
Warning: json_decode () expects parameter 1 to be string
Code:
$res = json_decode($curl->post('https://auth.qiwi.com/cas/tgts', json_encode(array( 'login' => '+79999999999', 'password' => '123123' )))); $TgtTicket = $res->entity->ticket; echo $TgtTicket; Which essentially returns $ curl-> post ...:
stdClass Object ( [entity] => stdClass Object ( [user] => +79139962423 [ticket] => TGT-391357-QO7amrRgf2kOPxhhxWdo9FZUrdIZhJLCIOQHbk6jMEjfLuSePg ) [links] => Array ( [0] => stdClass Object ( [rel] => sts [href] => https://auth.qiwi.com/cas/sts ) ) ) But json_decode cannot somehow decode it, although everything seems to be correct.
$curl- what is this object? What library / CMF do you use? - tutankhamun$curl->post()gives you astdClass Object. Andjson_decode()expects an input string. - koks_rs