Fixes
This commit is contained in:
parent
f5014fa180
commit
5539640080
|
@ -50,23 +50,26 @@ class Adonis {
|
|||
curl_setopt($req, CURLOPT_HTTPHEADER, $headers);
|
||||
curl_setopt($req, CURLOPT_POST, true);
|
||||
curl_setopt($req, CURLOPT_POSTFIELDS, $req_data);
|
||||
curl_setopt($req, CURLOPT_RETURNTRANSFER, true);
|
||||
|
||||
$res_raw = curl_exec($req);
|
||||
curl_close($req);
|
||||
|
||||
$res = json_decode($res_raw);
|
||||
$res = json_decode($res_raw, true);
|
||||
|
||||
if ($extract_response == true) {
|
||||
$res = $res[$endpoint . "Result"];
|
||||
}
|
||||
|
||||
if ($res["Authentication_Approved"] != true) {
|
||||
if ($res["Authentication_Approved"] != 1) {
|
||||
throw new AdonisAuthenticationDeniedException();
|
||||
}
|
||||
|
||||
if ($res["ErrorText"]) {
|
||||
throw new AdonisException($res["ErrorText"]);
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
function getToken($api) {
|
||||
|
@ -156,4 +159,4 @@ class Adonis {
|
|||
return $requirements;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue