/** * Builds the resource url with the given parameters * * @param string $resource * @param string $env * @param string $query_string * @return string */ public static function getUrl($resource, $env, $query_string = null) { $url = null; if (Configuration::isSandbox($env)) { $base_url = Configuration::ENV_TEST_BASE_URL; } else { $base_url = Configuration::ENV_LIVE_BASE_URL; } if ($base_url && $resource) { $url = $base_url . ltrim($resource, '/'); } return $url; }