mirror of
https://github.com/lnbits/lnbits.git
synced 2025-07-12 22:12:41 +02:00
revert b7ed7fab59
This commit is contained in:
@ -345,7 +345,7 @@ async def api_payments_sse():
|
|||||||
message = [f"event: {typ}".encode("utf-8")]
|
message = [f"event: {typ}".encode("utf-8")]
|
||||||
|
|
||||||
if data:
|
if data:
|
||||||
jdata = json.dumps(dict(data._asdict(), pending=False), default=str)
|
jdata = json.dumps(dict(data._asdict(), pending=False))
|
||||||
message.append(f"data: {jdata}".encode("utf-8"))
|
message.append(f"data: {jdata}".encode("utf-8"))
|
||||||
|
|
||||||
yield b"\n".join(message) + b"\r\n\r\n"
|
yield b"\n".join(message) + b"\r\n\r\n"
|
||||||
|
@ -26,10 +26,12 @@ async def on_invoice_paid(payment: Payment) -> None:
|
|||||||
# not a lnticket invoice
|
# not a lnticket invoice
|
||||||
return
|
return
|
||||||
|
|
||||||
ticket = await get_ticket(payment.payment_hash)
|
ticket = await get_ticket(payment.checking_id)
|
||||||
if not ticket:
|
if not ticket:
|
||||||
print("this should never happen", payment)
|
print("this should never happen", payment)
|
||||||
return
|
return
|
||||||
|
|
||||||
await payment.set_pending(False)
|
await payment.set_pending(False)
|
||||||
await set_ticket_paid(payment.payment_hash)
|
await set_ticket_paid(payment.payment_hash)
|
||||||
|
_ticket = await get_ticket(payment.checking_id)
|
||||||
|
print("ticket", _ticket)
|
||||||
|
@ -92,6 +92,7 @@ async def api_tickets():
|
|||||||
|
|
||||||
if "all_wallets" in request.args:
|
if "all_wallets" in request.args:
|
||||||
wallet_ids = (await get_user(g.wallet.user)).wallet_ids
|
wallet_ids = (await get_user(g.wallet.user)).wallet_ids
|
||||||
|
|
||||||
return (
|
return (
|
||||||
jsonify([form._asdict() for form in await get_tickets(wallet_ids)]),
|
jsonify([form._asdict() for form in await get_tickets(wallet_ids)]),
|
||||||
HTTPStatus.OK,
|
HTTPStatus.OK,
|
||||||
|
Reference in New Issue
Block a user