diff --git a/pynubank/nubank.py b/pynubank/nubank.py index a514f5e..923d54f 100644 --- a/pynubank/nubank.py +++ b/pynubank/nubank.py @@ -14,6 +14,7 @@ 'BarcodePaymentEvent', 'DebitPurchaseEvent', 'DebitPurchaseReversalEvent', + 'BillPaymentEvent', ) diff --git a/pynubank/queries/account_feed.gql b/pynubank/queries/account_feed.gql index 24d227b..7e8fd90 100644 --- a/pynubank/queries/account_feed.gql +++ b/pynubank/queries/account_feed.gql @@ -19,6 +19,9 @@ name } } + ... on BillPaymentEvent { + amount + } ... on DebitPurchaseEvent { amount } diff --git a/tests/test_nubank_client.py b/tests/test_nubank_client.py index d973595..756a4b8 100644 --- a/tests/test_nubank_client.py +++ b/tests/test_nubank_client.py @@ -255,20 +255,20 @@ def test_get_account_statements(monkeypatch, account_statements_return): statements = nubank_client.get_account_statements() - assert len(statements) == 4 - assert statements[2]['id'] == 'abcde-fghi-jklmn-opqrst-uvx1' - assert statements[2]['__typename'] == 'TransferInEvent' - assert statements[2]['title'] == 'TransferĂȘncia recebida' - assert statements[2]['detail'] == 'R$127.33' - assert statements[2]['postDate'] == '2018-03-06' - assert statements[2]['amount'] == 127.33 - - assert statements[3]['id'] == 'abcdefgh-ijkl-mnop-qrst-uvwxyz0123' - assert statements[3]['__typename'] == 'BarcodePaymentEvent' - assert statements[3]['title'] == 'Pagamento efetuado' - assert statements[3]['detail'] == 'AES ELETROPAULO' - assert statements[3]['postDate'] == '2018-02-05' - assert statements[3]['amount'] == 169.2 + assert len(statements) == 5 + assert statements[3]['id'] == 'abcde-fghi-jklmn-opqrst-uvx1' + assert statements[3]['__typename'] == 'TransferInEvent' + assert statements[3]['title'] == 'TransferĂȘncia recebida' + assert statements[3]['detail'] == 'R$127.33' + assert statements[3]['postDate'] == '2018-03-06' + assert statements[3]['amount'] == 127.33 + + assert statements[4]['id'] == 'abcdefgh-ijkl-mnop-qrst-uvwxyz0123' + assert statements[4]['__typename'] == 'BarcodePaymentEvent' + assert statements[4]['title'] == 'Pagamento efetuado' + assert statements[4]['detail'] == 'AES ELETROPAULO' + assert statements[4]['postDate'] == '2018-02-05' + assert statements[4]['amount'] == 169.2 def test_get_qr_code(monkeypatch):