/** * @param Response\Response $response */ private function setSuccess($response) { $response->setSuccess($response->getHttpStatusCode() === 200); if ($response->getSuccess() === false) { $response->setApiError($response->getApiResponse('error')['message']); } }
/** * @param Response\Response $response * @param $success */ private function setSuccess(Response\Response $response, $success) { $response->setSuccess($success); if ($response->getSuccess() === false) { $message = $response->getApiResponse('TextResponse') ?: 'Unknown Error'; $response->setApiError($message); } }
/** * @param Response\Response $response */ private function setSuccess($response) { $response->setSuccess($response->getHttpStatusCode() === 200); if ($response->getSuccess() === false) { $message = $response->getApiResponse('message'); if ($message == null) { $message = $response->getHttpStatusCode(); } $response->setApiError($message); } }
private function setSuccess(Response\Response $response, $success) { $response->setSuccess($success); if ($response->getSuccess() === false) { $response->setApiError($response->getApiResponse('StatusMsg')); } }
/** * @param Response\Response $response * @param string $method * @param callable $success * @param callable $failure */ protected function execute(Response\Response $response, $method, callable $success, callable $failure) { $response->execute([$this, sprintf('%sResponse', $method)], $success, $failure); }
/** * @param Response\Response $response */ private function setSuccess($response) { $response->setSuccess($response->getApiResponse('Complete') === 'true' && (int) $response->getApiResponse('ResponseCode') < 50); }