From 082f5e748813b9cce0306a62cca33af4dd03a96f Mon Sep 17 00:00:00 2001 From: Tiago Vasconcelos Date: Mon, 6 May 2024 12:41:35 +0100 Subject: [PATCH 1/2] Check payment (#28) Hotfix the check payment when using fiat tickets --- views_api.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/views_api.py b/views_api.py index c539e9f..a2ba637 100644 --- a/views_api.py +++ b/views_api.py @@ -179,9 +179,10 @@ async def api_ticket_send_ticket(event_id, payment_hash): else await fiat_amount_as_satoshis(event.price_per_ticket, event.currency) * 1000 ) - if ( - not payment.pending and abs(price - payment.amount) < price * 0.01 - ): # allow 1% error + # check if price is equal to payment.amount + lower_bound = price * 0.99 # 1% decrease + + if not payment.pending and abs(payment.amount) >= lower_bound: # allow 1% error await set_ticket_paid(payment_hash) return {"paid": True, "ticket_id": ticket.id} From 9c82d9e2df4ce080ca3c7fe2d4bab239ba9710ef Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Tue, 14 May 2024 11:37:27 +0300 Subject: [PATCH 2/2] chore: bump `min_lnbits_version` --- config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.json b/config.json index ac52a89..94c9a8a 100644 --- a/config.json +++ b/config.json @@ -2,7 +2,7 @@ "name": "Events", "short_description": "Sell and register event tickets", "tile": "/events/static/image/events.png", - "min_lnbits_version": "0.11.0", + "min_lnbits_version": "0.12.5", "contributors": [ { "name": "talvasconcelos",