mirror of
https://github.com/lnbits/lnbits.git
synced 2025-06-04 04:02:46 +02:00
pass appropriate parameters to create_payment on lnurlwallet.
This commit is contained in:
parent
dbabf937c4
commit
39cd96594e
@ -2,10 +2,11 @@ import requests
|
|||||||
|
|
||||||
from quart import abort, redirect, request, url_for
|
from quart import abort, redirect, request, url_for
|
||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
|
from time import sleep
|
||||||
from lnurl import LnurlWithdrawResponse, handle as handle_lnurl # type: ignore
|
from lnurl import LnurlWithdrawResponse, handle as handle_lnurl # type: ignore
|
||||||
from lnurl.exceptions import LnurlException # type: ignore
|
from lnurl.exceptions import LnurlException # type: ignore
|
||||||
from time import sleep
|
|
||||||
|
|
||||||
|
from lnbits import bolt11
|
||||||
from lnbits.core import core_app
|
from lnbits.core import core_app
|
||||||
from lnbits.settings import WALLET
|
from lnbits.settings import WALLET
|
||||||
|
|
||||||
@ -41,6 +42,8 @@ async def lnurlwallet():
|
|||||||
if not r.ok:
|
if not r.ok:
|
||||||
abort(HTTPStatus.INTERNAL_SERVER_ERROR, "Could not process LNURL-withdraw.")
|
abort(HTTPStatus.INTERNAL_SERVER_ERROR, "Could not process LNURL-withdraw.")
|
||||||
|
|
||||||
|
inv = bolt11.decode(payment_request)
|
||||||
|
|
||||||
for i in range(10):
|
for i in range(10):
|
||||||
invoice_status = WALLET.get_invoice_status(checking_id)
|
invoice_status = WALLET.get_invoice_status(checking_id)
|
||||||
sleep(i)
|
sleep(i)
|
||||||
@ -56,6 +59,8 @@ async def lnurlwallet():
|
|||||||
amount=withdraw_res.max_sats * 1000,
|
amount=withdraw_res.max_sats * 1000,
|
||||||
memo=memo,
|
memo=memo,
|
||||||
pending=invoice_status.pending,
|
pending=invoice_status.pending,
|
||||||
|
payment_request=payment_request,
|
||||||
|
payment_hash=inv.payment_hash,
|
||||||
)
|
)
|
||||||
|
|
||||||
return redirect(url_for("core.wallet", usr=user.id, wal=wallet.id))
|
return redirect(url_for("core.wallet", usr=user.id, wal=wallet.id))
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<a href="{{ link.lnurl }}">
|
<a href="{{ link.lnurl }}">
|
||||||
<q-responsive :ratio="1" class="q-mx-md">
|
<q-responsive :ratio="1" class="q-mx-md">
|
||||||
<qrcode
|
<qrcode
|
||||||
:value="this.theurl+'/?lightning={{link.lnurl }}'"
|
:value="this.here + '/?lightning={{link.lnurl }}'"
|
||||||
:options="{width: 800}"
|
:options="{width: 800}"
|
||||||
class="rounded-borders"
|
class="rounded-borders"
|
||||||
></qrcode>
|
></qrcode>
|
||||||
@ -51,7 +51,7 @@
|
|||||||
mixins: [windowMixin],
|
mixins: [windowMixin],
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
theurl: location.protocol + '//' + location.host
|
here: location.protocol + '//' + location.host
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user