mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-03-04 09:58:33 +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
|
# 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:
|
||||||
|
|
Loading…
Add table
Reference in a new issue