From 082f5e748813b9cce0306a62cca33af4dd03a96f Mon Sep 17 00:00:00 2001 From: Tiago Vasconcelos Date: Mon, 6 May 2024 12:41:35 +0100 Subject: [PATCH] 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}