Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix check payment #28

Merged
merged 1 commit into from
May 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions views_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is abs required?

await set_ticket_paid(payment_hash)
return {"paid": True, "ticket_id": ticket.id}

Expand Down