public function __construct($apiKey)
 {
     \Httpful\Bootstrap::init();
     \RESTful\Bootstrap::init();
     \Balanced\Bootstrap::init();
     \Balanced\Settings::$api_key = $apiKey;
 }
 /**
  * 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');
 }
Beispiel #3
0
 /**
  * Factory style constructor works nicer for chaining.  This
  * should also really only be used internally.  The Request::get,
  * Request::post syntax is preferred as it is more readable.
  * @return Request
  * @param string $method Http Method
  * @param string $mime Mime Type to Use
  */
 public static function init($method = null, $mime = null)
 {
     // Setup our handlers, can call it here as it's idempotent
     Bootstrap::init();
     // Setup the default template if need be
     if (!isset(self::$_template)) {
         self::_initializeDefaults();
     }
     $request = new Request();
     return $request->_setDefaults()->method($method)->sendsType($mime)->expectsType($mime);
 }
Beispiel #4
0
<?php

namespace Balanced\Test;

\Balanced\Bootstrap::init();
\RESTful\Bootstrap::init();
\Httpful\Bootstrap::init();
use Balanced\Settings;
use Balanced\APIKey;
use Balanced\Marketplace;
use Balanced\Credit;
use Balanced\Debit;
use Balanced\Refund;
use Balanced\Account;
use Balanced\Merchant;
use Balanced\BankAccount;
use Balanced\Card;
/**
 * Suite test cases. These talk to an API server and so make network calls.
 *
 * Environment variables can be used to control client settings:
 *
 * <ul>
 *     <li>$BALANCED_URL_ROOT If set applies to \Balanced\Settings::$url_root.
 *     <li>$BALANCED_API_KEY If set applies to \Balanced\Settings::$api_key.
 * </ul>
 */
class SuiteTest extends \PHPUnit_Framework_TestCase
{
    static $key, $marketplace, $email_counter = 0;
    static function _createBuyer($email_address = null, $card = null)
Beispiel #5
0
<?php

/**
 * Created by PhpStorm.
 * User: umutcan
 * Date: 8/19/15
 * Time: 12:05 AM
 */
require_once dirname(__FILE__) . "/../easyrdf/lib/EasyRdf.php";
require_once dirname(__FILE__) . "/../Httpful/Bootstrap.php";
use Httpful\Bootstrap;
Bootstrap::init();
define("POST", "post");
define("GET", "get");
require_once "Entity.php";
require_once "Enhancement.php";
require_once "SemanticEngine.php";
require_once "Operation.php";
require_once "SemanticEngineModule.php";
 public function loadAPI()
 {
     \Httpful\Bootstrap::init();
     \RESTful\Bootstrap::init();
     \Prelauncher\Bootstrap::init();
 }
Beispiel #7
0
 /**
  * restful客户端
  * @param  string $uri         网址
  * @param  array  $data        post数据
  * @param  string $method      http请求方式
  * @param  string $mime        http提交内容类型
  * @param  string $expectsType http请求内容内容
  * @return object
  * @example rest('http://www.coscms.com/', array('appId' => '1', 'osType' => 'web'), 'post', null, 'json')->send());
  */
 public static function rest($uri, $data = null, $method = 'get', $mime = null, $expectsType = 'json')
 {
     if (class_exists('\\Httpful\\Bootstrap', false) == false) {
         require VENDOR_PATH . 'Httpful/Bootstrap.php';
         \Httpful\Bootstrap::init();
     }
     switch ($method) {
         case 'post':
             $request = \Httpful\Request::post($uri, $data, !$mime ? 'form' : $mime);
             break;
         case 'get':
         default:
             $request = \Httpful\Request::get($uri, $mime);
     }
     if ($expectsType) {
         $request = $request->expectsType($expectsType);
     }
     return $request;
 }
Beispiel #8
0
 public function __construct($dispatcher)
 {
     \Httpful\Bootstrap::init();
     $this->dispatcher = $dispatcher;
 }