예제 #1
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();
     }
 }