private static function getEndpoint($config)
    {
        if (isset($config['mode'])) {
            switch (strtoupper($config['mode'])) {
                case 'SANDBOX':
                    $baseEndpoint = Constants::STAGING_WSDL_ENDPOINT;
                    break;
                case 'LIVE':
                    $baseEndpoint = Constants::PROD_WSDL_ENDPOINT;
                    break;
                default:
                    throw new ConfigurationException('The mode config parameter must be set to either sandbox/live');
            }
        } else {
            // Defaulting to Sandbox
            $baseEndpoint = Constants::STAGING_WSDL_ENDPOINT;
        }

        $baseEndpoint = rtrim(trim($baseEndpoint), '/');

        return $baseEndpoint;
    }