From 6e1b293b9315fb394b51fe47ce199b5238bb35e3 Mon Sep 17 00:00:00 2001 From: Tiago Vasconcelos Date: Fri, 19 Apr 2024 14:19:33 +0100 Subject: [PATCH] Check payment 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}