Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fetch incoming payment #35

Merged
merged 1 commit into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions tasks.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import asyncio

from lnbits.core.models import Payment
from lnbits.helpers import get_current_extension_name
from lnbits.tasks import register_invoice_listener

from .crud import set_ticket_paid


async def wait_for_paid_invoices():
invoice_queue = asyncio.Queue()
register_invoice_listener(invoice_queue, get_current_extension_name())
register_invoice_listener(invoice_queue, "ext_events")

while True:
payment = await invoice_queue.get()
Expand Down
2 changes: 1 addition & 1 deletion views_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ async def api_ticket_send_ticket(event_id, payment_hash):
status_code=HTTPStatus.NOT_FOUND,
detail="Ticket could not be fetched.",
)
payment = await get_standalone_payment(payment_hash)
payment = await get_standalone_payment(payment_hash, incoming=True)
assert payment
price = (
event.price_per_ticket * 1000
Expand Down