示例#1
0
 /**
  * @param Response\Response $response
  */
 private function setSuccess($response)
 {
     $response->setSuccess($response->getHttpStatusCode() === 200);
     if ($response->getSuccess() === false) {
         $response->setApiError($response->getApiResponse('error')['message']);
     }
 }
示例#2
0
 /**
  * @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);
     }
 }
示例#3
0
 /**
  * @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);
     }
 }
示例#4
0
 private function setSuccess(Response\Response $response, $success)
 {
     $response->setSuccess($success);
     if ($response->getSuccess() === false) {
         $response->setApiError($response->getApiResponse('StatusMsg'));
     }
 }
示例#5
0
 /**
  * @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);
 }
示例#6
0
 /**
  * @param Response\Response $response
  */
 private function setSuccess($response)
 {
     $response->setSuccess($response->getApiResponse('Complete') === 'true' && (int) $response->getApiResponse('ResponseCode') < 50);
 }