original_string: public function buildUrl($apiEndPoint)
      {
          if (is_null($this->request['url'])) {
              return $apiEndPoint . '/' . $this->uri . ($this->queryStr ? '?' . http_build_query($this->queryStr) : '');
          }
          if (strpos($this->url, $apiEndPoint) !== 0) {
              throw new PaysafeException('Unexpected endpoint in url: ' . $this->url . ' expected: ' . $apiEndPoint);
          }
          return $this->url;
      }
code: public function buildUrl($apiEndPoint)
      {
          if (is_null($this->request['url'])) {
              return $apiEndPoint . '/' . $this->uri . ($this->queryStr ? '?' . http_build_query($this->queryStr) : '');
          }
          if (strpos($this->url, $apiEndPoint) !== 0) {
              throw new PaysafeException('Unexpected endpoint in url: ' . $this->url . ' expected: ' . $apiEndPoint);
          }
          return $this->url;
      }
code_tokens: public function buildUrl ( $ apiEndPoint ) { if ( is_null ( $ this -> request [ 'url' ] ) ) { return $ apiEndPoint . '/' . $ this -> uri . ( $ this -> queryStr ? '?' . http_build_query ( $ this -> queryStr ) : '' ) ; } if ( strpos ( $ this -> url , $ apiEndPoint ) !== 0 ) { throw new PaysafeException ( 'Unexpected endpoint in url: ' . $ this -> url . ' expected: ' . $ apiEndPoint ) ; } return $ this -> url ; }
docstring: Build url for the paysafe api client.
  
  @param string $apiEndPoint
  @return string
  @throws PaysafeException if the url has been set, and does not match the endpoint.
docstring_tokens: Build url for the paysafe api client .