From 322a730eb224ee71190ede7aeca5e0921fd66f97 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Tue, 29 Aug 2023 15:06:03 +0200 Subject: [PATCH] PayPal: Fix incorrect Decimal comparison --- src/pretix/plugins/paypal2/payment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pretix/plugins/paypal2/payment.py b/src/pretix/plugins/paypal2/payment.py index 890bd902fe..6d2757bedb 100644 --- a/src/pretix/plugins/paypal2/payment.py +++ b/src/pretix/plugins/paypal2/payment.py @@ -615,7 +615,7 @@ class PaypalMethod(BasePaymentProvider): ReferencedPayPalObject.objects.get_or_create(order=payment.order, payment=payment, reference=pp_captured_order.id) except ReferencedPayPalObject.MultipleObjectsReturned: pass - if str(pp_captured_order.purchase_units[0].amount.value) != str(payment.amount) or \ + if Decimal(pp_captured_order.purchase_units[0].amount.value) != payment.amount or \ pp_captured_order.purchase_units[0].amount.currency_code != self.event.currency: logger.error('Value mismatch: Payment %s vs paypal trans %s' % (payment.id, str(pp_captured_order.dict()))) raise PaymentException(_('We were unable to process your payment. See below for details on how to '