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", 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}