getRegion in Client.php has a wrong return type and generated url is not correct
jvandervalk opened this issue · comments
jvandervalk commented
Hello, i just installed version 5.0.0 and tried to connect to ZohoBooks.
I believe there is a wrong return type and endpoint return for when retrieving the region, because the code breaks and gives an error.
Line 95 in e39bacf
Here it says getRegion returns a value of the type Region, which is an Abstract class, also the returntype of $this->oAuthClient->setRegion($region);
return a string.
If I change the return type of the Region to string and remove the getKeyValue() in the getUrl(), the api is missing a . i guess, since the domain will be books.zohoeu
.
public function getUrl(): string
{
$apiUrl = self::ZOHOBOOKS_API_URL_PARTIAL_HOST;
$domain = $this->getRegion()->getValue();
$path = self::ZOHOBOOKS_API_URL_PATH;
return $apiUrl . $domain . $path;
}