Skip to content

Commit

Permalink
feat: Add amount for BillPaymentEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
andreroggeri committed Jun 12, 2020
1 parent c47f0a8 commit 78a8d48
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
1 change: 1 addition & 0 deletions pynubank/nubank.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
'BarcodePaymentEvent',
'DebitPurchaseEvent',
'DebitPurchaseReversalEvent',
'BillPaymentEvent',
)


Expand Down
3 changes: 3 additions & 0 deletions pynubank/queries/account_feed.gql
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
name
}
}
... on BillPaymentEvent {
amount
}
... on DebitPurchaseEvent {
amount
}
Expand Down
28 changes: 14 additions & 14 deletions tests/test_nubank_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 78a8d48

Please sign in to comment.