parent
400b39211d
commit
9ca714d878
2 changed files with 2 additions and 3 deletions
3
tasks.py
3
tasks.py
|
|
@ -1,7 +1,6 @@
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
from lnbits.core.models import Payment
|
from lnbits.core.models import Payment
|
||||||
from lnbits.helpers import get_current_extension_name
|
|
||||||
from lnbits.tasks import register_invoice_listener
|
from lnbits.tasks import register_invoice_listener
|
||||||
|
|
||||||
from .crud import set_ticket_paid
|
from .crud import set_ticket_paid
|
||||||
|
|
@ -9,7 +8,7 @@ from .crud import set_ticket_paid
|
||||||
|
|
||||||
async def wait_for_paid_invoices():
|
async def wait_for_paid_invoices():
|
||||||
invoice_queue = asyncio.Queue()
|
invoice_queue = asyncio.Queue()
|
||||||
register_invoice_listener(invoice_queue, get_current_extension_name())
|
register_invoice_listener(invoice_queue, "ext_events")
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
payment = await invoice_queue.get()
|
payment = await invoice_queue.get()
|
||||||
|
|
|
||||||
|
|
@ -170,7 +170,7 @@ async def api_ticket_send_ticket(event_id, payment_hash):
|
||||||
status_code=HTTPStatus.NOT_FOUND,
|
status_code=HTTPStatus.NOT_FOUND,
|
||||||
detail="Ticket could not be fetched.",
|
detail="Ticket could not be fetched.",
|
||||||
)
|
)
|
||||||
payment = await get_standalone_payment(payment_hash)
|
payment = await get_standalone_payment(payment_hash, incoming=True)
|
||||||
assert payment
|
assert payment
|
||||||
price = (
|
price = (
|
||||||
event.price_per_ticket * 1000
|
event.price_per_ticket * 1000
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue