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
|
|
|
|
31
|
|
|
|
32
|
1 |
|
class LogisticaReversa(WebserviceBase): |
|
|
|
|
33
|
|
|
|
34
|
1 |
|
def get_env(self, env): |
35
|
1 |
|
envs = { |
36
|
|
|
'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
|
1 |
|
return envs[env] |
43
|
|
|
|
44
|
1 |
|
def SolicitarPostagemReversa(self, request): |
|
|
|
|
45
|
1 |
|
return self.call("solicitarPostagemReversa", request) |
46
|
|
|
|
47
|
1 |
|
def AcompanharPedido(self, request): |
|
|
|
|
48
|
1 |
|
return self.call('acompanharPedido', request) |
49
|
|
|
|
50
|
1 |
|
def AcompanharPedidoPorData(self, request): |
|
|
|
|
51
|
|
|
return self.call('acompanharPedidoPorData', request) |
52
|
|
|
|
53
|
1 |
|
def CancelarPedido(self, request): |
|
|
|
|
54
|
|
|
return self.call('cancelarPedido', request) |
55
|
|
|
|
56
|
1 |
|
def SolicitarRange(self, request): |
|
|
|
|
57
|
|
|
return self.call('solicitarRange', request) |
58
|
|
|
|
59
|
1 |
|
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.