Skip to content

Commit

Permalink
Handle response 204 status code (patch order)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nakahiru committed Jan 9, 2020
1 parent 6f48327 commit dc9658d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions classes/Handler/Response/ResponseApiHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ public function handleResponse(ResponseInterface $response)
*/
private function responseIsSuccessful($responseContents, $httpStatusCode)
{
// Directly return true, no need to check the body for a 204 status code
// 204 status code is only send by /payments/order/update
if ($httpStatusCode === 204) {
return true;
}

return substr((string) $httpStatusCode, 0, 1) === '2' && $responseContents !== null;
}
}

0 comments on commit dc9658d

Please sign in to comment.