コード例 #1
0
def test_get_qr_code(monkeypatch):
    monkeypatch.setattr(Discovery, '_update_proxy_urls', fake_update_proxy)
    client = Nubank()
    uid, qr = client.get_qr_code()

    assert uid != ''
    assert isinstance(qr, QRCode)
コード例 #2
0
ファイル: Index.py プロジェクト: leonardola/nubank
def generateQRCode():
    nu = Nubank()
    uuid, qr_code = nu.get_qr_code()
    image = qr_code.make_image(fill_color="black", back_color="white")
    image.save("static/image/qrcode.jpg")

    return jsonify({"uuid": uuid})
コード例 #3
0
def test_get_qr_code(monkeypatch):
    nubank_client = Nubank(client=MockHttpClient())
    uid, qr = nubank_client.get_qr_code()

    assert uid != ''
    assert isinstance(qr, QRCode)
コード例 #4
0
def test_get_qr_code():
    client = Nubank()
    uid, qr = client.get_qr_code()

    assert uid != ''
    assert isinstance(qr, QRCode)
コード例 #5
0
            return t
    return None


#formata a descricao da transacao
def get_formated_description(bill_item, transaction):
    description = '{} - {}'.format(transaction['time'][:10],
                                   bill_item['title'])
    if bi['charges'] > 1:
        description = description + ' ({}/{})'.format(bi['index'] + 1,
                                                      bi['charges'])
    return description


nu = Nubank()
uuid, qr_code = nu.get_qr_code()
qr_code.print_ascii(invert=True)
input('Após escanear o QRCode pressione enter para continuar')

# Somente após escanear o QRCode você pode chamar a linha abaixo
nu.authenticate_with_qr_code(cpf, pwd, uuid)

#recupera as transacoes
nubank_transactions = nu.get_card_statements()

#recupera as faturas
nubank_bills = nu.get_bills()

#busca fatura com base em uma data
nubank_bill = get_bill_by_date(nubank_bills, bill_date)