/** * Build the complete URL for the request * * @param $subDomain String - gateway/wpf etc. * @param $path String - path of the current request * @param $appendToken Bool - should we append the token to the end of the url * * @return string - complete URL (sub_domain,path,token) */ protected function buildRequestURL($subDomain = 'gateway', $path = '/', $appendToken = true) { $token = $appendToken ? \Genesis\Config::getToken() : ''; $baseURL = \Genesis\Config::getEnvironmentURL($this->getApiConfig('protocol'), $subDomain, $this->getApiConfig('port')); return sprintf('%s/%s/%s', $baseURL, $path, $token); }