Braintree\Configuration::baseUrl PHP Method

baseUrl() public method

returns the base braintree gateway URL based on config values
public baseUrl ( ) : string
return string braintree gateway URL
    public function baseUrl()
    {
        return sprintf('%s://%s:%d', $this->protocol(), $this->serverName(), $this->portNumber());
    }

Usage Example

 public function testAuthorizationWithConfig()
 {
     $config = new Braintree\Configuration(['environment' => 'development', 'merchant_id' => 'integration_merchant_id', 'publicKey' => 'badPublicKey', 'privateKey' => 'badPrivateKey']);
     $http = new Braintree\Http($config);
     $result = $http->_doUrlRequest('GET', $config->baseUrl() . '/merchants/integration_merchant_id/customers');
     $this->assertEquals(401, $result['status']);
 }
All Usage Examples Of Braintree\Configuration::baseUrl