Skip to content
This repository has been archived by the owner on Jan 24, 2025. It is now read-only.

Commit

Permalink
ajustes
Browse files Browse the repository at this point in the history
  • Loading branch information
peidrao committed Feb 1, 2024
1 parent ded5afb commit d1ea125
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 8 additions & 0 deletions bb_wrapper/models/pagamentos.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ def _set_data(cls, values):
documento = values.pop("documento", None)
if documento is not None:
PixService().verify_document(documento, values)
if values.get("cpf") is None:
del values["cpf"]
if values.get("cnpj") is None:
del values["cnpj"]

values.pop("chave")
return values
Expand Down Expand Up @@ -146,6 +150,10 @@ def _set_data(cls, values):
documento = values.pop("documento", None)
if documento is not None:
PixService().verify_document(documento, values)
if values.get("cpf") is None:
del values["cpf"]
if values.get("cnpj") is None:
del values["cnpj"]

return values

Expand Down
3 changes: 0 additions & 3 deletions tests/wrapper/test_pagamentos.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ def test_criar_dados_chave_aleatoria_transferencia_pix(self):
"listaTransferencias": [
{
"email": None,
"cnpj": None,
"cpf": 11122233300,
"dddTelefone": None,
"telefone": None,
Expand Down Expand Up @@ -197,7 +196,6 @@ def test_criar_dados_telefone_transferencia_pix(self):
"listaTransferencias": [
{
"email": None,
"cnpj": None,
"cpf": 11122233300,
"dddTelefone": 11,
"telefone": 985732102,
Expand Down Expand Up @@ -240,7 +238,6 @@ def test_criar_dados_email_transferencia_pix(self):
"listaTransferencias": [
{
"email": "[email protected]",
"cnpj": None,
"cpf": 11122233300,
"dddTelefone": None,
"telefone": None,
Expand Down

0 comments on commit d1ea125

Please sign in to comment.