public function checkResponse($response) {
    if (!is_array($response)) {
      return FALSE;
    }

    $responseParams = array();
    foreach ($this->responseFields as $k => $mandatory) {
      if (isset($response[$k])) {
        $responseParams[$k] = $response[$k];
      }
      elseif (!isset($response[$k]) && $mandatory) {
        throw new \Exception('expected response field ' . $k . ' is missing');
      }
    }

    return $responseParams;
  }
public function checkResponse($response) {
    if (!is_array($response)) {
      return FALSE;
    }

    $responseParams = array();
    foreach ($this->responseFields as $k => $mandatory) {
      if (isset($response[$k])) {
        $responseParams[$k] = $response[$k];
      }
      elseif (!isset($response[$k]) && $mandatory) {
        throw new \Exception('expected response field ' . $k . ' is missing');
      }
    }

    return $responseParams;
  }
public function checkResponse ( $ response ) { if ( ! is_array ( $ response ) ) { return FALSE ; } $ responseParams = array ( ) ; foreach ( $ this -> responseFields as $ k => $ mandatory ) { if ( isset ( $ response [ $ k ] ) ) { $ responseParams [ $ k ] = $ response [ $ k ] ; } elseif ( ! isset ( $ response [ $ k ] ) && $ mandatory ) { throw new \ Exception ( 'expected response field ' . $ k . ' is missing' ) ; } } return $ responseParams ; }
Returns all response param fields in the correct order.

@param mixed $response
@return mixed|boolean $responseParams
@throws \Exception if one of the mandatory fields is not set
Returns all response param fields in the correct order .