-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from akretion/feat/add_geodis_findLocalite
Feat/add geodis find localite
- Loading branch information
Showing
11 changed files
with
179 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Implementation of Geodis Ws Api.""" | ||
from roulier.api import Api | ||
|
||
|
||
class GeodisApiFindLocaliteWs(Api): | ||
|
||
def _service(self): | ||
schema = {} | ||
schema['is_test'] = { | ||
'type': 'boolean', 'default': True, | ||
'description': 'Use test Ws'} | ||
return schema | ||
|
||
def _address(self): | ||
schema = super(GeodisApiFindLocaliteWs, self)._address() | ||
schema['country'].update({'required': True, 'empty': False}) | ||
return { | ||
'country': schema['country'], | ||
'zip': schema['zip'], | ||
'city': schema['city'], | ||
} | ||
|
||
def _auth(self): | ||
schema = super(GeodisApiFindLocaliteWs, self)._auth() | ||
schema['login'].update({'required': True, 'empty': False}) | ||
schema['password']['required'] = False | ||
return schema | ||
|
||
def _schemas(self): | ||
return { | ||
'auth': self._auth(), | ||
'to_address': self._address(), | ||
'service': self._service(), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Store infos about ws""" | ||
from .geodis_api_ws import GeodisApiWs | ||
from .geodis_api_find_localite_ws import GeodisApiFindLocaliteWs | ||
|
||
|
||
GEODIS_INFOS = { | ||
'demandeImpressionEtiquette': { | ||
'xmlns': 'http://impression.service.web.etiquette.geodis.com', | ||
'endpoint': "http://espace.geodis.com/geolabel/services/ImpressionEtiquette", # nopep8 | ||
'endpoint_test': "http://espace.recette.geodis.com/geolabel/services/ImpressionEtiquette", # nopep8 | ||
'api': GeodisApiWs, | ||
}, | ||
'findLocalite': { | ||
'xmlns': 'http://localite.service.web.etiquette.geodis.com', | ||
'endpoint': "http://espace.geodis.com/geolabel/services/RechercherLocalite", # nopep8 | ||
'endpoint_test': "http://espace.recette.geodis.com/geolabel/services/RechercherLocalite", # nopep8 | ||
'api': GeodisApiFindLocaliteWs, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
roulier/carriers/geodis/templates/geodis_demandeImpressionEtiquette.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<imp:findLocalite xmlns:imp="{{xmlns}}"> | ||
{% with address = receiver_address %} | ||
<imp:codePays>{{ address.country }}</imp:codePays> | ||
<imp:codePostal>{{ address.zip }}</imp:codePostal> | ||
<imp:libelle>{{ address.city }}</imp:libelle> | ||
{% endwith %} | ||
</imp:findLocalite> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<imp:authenticationInfo xmlns:imp="http://impression.service.web.etiquette.geodis.com"> | ||
<imp:authenticationInfo xmlns:imp="{{xmlns}}"> | ||
<imp:userName>{{ auth.login }}</imp:userName> | ||
<imp:password>{{ auth.password }}</imp:password> | ||
</imp:authenticationInfo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters