Ejemplo n.º 1
0
 /**
  * @param string $call
  */
 private function _request($call, array $params)
 {
     $params['bb_version'] = Box_Version::VERSION;
     $url = $this->_url . $call . '?' . http_build_query($params);
     $curl = new Box_Curl($url, 5);
     $curl->request();
     $response = $curl->getBody();
     $json = json_decode($response, 1);
     if (is_null($json)) {
         throw new \Box_Exception('Unable to connect to BoxBilling extensions site.', null, 1545);
     }
     if (isset($json['error']) && is_array($json['error'])) {
         throw new Exception($json['error']['message'], 746);
     }
     return $json['result'];
 }
Ejemplo n.º 2
0
 public function getJson()
 {
     $url = $this->_url . '?current=' . Box_Version::VERSION;
     $curl = new Box_Curl($url);
     $curl->request();
     $response = $curl->getBody();
     return json_decode($response);
 }