Function To Set PayPal API Configuration.

@param array $config

@throws \Exception
970711
private function setConfig(array $config = [])
    {
        // Set Api Credentials
        if (function_exists('config')) {
            $this->setApiCredentials(
                config('paypal')
            );
        } elseif (!empty($config)) {
            $this->setApiCredentials($config);
        }

        $this->setRequestData();
    }
1050200
public function init($config = [])
    {
        $type  = isset($config['type']) ? $config['type'] : 'File';
        $class = false !== strpos($type, '\\') ? $type : '\\think\\log\\driver\\' . ucwords($type);

        $this->config = $config;

        unset($config['type']);

        if (class_exists($class)) {
            $this->driver = new $class($config);
        } else {
            throw new Exception('class not exists:' . $class, $class);
        }

        return $this;
    }
797919
public function setConfig(array $config)
    {
        // Filter out unknown config keys, and use to override defaults
        $config = array_merge(
            $this->config,
            array_intersect_key($config, $this->config)
        );

        // Normalize allowMethods
        if (is_string($config['allowMethods'])) {
            $config['allowMethods'] = [$config['allowMethods']];
        }

        // Normalize allowHeaders
        if (is_string($config['allowHeaders'])) {
            $config['allowHeaders'] = [$config['allowHeaders']];
        }

        // Normalize allowOrigins
        if (is_string($config['allowOrigins'])) {
            $config['allowOrigins'] = [$config['allowOrigins']];
        }

        // Normalize allowCredentials
        $config['allowCredentials'] = (bool)$config['allowCredentials'];

        // Normalize maxAge
        $config['maxAge'] = (int)$config['maxAge'];

        /** @todo Check for use of wildcard in allowOrigins when allowCredentials equals true */

        // Set config as object attribute
        $this->config = $config;

        return $this;
    }
556166
protected static function _setDbConnectionConfig(array $config)
	{
		$app = \Slim\Slim::getInstance();
		$cfg = Config::instance();
		$cfg->set_connections($config);
		$cfg->set_default_connection($app->config('mode'));
	}
1263792
public function setConfig(array $config)
    {
        foreach ($config as $key => $value) {
            switch ($key) {
                case 'verbose':
                case 'loadEnv':
                    if (!is_bool($value)) {
                        throw new ConfigurationException($key, 'This should be a boolean value.');
                    }

                    $this->config[$key] = $value;
                    break;

                default:
                    throw new ConfigurationException($key, 'This is an unknown configuration option.');
            }
        }
    }
1031210
public function setConfig( array $config )
	{
		if ( $config == $this->getConfig() ) { return; }

		$this->_values['config'] = $config;
		$this->setModified();
	}
1313659
public function setConfig(array $config)
    {
        try {
            $this->config = $this
                ->getConfigResolver()
                ->resolve($config);
        } catch (ExceptionInterface $e) {
            throw new InvalidArgumentException($e->getMessage(), $e->getCode(), $e);
        }
    }
759597
public function configure(array $config)
    {
        return $this
            ->setGLSShipmentDeposit($config[Config::T8700])
            ->setCustomerCode($config[Config::T8915])
            ->setContactId($config[Config::T8914])
            ->clean();
    }
800842
protected function loadConfig(array $config)
	{
		$this->className = $config['class'];
		$this->itemPerPage = (int) $config['item_per_page'];
		$this->maxPageNumber = (int) $config['max_page_number'];		
	}
951933
private function configure(array $config = []): void
    {
        foreach ($config as $param => $value) {
            $property = $this->toCamelCase($param);
            if (property_exists(self::class, $property)) {
                $this->$property = $value;
            }
        }
    }
870154
public static function factory(array $config)
    {
        if ( ! array_key_exists('apiKey', $config)) {
            throw new \Exception('Api factory requires $apiKey parameter.');
        }

        $client = new Client([
            'defaults' => [
                'headers' => [
                    'X-ApiKey' => $config['apiKey'],
                ],
            ],
        ], [], $config);

        $description = self::getDescriptionFromConfig($config);

        $apiVersion = isset($config['apiVersion']) ? $config['apiVersion'] : 1;

        return new self($client, $description, ['defaults' => ['api_version' => $apiVersion]]);
    }
209157
protected function processCloudConfig(array $config)
    {
        if (!isset($config['clouds']) || !is_array($config['clouds'])) {
            throw new \InvalidArgumentException('No cloud configuration given.');
        }

        foreach ($config['clouds'] as $name => $cloudConfig) {
            $this->validateMandatoryOptions($cloudConfig, 'cloud', $name, array('id', 'account'));

            try {
                $account = $this->accountManager->getAccount($cloudConfig['account']);
            } catch (\InvalidArgumentException $e) {
                throw new \InvalidArgumentException(
                    sprintf('Invalid account %s for cloud %s', $name, $cloudConfig['account'])
                );
            }

            $httpClient = $this->createHttpClient($account, $cloudConfig['id']);
            $cloud = $this->createCloud();
            $cloud->setHttpClient($httpClient);
            $cloud->setTransformers($this->transformers);
            $this->cloudManager->registerCloud($name, $cloud);
        }
    }
1109278
private function setLaravelConfigs(array $config)
    {
        if (empty($config)) {
            return;
        }

        foreach ($config as $name => $value) {
            config([$name => $value]);
        }
    }
877340
private function setConfig(array $config)
    {
        // Cookie name
        if (isset($config['cookieName'])) {
            if (!ctype_alnum($config['cookieName'])) {
                throw new \Exception('Invalid cookie name provided.');
            }

            $this->cookieName = $config['cookieName'];
        }

        // Database table name
        if (isset($config['tableName'])) {
            $this->tableName = $config['tableName'];
        }

        // Expiration time in seconds
        if (isset($config['secondsUntilExpiration'])) {
            // Anything else than digits?
            if (!is_int($config['secondsUntilExpiration']) || $config['secondsUntilExpiration'] <= 0) {
                throw new \Exception('Seconds until expiration must be a positive non-zero integer.');
            }

            $this->secondsUntilExpiration = (int) $config['secondsUntilExpiration'];
        }

        // How often should the session be renewed?
        if (isset($config['renewalTime'])) {
            // Anything else than digits?
            if (!is_int($config['renewalTime']) || $config['renewalTime'] <= 0) {
                throw new \Exception('Session renewal time must be a valid non-zero integer.');
            }

            $this->renewalTime = (int) $config['renewalTime'];
        }

        // End the session when the browser is closed?
        if (isset($config['expireOnClose'])) {
            // Not true or false?
            if (!is_bool($config['expireOnClose'])) {
                throw new \Exception('Expire on close must be either true or false.');
            }

            $this->expireOnClose = $config['expireOnClose'];
        }

        // Check IP addresses?
        if (isset($config['checkIpAddress']) && $config['checkIpAddress'] === true) {
            $this->checkIpAddress = true;
            $this->ipAddress = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '0.0.0.0';
        }

        // Check user agent?
        // Hashing HTTP_USER_AGENT only so it stores in a fixed size field
        if (isset($config['checkUserAgent']) && $config['checkUserAgent'] === true) {
            $this->checkUserAgent = true;
            $this->userAgent = isset($_SERVER['HTTP_USER_AGENT']) ? substr($_SERVER['HTTP_USER_AGENT'], 0, 64) : 'unknown';
        }

        // Send cookie only when HTTPS is enabled?
        if (isset($config['secureCookie'])) {
            if (!is_bool($config['secureCookie'])) {
                throw new \Exception('The secure cookie option must be either true or false.');
            }

            $this->secureCookie = $config['secureCookie'];
        }

        // Salt key
        if (isset($config['salt'])) {
            $this->salt = $config['salt'];
        } else {
            throw new \Exception('Session salt encryption key not set');
        }

        // Auto-Run
        if (isset($config['autoRunSession'])) {
            $this->autoRunSession = $config['autoRunSession'];
        }
    }
701064
protected function setServiceId(array $config)
    {
        $config['service']   = empty($config['service_name'])
            ? $service_param = 'SID = ' . $config['database']
            : $service_param = 'SERVICE_NAME = ' . $config['service_name'];

        return $config;
    }
1325038
public function put(array $config)
    {
        foreach ($config as $key => $value) {
            $this->set($key, $value);
        }

        return $this;
    }
1013204
protected function setup(array $config = [])
    {
        if (!isset($config['data_provider'])) {
            throw new Exception(translate('{data_provider} must be a DatapPovider objetc'), 500, Exception::BADARGUMENTS);
        } elseif (isset($config['data_provider']) && !($config['data_provider'] instanceof DataProviderInterface)) {
            throw new Exception(translate('{data_provider} must be a DatapPovider objetc'), 500, Exception::BADARGUMENTS);
        }

        if (!isset($config['columns'])) {
            throw new Exception(translate('{columns} must be an array type Column[]'), 500, Exception::BADARGUMENTS);
        }

        parent::setup($config);

        $this->setupColumns();
    }