PayWithAmazon\Client::__construct PHP Method

__construct() public method

* Takes user configuration array from the user as input Takes JSON file path with configuration information as input Validates the user configuration array against existing config array
public __construct ( $config = null )
    public function __construct($config = null)
    {
        $this->getRegionUrls();
        if (!is_null($config)) {
            if (is_array($config)) {
                $configArray = $config;
            } elseif (!is_array($config)) {
                $configArray = $this->checkIfFileExists($config);
            }
            if (is_array($configArray)) {
                $this->checkConfigKeys($configArray);
            } else {
                throw new \Exception('$config is of the incorrect type ' . gettype($configArray) . ' and should be of the type array');
            }
        } else {
            throw new \Exception('$config cannot be null.');
        }
    }