Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

performHttpCall ignores configured api_version (uses self::API_VERSION constant) #52

Copy link
Copy link

Description

@sandervanhooft
Issue body actions

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.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.