mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2024-11-19 09:54:21 +01:00
now payments are finalized and dns registered when the event happens instead when user polls the backend
This commit is contained in:
parent
e1abea77f5
commit
10414be0d2
@ -23,6 +23,9 @@ $ pipenv shell
|
||||
$ pipenv install --dev
|
||||
```
|
||||
|
||||
If any of the modules fails to install, try checking and upgrading your setupTool module.
|
||||
`pip install -U setuptools`
|
||||
|
||||
If you wish to use a version of Python higher than 3.7:
|
||||
|
||||
```sh
|
||||
|
@ -23,12 +23,10 @@ async def wait_for_paid_invoices(invoice_paid_chan: trio.MemoryReceiveChannel):
|
||||
|
||||
|
||||
async def on_invoice_paid(payment: Payment) -> None:
|
||||
print(payment)
|
||||
if "lnsubdomain" != payment.extra.get("tag"):
|
||||
# not an lnurlp invoice
|
||||
return
|
||||
|
||||
wallet = await get_wallet(payment.wallet_id)
|
||||
|
||||
await payment.set_pending(False)
|
||||
subdomain = await set_subdomain_paid(payment_hash=payment.payment_hash)
|
||||
domain = await get_domain(subdomain.domain)
|
||||
@ -76,5 +74,3 @@ async def on_invoice_paid(payment: Payment) -> None:
|
||||
)
|
||||
except AssertionError:
|
||||
webhook = None
|
||||
|
||||
return jsonify({"paid": True}), HTTPStatus.OK
|
||||
|
@ -10,7 +10,6 @@ from .util import isValidDomain, isvalidIPAddress
|
||||
from . import subdomains_ext
|
||||
from .crud import (
|
||||
create_subdomain,
|
||||
set_subdomain_paid,
|
||||
get_subdomain,
|
||||
get_subdomains,
|
||||
delete_subdomain,
|
||||
@ -152,7 +151,9 @@ async def api_subdomain_send_subdomain(payment_hash):
|
||||
return jsonify({"paid": False}), HTTPStatus.OK
|
||||
|
||||
if is_paid:
|
||||
return jsonify({"paid": False}), HTTPStatus.OK
|
||||
return jsonify({"paid": True}), HTTPStatus.OK
|
||||
|
||||
return jsonify({"paid": False}), HTTPStatus.OK
|
||||
|
||||
|
||||
@subdomains_ext.route("/api/v1/subdomains/<subdomain_id>", methods=["DELETE"])
|
||||
|
Loading…
Reference in New Issue
Block a user