Skip to content

Commit 990825e

Browse files
authored
Merge pull request #42 from PhillippOhlandt/new-task-response-fields
New task response fields
2 parents e318137 + 22e158f commit 990825e

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

figo/Connection.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public function obtain_access_token($authorization_code_or_refresh_token, $scope
192192
} else {
193193
throw new Exception("invalid_token", "invalid code/token");
194194
}
195-
return $this->query_api("/auth/token", $data);
195+
return $this->query_api("/auth/token", $data, "POST", "json_encode");
196196
}
197197

198198
/**
@@ -206,7 +206,7 @@ public function obtain_access_token($authorization_code_or_refresh_token, $scope
206206
*/
207207
public function native_client_login($username, $password, $scope = null) {
208208
$data = array("grant_type" => "password", "username" => $username, "password" => $password, "scope" => $scope);
209-
return $this->query_api("/auth/token", $data);
209+
return $this->query_api("/auth/token", $data, "POST", "json_encode");
210210
}
211211

212212

@@ -219,7 +219,7 @@ public function native_client_login($username, $password, $scope = null) {
219219
*/
220220
public function revoke_token($refresh_token_or_access_token) {
221221
$data = array("token" => $refresh_token_or_access_token);
222-
$this->query_api("/auth/revoke?".http_build_query($data));
222+
$this->query_api("/auth/revoke", $data, "POST", "json_encode");
223223
}
224224

225225
/**
@@ -271,7 +271,7 @@ public function create_process(Process $process) {
271271
*/
272272
public function create_user($name, $email, $password, $language='de') {
273273
$data = array('name' => $name, 'email' => $email, 'password' => $password, 'language' => $language, 'affiliate_client_id' => $this->client_id);
274-
$response = $this->query_api("/auth/user", $data);
274+
$response = $this->query_api("/auth/user", $data, "POST", "json_encode");
275275
return $response["recovery_password"];
276276
}
277277

@@ -297,7 +297,7 @@ public function credential_login($username, $password, $device_name = null, $dev
297297
$options["device_udid"] = $device_udid;
298298
if ($scope)
299299
$options["scope"] = $scope;
300-
return $this->query_api("/auth/token", $options, "POST");
300+
return $this->query_api("/auth/token", $options, "POST", "json_encode");
301301
}
302302

303303

figo/HttpsRequest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ public function request($path, $data, $method, array $headers, $language = 'de')
156156
throw new Exception("service_unavailable", "Exceeded rate limit.");
157157
}
158158

159+
$this->logFailedRequest($path, $responseArray, $loggingData);
159160
throw new Exception("internal_server_error", "We are very sorry, but something went wrong.");
160161

161162
}

figo/Task.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ class Task extends Base {
5252
/** @var float Monetary value in account currency */
5353
public $challenge;
5454

55+
/** @var array Events */
56+
public $events;
57+
58+
/** @var array Schedule */
59+
public $schedule;
5560
}
5661

57-
?>
62+
?>

0 commit comments

Comments
 (0)