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

Update Client.php #17

Closed
wants to merge 2 commits into from
Closed

Update Client.php #17

wants to merge 2 commits into from

Conversation

sunkaflek
Copy link

orderPickup returns a standard json reponse and should not be void.

if it is void, there is no way to tell whether the call has been un/successful and why

Fix orderPickup
@tomas-novotny tomas-novotny self-requested a review October 29, 2021 06:47
@tomas-novotny tomas-novotny self-assigned this Oct 29, 2021
@tomas-novotny tomas-novotny added the enhancement New feature or request label Oct 29, 2021
fix return types
@tomas-novotny
Copy link
Member

Thank you for reporting this error. Returning status code 200 with an error message is an undocumented API behavior.

Instead of returning response data, you can only validate that it has additional message a throw it as an exception – fixed in 6b683ad.

if it is void, there is no way to tell whether the call has been un/successful and why

If the method doesn't throw an exception, it was successful.

Is this change good enough for you? If so, please close the PR and I will release changes as tag v6.2.0.

@sunkaflek
Copy link
Author

sunkaflek commented Oct 31, 2021

If the method doesn't throw an exception, it was successful.

I see now .. sorry I think I have misunderstood the whole thing. I read in the official Balikobot documentation that ORDERPICKUP returns a json with status. When this library's orderPickup returned NULL no matter what data I tried, I got confused and assumed it was a bug, then solved it by returning the response.

Personally I think a response might be clearer and more in line with the docu, but I guess NULL vs Exception also works.

Returning status code 200 with an error message is an undocumented API behavior

This is not what I tried to say, I do not know whether it does that. I meant it returns a json, not NULL, as does this library.

Sorry for the confusion, I'm closing the PR

@sunkaflek sunkaflek closed this Oct 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants