diff --git a/src/WhmcsManager.php b/src/WhmcsManager.php index d6f464d..a61753e 100644 --- a/src/WhmcsManager.php +++ b/src/WhmcsManager.php @@ -50,7 +50,11 @@ protected function execute(string $method, $parameters = []) $parameters['action'] = $method; try { - $url = $this->getConfig()['apiurl'].'/api.php'; + $url = $this->getConfig()['apiurl']; + if (!preg_match('/\/api\.php$/i', $url)) { + $url = rtrim($url, '/') . '/api.php'; + } + $response = $this->connection()->post($url, [ 'form_params' => array_merge($parameters, $this->connection()->getConfig()['form_params']), ]);