public function getClient()
 {
     if (!$this->client) {
         $this->client = IntercomBasicAuthClient::factory(array('app_id' => $this->getAppId(), 'api_key' => $this->getApiKey()));
     }
     return $this->client;
 }
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $config = $serviceLocator->get('config');
     $config = $config['zend-intercom'];
     $intercom = IntercomBasicAuthClient::factory(array('app_id' => $config['app_id'], 'api_key' => $config['api_key']));
     return $intercom;
 }
示例#3
0
 /**
  * initializing the app
  *
  * @return [type] [description]
  */
 public function init($type)
 {
     try {
         $this->spy = IntercomBasicAuthClient::factory(array('app_id' => Config::get("spy::integrations.{$type}.app_id"), 'api_key' => Config::get("spy::integrations.{$type}.api_key")));
         return $this;
     } catch (IntercomException\ClientErrorResponseException $e) {
         $this->handleError($e);
     } catch (IntercomException\ServerErrorResponseException $e) {
         $this->handleError($e);
     } catch (Exception $e) {
         $this->handleError($e);
     }
 }
示例#4
0
 public function setUp()
 {
     $this->client = IntercomBasicAuthClient::factory(['api_key' => '1234', 'app_id' => 'my-app']);
 }
 /**
  * @expectedException \Guzzle\Common\Exception\InvalidArgumentException
  */
 public function testFactoryMissingArgs()
 {
     IntercomBasicAuthClient::factory(['app_id' => 'my-app']);
 }
 private static function createInstance()
 {
     return IntercomBasicAuthClient::factory(array('app_id' => 'nch9zmp2', 'api_key' => '6bbdd3f52e8cdd508cc98d6fd9c5cdb3fd6f041f'));
 }
示例#7
0
 private function createIntercomInstance()
 {
     $this->intercom_service = IntercomBasicAuthClient::factory(['app_id' => $this->app_id, 'api_key' => $this->app_key]);
 }