/**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot()
 {
     \Httpful\Bootstrap::init();
     \RESTful\Bootstrap::init();
     \Balanced\Bootstrap::init();
     $this->package('revolt-visual/laravel-balanced');
     Balanced\Settings::$api_key = $this->app['config']->get('laravel-balanced::balanced.secret_key');
 }
Exemplo n.º 2
0
 public static function setUpBeforeClass()
 {
     // url root
     $url_root = getenv('BALANCED_URL_ROOT');
     if ($url_root != '') {
         Settings::$url_root = $url_root;
     } else {
         Settings::$url_root = 'https://api.balancedpayments.com';
     }
     // api key
     $api_key = getenv('BALANCED_API_KEY');
     if ($api_key != '') {
         Settings::$api_key = $api_key;
     } else {
         self::$key = new APIKey();
         self::$key->save();
         Settings::$api_key = self::$key->secret;
     }
     // marketplace
     try {
         self::$marketplace = Marketplace::mine();
     } catch (\RESTful\Exceptions\NoResultFound $e) {
         self::$marketplace = new Marketplace();
         self::$marketplace->save();
     }
 }