Beispiel #1
0
 /**
  * Test the services list retrieval
  */
 public function testGetv1Endpoints()
 {
     xAC::setApiVersion(1);
     xAC::initServices(true);
     $this->assertArrayHasKey('transactions', xAC::getServices());
     $this->assertArrayHasKey('customer', xAC::getServices());
 }
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     xAC::setApiKey(Config::get('arrowsphere-client.' . APP::environment() . '.XAC_APIKEY'));
     xAC::setApiBaseUrl(Config::get('arrowsphere-client.' . APP::environment() . '.XAC_URL'));
     xAC::setApiVersion(Config::get('arrowsphere-client.' . APP::environment() . '.XAC_APIVERSION'));
     xAC::initServices(true);
     return printf("Services list has been refreshed \n");
 }
 /**
  * Register the service provider
  * @return XacAPI
  */
 public function register()
 {
     $this->app['arrowsphere.client'] = $this->app->share(function ($app) {
         //Set apiKey and baseUrl on client.
         xACClient::setApiKey(Config::get('arrowsphere-client.' . APP::environment() . '.XAC_APIKEY'));
         xACClient::setApiBaseUrl(Config::get('arrowsphere-client.' . APP::environment() . '.XAC_URL'));
         xACClient::setApiVersion(Config::get('arrowsphere-client.' . APP::environment() . '.XAC_APIVERSION'));
         return xACClient::getInstance();
     });
     $this->app['command.arrowsphere.list'] = $this->app->share(function ($app) {
         return new servicesListCommand($app['config'], $app['files'], $app['view']);
     });
     $this->app['command.arrowsphere.refresh'] = $this->app->share(function ($app) {
         return new refreshListCommand($app['files']);
     });
     $this->commands('command.arrowsphere.list', 'command.arrowsphere.refresh');
     $this->app->bind('Arrowsphere\\Client\\xAC', 'arrowsphere.client');
 }