Braintree\Configuration::assertHasAccessTokenOrKeys PHP Method

assertHasAccessTokenOrKeys() public method

    public function assertHasAccessTokenOrKeys()
    {
        if (empty($this->_accessToken)) {
            if (empty($this->_merchantId)) {
                throw new Exception\Configuration('Braintree\\Configuration::merchantId needs to be set (or accessToken needs to be passed to Braintree\\Gateway).');
            } else {
                if (empty($this->_environment)) {
                    throw new Exception\Configuration('Braintree\\Configuration::environment needs to be set.');
                } else {
                    if (empty($this->_publicKey)) {
                        throw new Exception\Configuration('Braintree\\Configuration::publicKey needs to be set.');
                    } else {
                        if (empty($this->_privateKey)) {
                            throw new Exception\Configuration('Braintree\\Configuration::privateKey needs to be set.');
                        }
                    }
                }
            }
        }
    }

Usage Example

 /**
  *
  * @param Gateway $gateway
  */
 public function __construct($gateway)
 {
     $this->_gateway = $gateway;
     $this->_config = $gateway->config;
     $this->_config->assertHasAccessTokenOrKeys();
     $this->_http = new Http($gateway->config);
 }
All Usage Examples Of Braintree\Configuration::assertHasAccessTokenOrKeys