mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-03-04 01:53:59 +01:00
few prints
This commit is contained in:
parent
7e6b2ba029
commit
1227fb980f
1 changed files with 4 additions and 5 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue