-
Notifications
You must be signed in to change notification settings - Fork 22
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 FR via REST Web Service #138
Conversation
14b7880
to
98e9b0f
Compare
Checks failed due to GLS or Travis network issue... @florian-dacosta could you force a restart of the travis job please ? Then, this PR and #139 are ready to be reviewed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this work @DylannCordel
I am not sure I understand the gls_eu thing, it is still a specific french GLS webservice right ?
eu make me think of europe and confuse me, should this work for the GLS in any european country?
It does not seem so.
From what I understand, it is, as gls_fr which manage the "GLS BOX", only for the french GLS and it seems it can't even replace gls_fr which deliver zpl, as the only format of gls_eu are pdf and png.
Is that right ?
Anyway, we'll be able to merge this, but I first want to make sure I understand the difference between the 2 gls and see if an other suffix would be appropriate or not, etc...
Thanks in advance for your enlightenment !
roulier/api.py
Outdated
"required": True, | ||
"empty": False, | ||
}, | ||
"shippingDate": {"type": "date", "required": True, "empty": False,}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have to be extremely careful with this kind of changes.
It is not harmless, changing this type, which was a string until now, will make all external app break as they will be sending the type in the wrong format after the merge of this PR...
It would be nice to announce these breaking changes in the description of the PR IMHO
Since this python3 roulier versions is still recent and no wildly used yet, I guess I'll be able to accept the change, but this kind of breaking change will be harder to change in the future, we will need to keep compatibility with previous behaviors.
But I agree, it is better for roulier to receive a value in date format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is based on the #137 which is specifically the change of the date format with explanation about it ;).
I didn't want to push this one (#138) with a string date, then update it when #137 would be merged to use a real date. I was quite sure you'll accept the PR #137 as it's for standardization. Currently the shippingDate param doesn't use the same format between existing roulier's carriers API (same type yes 'string) but not format)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, I missed #137 indeed !
Ok, I'll merge 137 very soon then, thanks
Thx for feed-back. I named this carrier because of the API URL : api.gls-group.eu. I must admit I don't know if Deutch GLS instance for exemple use the same API. |
@DylannCordel FYI, I've ask to GLS support and they did tell me that this solution WEB Api is only for France, just as the GLS-BOX. |
Too bad. Thanks for the feed-back. Do you want I rename it now as |
I think you can rename it already yes. Also, what do you think about file organisation? Indeed, I guess if a carrier propose multiple implementation, we can hope it to expects more or less the same data, so some class could eventualy be shared (mainly the api class) |
Reorganization done. |
You right, I'll see if we can refactor some code to share a base API class for both GLS. |
One remark : I could not use incoterm using gls_fr_rest, trying any value among https://github.com/akretion/roulier/pull/138/files#diff-6a238661790fccc1ae250d3a0c8f16c3efc31df8f18b7d1a3ee3612e8e481739R57 Anyway, it is not blocking for now I think because it is a new service and already usable for a lot of case (cases with no incoterm). Can you resolve the conflict ? Thanks again for your work. From what I understood, Gls will implement ZPL format soon on the rest api. |
I fix the icoterm validation (my mistakes, sorry, due to a bad copy/paste/clean from the doc). Now, it's just a string because I'm waiting for an answer from the gls support team because I confirm the icoterm field is not usable at this stage but I don't know why (missing other undocumented data ? wrong values ?) I rebased and added three tests for icoterm :
So you can merge it now if you want or wait for the answer of GLS support. |
Any new from GLS support ? |
@DylannCordel But, I am still interested to know about the response of GLS support when you'll have it! |
Yes they answered me but I didn't have the time to fix it yet. Documentation is wrong: field must not be in the address, but at the root level:
I opened an issue #143 to not forget to fix it. You can assign it to me. |
based on #137
Tests included except for SHD service: with the parcelshopid from the doc, GLS returns a Server Error. I'll ask them a valid parcelshopid.
Some changes have beend done inside the base transport.py to be able to use any requests args required by the web service we are using.