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
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: