src/Bigcommerce/Api/Client.php
public static function configureBasicAuth(array $settings)
    {
        if (!isset($settings['store_url'])) {
            throw new Exception("'store_url' must be provided");
        }

        if (!isset($settings['username'])) {
            throw new Exception("'username' must be provided");
        }

        if (!isset($settings['api_key'])) {
            throw new Exception("'api_key' must be provided");
        }

        self::$username = $settings['username'];
        self::$api_key = $settings['api_key'];
        self::$store_url = rtrim($settings['store_url'], '/');
        self::$api_path = self::$store_url . self::$path_prefix;
        self::$connection = false;
    }
public static function configureBasicAuth(array $settings)
    {
        if (!isset($settings['store_url'])) {
            throw new Exception("'store_url' must be provided");
        }

        if (!isset($settings['username'])) {
            throw new Exception("'username' must be provided");
        }

        if (!isset($settings['api_key'])) {
            throw new Exception("'api_key' must be provided");
        }

        self::$username = $settings['username'];
        self::$api_key = $settings['api_key'];
        self::$store_url = rtrim($settings['store_url'], '/');
        self::$api_path = self::$store_url . self::$path_prefix;
        self::$connection = false;
    }
public static function configureBasicAuth ( array $ settings ) { if ( ! isset ( $ settings [ 'store_url' ] ) ) { throw new Exception ( "'store_url' must be provided" ) ; } if ( ! isset ( $ settings [ 'username' ] ) ) { throw new Exception ( "'username' must be provided" ) ; } if ( ! isset ( $ settings [ 'api_key' ] ) ) { throw new Exception ( "'api_key' must be provided" ) ; } self :: $ username = $ settings [ 'username' ] ; self :: $ api_key = $ settings [ 'api_key' ] ; self :: $ store_url = rtrim ( $ settings [ 'store_url' ] , '/' ) ; self :: $ api_path = self :: $ store_url . self :: $ path_prefix ; self :: $ connection = false ; }
Configure the API client with the required credentials.

Requires a settings array to be passed in with the following keys:

- store_url
- username
- api_key

@param array $settings
@throws \Exception
Configure the API client with the required credentials .