This repository has been archived by the owner on Jan 24, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adiciona suporte a transferências para contas pagamento (#66)
* adiciona suporte a transferências para contas pagamento * adiciona verificação dos campos de transferência TED Co-authored-by: Rodrigo Castro <[email protected]> * corrige cadastro de transferência * adiciona scripts de exemplos * corrige transferência * adiciona teste de campos vazios * corrige teste * adiciona debug * adiciona debug * adiciona comando * adiciona logging * corrige teste * ajusta log de debug da requisição Co-authored-by: Rodrigo Castro <[email protected]> * corrige response reason * corrige testes --------- Co-authored-by: Rodrigo Castro <[email protected]>
- Loading branch information
1 parent
153595a
commit d3bcb35
Showing
13 changed files
with
265 additions
and
19 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
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
34 changes: 34 additions & 0 deletions
34
examples/lotes_pagamento/cadastrar_transferencia_conta_pagamento.py
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,34 @@ | ||
import os | ||
import logging | ||
from datetime import date | ||
|
||
from examples.utils import dump_response | ||
|
||
from bb_wrapper.wrapper import PagamentoLoteBBWrapper | ||
|
||
c = PagamentoLoteBBWrapper(cert=("./certs/cert.pem", "./certs/key.pem")) | ||
|
||
logging.basicConfig(level=logging.DEBUG) | ||
|
||
today = date.today() | ||
bb_fmt = "%d%m%Y" | ||
|
||
lote_data = { | ||
"n_requisicao": 579497, | ||
"agencia": 1607, | ||
"conta": 99738672, | ||
"dv_conta": "X", | ||
} | ||
transferencia_data = { | ||
"codigo_banco": 290, | ||
"conta_pagamento_destino": 3066, | ||
"documento": "99391916180", | ||
"data_transferencia": today.strftime(bb_fmt), | ||
"valor_transferencia": 15.50, | ||
"descricao": "string", | ||
} | ||
|
||
|
||
response = c.cadastrar_transferencia(**lote_data, **transferencia_data) | ||
|
||
dump_response(response, os.path.realpath(__file__)) |
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
16 changes: 16 additions & 0 deletions
16
examples/lotes_pagamento/consultar_transferencia_conta_pagamento.py
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,16 @@ | ||
import os | ||
|
||
from examples.utils import dump_response | ||
|
||
from bb_wrapper.wrapper import PagamentoLoteBBWrapper | ||
|
||
c = PagamentoLoteBBWrapper(cert=("./certs/cert.pem", "./certs/key.pem")) | ||
|
||
_id = "90580000731030001" | ||
|
||
|
||
response = c.consultar_transferencia( | ||
_id, | ||
) | ||
|
||
dump_response(response, os.path.realpath(__file__)) |
30 changes: 30 additions & 0 deletions
30
examples/lotes_pagamento/data/cadastrar_transferencia_conta_pagamento.json
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,30 @@ | ||
{ | ||
"estadoRequisicao": 1, | ||
"quantidadeTransferencias": 1, | ||
"totalTransferencias": 15.5, | ||
"quantidadeTransferenciasValidas": 1, | ||
"totalTransferenciasValidas": 15.5, | ||
"transferencias": [ | ||
{ | ||
"identificadorTransferencia": "90579497731030001", | ||
"numeroCOMPE": 290, | ||
"numeroISPB": 0, | ||
"agenciaCredito": 0, | ||
"contaCorrenteCredito": 0, | ||
"digitoVerificadorContaCorrente": "X", | ||
"contaPagamentoCredito": "3066", | ||
"cpfBeneficiario": 99391916180, | ||
"dataTransferencia": 30112023, | ||
"valorTransferencia": 15.5, | ||
"documentoDebito": 0, | ||
"documentoCredito": 0, | ||
"tipoCredito": 3, | ||
"codigoFinalidadeDOC": "", | ||
"codigoFinalidadeTED": "1", | ||
"numeroDepositoJudicial": "", | ||
"descricaoTransferencia": "string", | ||
"indicadorAceite": "S", | ||
"erros": [] | ||
} | ||
] | ||
} |
39 changes: 39 additions & 0 deletions
39
examples/lotes_pagamento/data/consultar_transferencia_conta_pagamento.json
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,39 @@ | ||
{ | ||
"id": 90580000731030000, | ||
"estadoPagamento": "INCONSISTENTE", | ||
"tipoCredito": 1, | ||
"agenciaDebito": 1607, | ||
"contaCorrenteDebito": 99738672, | ||
"digitoVerificadorContaCorrenteDebito": "X", | ||
"inicioCartaoCredito": 0, | ||
"fimCartaoCredito": 0, | ||
"dataPagamento": 30112023, | ||
"valorPagamento": 15.5, | ||
"documentoDebito": 0, | ||
"codigoAutenticacaoPagamento": "", | ||
"numeroDepositoJudicial": "", | ||
"codigoFinalidadeDOC": "", | ||
"codigoFinalidadeTED": "", | ||
"listaPagamentos": [ | ||
{ | ||
"numeroCOMPE": 1, | ||
"numeroISPB": 0, | ||
"agenciaCredito": 0, | ||
"contaCorrenteCredito": 0, | ||
"digitoVerificadorContaCorrenteCredito": "", | ||
"numeroContaCredito": "3066", | ||
"tipoBeneficiario": 1, | ||
"cpfCnpjBeneficiario": 99391916180, | ||
"nomeBeneficiario": "LUIZ NILO REIS", | ||
"documentoCredito": 0, | ||
"texto": "" | ||
} | ||
], | ||
"listaDevolucao": [ | ||
{ | ||
"codigoMotivo": 23, | ||
"dataDevolucao": 0, | ||
"valorDevolucao": 0 | ||
} | ||
] | ||
} |
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
Oops, something went wrong.