From af27154d8d0c0a892c802e58f7f7df34474a3d3a Mon Sep 17 00:00:00 2001 From: Martin Gross Date: Wed, 29 Jun 2022 16:38:34 +0200 Subject: [PATCH] PP/PPv2: Fix display of retry-message on pending captures (Fixes: PRETIXEU-6ZF) --- src/pretix/plugins/paypal/payment.py | 2 +- src/pretix/plugins/paypal2/payment.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pretix/plugins/paypal/payment.py b/src/pretix/plugins/paypal/payment.py index 16931a44bc..f2b18fbff7 100644 --- a/src/pretix/plugins/paypal/payment.py +++ b/src/pretix/plugins/paypal/payment.py @@ -473,7 +473,7 @@ class Paypal(BasePaymentProvider): and payment.info_data['transactions'][0]['related_resources'][0]['sale']['state'] == 'pending' ): retry = False - except KeyError: + except (KeyError, IndexError): pass template = get_template('pretixplugins/paypal/pending.html') ctx = {'request': request, 'event': self.event, 'settings': self.settings, diff --git a/src/pretix/plugins/paypal2/payment.py b/src/pretix/plugins/paypal2/payment.py index 52526ebe00..15af77818c 100644 --- a/src/pretix/plugins/paypal2/payment.py +++ b/src/pretix/plugins/paypal2/payment.py @@ -703,7 +703,7 @@ class PaypalMethod(BasePaymentProvider): and payment.info_data['purchase_units'][0]['payments']['captures'][0]['status'] == 'pending' ): retry = False - except KeyError: + except (KeyError, IndexError): pass template = get_template('pretixplugins/paypal2/pending.html') ctx = {'request': request, 'event': self.event, 'settings': self.settings,