Skip to content

Commit

Permalink
Merge pull request #251 from v4lux/fix/patch-order
Browse files Browse the repository at this point in the history
Handle response 204 status code (patch order)
  • Loading branch information
Nakahiru authored Jan 9, 2020
2 parents 6f48327 + dc9658d commit 15a5463
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 15a5463

Please sign in to comment.