Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GLS trackPackages return empty statuses #3

Closed
eugeene opened this issue May 29, 2020 · 1 comment
Closed

GLS trackPackages return empty statuses #3

eugeene opened this issue May 29, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@eugeene
Copy link

eugeene commented May 29, 2020

Detailed description

When tracking GLS packages, statuses returned by trackPackages() are always empty.

Possible implementation

the issue is due to this part of code:

    if (empty($response[0])) {
        throw new BadRequestException($response);
    }

$response[0] can be empty and thus will throw an exception, crude (don't now if good) solution is to check $response[1] being set:

    if (empty($response[0])) {
		if(empty($response[1])) {
			throw new BadRequestException($response);
		}

		$response[0] = $response[1];
    }
@tomas-novotny tomas-novotny self-assigned this May 30, 2020
@tomas-novotny tomas-novotny added the bug Something isn't working label May 30, 2020
@tomas-novotny
Copy link
Member

There is problem with response data from API. For GLS shipper TRACK request API returns only last package statuses. In your case, there are data only for second package with index [1].

Method doesn't throw exception now (fixed in v3.1.0, it returns empty array for missing indexes instead.

The response data for multiple packages for other shippers are correct. Response from TRACK_STATUS request for GLS shipper with multiple packages is also correct.

I recommend contacting Balikobot support to resolve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants