PayWithAmazon\Client::profileEndpointUrl PHP Method

profileEndpointUrl() private method

* Based on the config['region'] and config['sandbox'] values get the user profile URL
private profileEndpointUrl ( )
    private function profileEndpointUrl()
    {
        $profileEnvt = strtolower($this->config['sandbox']) ? "api.sandbox" : "api";
        if (!empty($this->config['region'])) {
            $region = strtolower($this->config['region']);
            if (array_key_exists($region, $this->regionMappings)) {
                $this->profileEndpoint = 'https://' . $profileEnvt . '.' . $this->profileEndpointUrls[$region];
            } else {
                throw new \Exception($region . ' is not a valid region');
            }
        } else {
            throw new \Exception("config['region'] is a required parameter and is not set");
        }
    }