Fix ticket create (#13)

* don't set ticket as paid on create
* use crud fn in tasks.py
* create ticket is unpaid by default
This commit is contained in:
Tiago Vasconcelos 2023-08-18 07:18:44 +01:00 committed by GitHub
parent c8b31d8e3f
commit 00f552c751
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 41 additions and 24 deletions

View file

@ -4,8 +4,7 @@ from lnbits.core.models import Payment
from lnbits.helpers import get_current_extension_name
from lnbits.tasks import register_invoice_listener
from .models import CreateTicket
from .views_api import api_ticket_send_ticket
from .crud import set_ticket_paid
async def wait_for_paid_invoices():
@ -25,8 +24,6 @@ async def on_invoice_paid(payment: Payment) -> None:
and payment.extra.get("name")
and payment.extra.get("email")
):
await api_ticket_send_ticket(
payment.memo,
payment.payment_hash,
)
await set_ticket_paid(payment.payment_hash)
return