diff --git a/lnbits/extensions/lnurlpayout/tasks.py b/lnbits/extensions/lnurlpayout/tasks.py index 9ccf7d82e..0e1cdffb3 100644 --- a/lnbits/extensions/lnurlpayout/tasks.py +++ b/lnbits/extensions/lnurlpayout/tasks.py @@ -24,7 +24,6 @@ async def on_invoice_paid(payment: Payment) -> None: # Check its got a payout associated with it lnurlpayout_link = await get_lnurlpayout_from_wallet(payment.wallet_id) print(lnurlpayout_link) - if lnurlpayout_link: # Check the wallet balance is more than the threshold wallet = await api_wallet(payment.wallet_id) @@ -43,19 +42,19 @@ async def on_invoice_paid(payment: Payment) -> None: ) res = r.json() print(res) + print(res["callback"]) try: r = await client.get( - res.callback + "?amount=" + (lnurlpayout_link.threshold * 1000), + res["callback"] + "?amount=" + (lnurlpayout_link.threshold * 1000), timeout=40, ) res = r.json() - print(res) - await api_payments_pay_invoice(res.pr, payment.wallet_id) + print(res["pr"]) + await api_payments_pay_invoice(res["pr"], payment.wallet_id) except: return except (httpx.ConnectError, httpx.RequestError): return - except Exception: raise HTTPException(status_code=HTTPStatus.FORBIDDEN, detail="Failed to save LNURLPayout") except: