few prints

This commit is contained in:
benarc 2021-12-09 10:16:40 +00:00
parent 7e6b2ba029
commit 1227fb980f

View file

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