From 3c15b02dcfcaf432f0a0786c0062e7488160541e Mon Sep 17 00:00:00 2001 From: Breno Viana Date: Thu, 30 Nov 2023 17:06:23 -0300 Subject: [PATCH] adiciona scripts de exemplos --- ...cadastrar_transferencia_conta_pagamento.py | 32 +++++++++++++++ ...consultar_transferencia_conta_pagamento.py | 16 ++++++++ ...dastrar_transferencia_conta_pagamento.json | 32 +++++++++++++++ ...nsultar_transferencia_conta_pagamento.json | 39 +++++++++++++++++++ 4 files changed, 119 insertions(+) create mode 100644 examples/lotes_pagamento/cadastrar_transferencia_conta_pagamento.py create mode 100644 examples/lotes_pagamento/consultar_transferencia_conta_pagamento.py create mode 100644 examples/lotes_pagamento/data/cadastrar_transferencia_conta_pagamento.json create mode 100644 examples/lotes_pagamento/data/consultar_transferencia_conta_pagamento.json diff --git a/examples/lotes_pagamento/cadastrar_transferencia_conta_pagamento.py b/examples/lotes_pagamento/cadastrar_transferencia_conta_pagamento.py new file mode 100644 index 00000000..2d5a9f28 --- /dev/null +++ b/examples/lotes_pagamento/cadastrar_transferencia_conta_pagamento.py @@ -0,0 +1,32 @@ +import os +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")) + + +today = date.today() +bb_fmt = "%d%m%Y" + +lote_data = { + "n_requisicao": 580000, + "agencia": 1607, + "conta": 99738672, + "dv_conta": "X", +} +transferencia_data = { + "codigo_banco": 1, + "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__)) diff --git a/examples/lotes_pagamento/consultar_transferencia_conta_pagamento.py b/examples/lotes_pagamento/consultar_transferencia_conta_pagamento.py new file mode 100644 index 00000000..9c091478 --- /dev/null +++ b/examples/lotes_pagamento/consultar_transferencia_conta_pagamento.py @@ -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__)) diff --git a/examples/lotes_pagamento/data/cadastrar_transferencia_conta_pagamento.json b/examples/lotes_pagamento/data/cadastrar_transferencia_conta_pagamento.json new file mode 100644 index 00000000..c483f36f --- /dev/null +++ b/examples/lotes_pagamento/data/cadastrar_transferencia_conta_pagamento.json @@ -0,0 +1,32 @@ +{ + "estadoRequisicao": 3, + "quantidadeTransferencias": 1, + "totalTransferencias": 15.5, + "quantidadeTransferenciasValidas": 0, + "totalTransferenciasValidas": 0, + "transferencias": [ + { + "identificadorTransferencia": "90580000731030001", + "numeroCOMPE": 1, + "numeroISPB": 0, + "agenciaCredito": 0, + "contaCorrenteCredito": 0, + "digitoVerificadorContaCorrente": "X", + "contaPagamentoCredito": "3066", + "cpfBeneficiario": 99391916180, + "dataTransferencia": 30112023, + "valorTransferencia": 15.5, + "documentoDebito": 0, + "documentoCredito": 0, + "tipoCredito": 1, + "codigoFinalidadeDOC": "", + "codigoFinalidadeTED": "", + "numeroDepositoJudicial": "", + "descricaoTransferencia": "string", + "indicadorAceite": "N", + "erros": [ + 23 + ] + } + ] +} \ No newline at end of file diff --git a/examples/lotes_pagamento/data/consultar_transferencia_conta_pagamento.json b/examples/lotes_pagamento/data/consultar_transferencia_conta_pagamento.json new file mode 100644 index 00000000..4e99480c --- /dev/null +++ b/examples/lotes_pagamento/data/consultar_transferencia_conta_pagamento.json @@ -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 + } + ] +} \ No newline at end of file