mirror of
https://github.com/lnbits/lnbits.git
synced 2025-05-30 17:49:55 +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 http import HTTPStatus
|
||||
from time import sleep
|
||||
from lnurl import LnurlWithdrawResponse, handle as handle_lnurl # 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.settings import WALLET
|
||||
|
||||
@ -41,6 +42,8 @@ async def lnurlwallet():
|
||||
if not r.ok:
|
||||
abort(HTTPStatus.INTERNAL_SERVER_ERROR, "Could not process LNURL-withdraw.")
|
||||
|
||||
inv = bolt11.decode(payment_request)
|
||||
|
||||
for i in range(10):
|
||||
invoice_status = WALLET.get_invoice_status(checking_id)
|
||||
sleep(i)
|
||||
@ -56,6 +59,8 @@ async def lnurlwallet():
|
||||
amount=withdraw_res.max_sats * 1000,
|
||||
memo=memo,
|
||||
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))
|
||||
|
@ -10,7 +10,7 @@
|
||||
<a href="{{ link.lnurl }}">
|
||||
<q-responsive :ratio="1" class="q-mx-md">
|
||||
<qrcode
|
||||
:value="this.theurl+'/?lightning={{link.lnurl }}'"
|
||||
:value="this.here + '/?lightning={{link.lnurl }}'"
|
||||
:options="{width: 800}"
|
||||
class="rounded-borders"
|
||||
></qrcode>
|
||||
@ -51,7 +51,7 @@
|
||||
mixins: [windowMixin],
|
||||
data: function () {
|
||||
return {
|
||||
theurl: location.protocol + '//' + location.host
|
||||
here: location.protocol + '//' + location.host
|
||||
}
|
||||
}
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user