private function createServiceUrl()
{
$this->modePath = strtolower($this->config['sandbox']) ? 'OffAmazonPayments_Sandbox' : 'OffAmazonPayments';
if (!empty($this->config['region'])) {
$region = strtolower($this->config['region']);
if (array_key_exists($region, $this->regionMappings)) {
$this->mwsEndpointUrl = $this->mwsServiceUrls[$this->regionMappings[$region]];
$this->mwsServiceUrl = 'https://' . $this->mwsEndpointUrl . '/' . $this->modePath . '/' . self::SERVICE_VERSION;
$this->mwsEndpointPath = '/' . $this->modePath . '/' . self::SERVICE_VERSION;
} else {
throw new \Exception($region . ' is not a valid region');
}
} else {
throw new \Exception("config['region'] is a required parameter and is not set");
}
}