Bug
VatlyApiClient::performHttpCall() builds the request URL from the class constant, not the configurable property:
// VatlyApiClient::performHttpCall()
$url = $this->apiEndpoint . "/" . self::API_VERSION . "/" . $apiMethod;
So setApiVersion() has no effect on outgoing requests — they always hit /v1/. The $this->apiVersion property is assigned by setApiVersion() (and the vatly-laravel VatlyConfig wires config('vatly.api_version') into it via Vatly::__construct), but it's never read when constructing the URL.
Harmless today since the only version is v1, but it's a latent bug: any future VATLY_API_VERSION override silently doesn't apply.
Suggested fix
$url = $this->apiEndpoint . "/" . $this->apiVersion . "/" . $apiMethod;
(performHttpCallToFullUrl() already accepts a full URL, so only performHttpCall() needs the change.)
Observed in vatly/vatly-api-php v0.1.0-alpha.21 while wiring a Laravel app against the staging API.
Bug
VatlyApiClient::performHttpCall()builds the request URL from the class constant, not the configurable property:So
setApiVersion()has no effect on outgoing requests — they always hit/v1/. The$this->apiVersionproperty is assigned bysetApiVersion()(and thevatly-laravelVatlyConfigwiresconfig('vatly.api_version')into it viaVatly::__construct), but it's never read when constructing the URL.Harmless today since the only version is
v1, but it's a latent bug: any futureVATLY_API_VERSIONoverride silently doesn't apply.Suggested fix
(
performHttpCallToFullUrl()already accepts a full URL, so onlyperformHttpCall()needs the change.)Observed in
vatly/vatly-api-phpv0.1.0-alpha.21 while wiring a Laravel app against the staging API.