From 3b76ae48fd896d7ed8af27c7711d502d8dcc5e2e Mon Sep 17 00:00:00 2001 From: Lukas Bockstaller Date: Fri, 6 Mar 2026 16:56:15 +0100 Subject: [PATCH] adds safeguard to prevent empty giftcard transactions on giftcards of value 0.00 --- src/pretix/base/payment.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pretix/base/payment.py b/src/pretix/base/payment.py index 31b97526d..ef550bc33 100644 --- a/src/pretix/base/payment.py +++ b/src/pretix/base/payment.py @@ -1626,6 +1626,8 @@ class GiftCardPayment(BasePaymentProvider): raise PaymentException(_("This gift card does not support this currency.")) if not gc.accepted_by(self.event.organizer): raise PaymentException(_("This gift card is not accepted by this event organizer.")) + if gc.value <= Decimal("0.00"): + raise PaymentException(_("All credit on this gift card has been used.")) if payment.amount > gc.value: raise PaymentException(_("This gift card was used in the meantime. Please try again.")) if gc.testmode and not payment.order.testmode: