|
1
|
|
|
# -*- coding: utf-8 -*- |
|
|
|
|
|
|
2
|
|
|
# ############################################################################# |
|
3
|
|
|
# |
|
4
|
|
|
# The MIT License (MIT) |
|
5
|
|
|
# |
|
6
|
|
|
# Copyright (c) 2016 Trocafone |
|
7
|
|
|
# |
|
8
|
|
|
# Permission is hereby granted, free of charge, to any person obtaining a copy |
|
9
|
|
|
# of this software and associated documentation files (the "Software"), to deal |
|
10
|
|
|
# in the Software without restriction, including without limitation the rights |
|
11
|
|
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
12
|
|
|
# copies of the Software, and to permit persons to whom the Software is |
|
13
|
|
|
# furnished to do so, subject to the following conditions: |
|
14
|
|
|
# |
|
15
|
|
|
# The above copyright notice and this permission notice shall be included in |
|
16
|
|
|
# all copies or substantial portions of the Software. |
|
17
|
|
|
# |
|
18
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
19
|
|
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
20
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
21
|
|
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
22
|
|
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
23
|
|
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
|
24
|
|
|
# SOFTWARE. |
|
25
|
|
|
# |
|
26
|
|
|
############################################################################### |
|
27
|
|
|
|
|
28
|
|
|
|
|
29
|
1 |
|
from correios_lib.base import WebserviceBase |
|
30
|
1 |
|
|
|
31
|
|
|
|
|
32
|
|
|
class LogisticaReversa(WebserviceBase): |
|
|
|
|
|
|
33
|
1 |
|
|
|
34
|
|
|
def get_env(self, env): |
|
35
|
1 |
|
envs = { |
|
36
|
1 |
|
'HOMOLOG': 'https://apphom.correios.com.br/logisticaReversaWS/' |
|
37
|
|
|
'logisticaReversaService/logisticaReversaWS?wsdl', |
|
38
|
|
|
'PROD': 'https://cws.correios.com.br/logisticaReversaWS/' |
|
39
|
|
|
'logisticaReversaService/logisticaReversaWS?wsdl', |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
return envs[env] |
|
43
|
1 |
|
|
|
44
|
|
|
def SolicitarPostagemReversa(self, request): |
|
|
|
|
|
|
45
|
1 |
|
return self.call("solicitarPostagemReversa", request) |
|
46
|
1 |
|
|
|
47
|
|
|
def AcompanharPedido(self, request): |
|
|
|
|
|
|
48
|
|
|
return self.call('acompanharPedido', request) |
|
49
|
|
|
|
|
50
|
|
|
def AcompanharPedidoPorData(self, request): |
|
|
|
|
|
|
51
|
|
|
return self.call('acompanharPedidoPorData', request) |
|
52
|
1 |
|
|
|
53
|
|
|
def CancelarPedido(self, request): |
|
|
|
|
|
|
54
|
|
|
return self.call('cancelarPedido', request) |
|
55
|
|
|
|
|
56
|
|
|
def SolicitarRange(self, request): |
|
|
|
|
|
|
57
|
|
|
return self.call('solicitarRange', request) |
|
58
|
|
|
|
|
59
|
|
|
def CalcularDigitoVerificador(self, request): |
|
|
|
|
|
|
60
|
|
|
return self.call('calcularDigitoVerificador', request) |
|
61
|
|
|
|
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.