Merge remote-tracking branch 'origin/main' into advanceddescription
This commit is contained in:
commit
57f40b9790
2 changed files with 5 additions and 4 deletions
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue