From decc8b9141caa3010105b4cc6ff2b4d174afb4a3 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Sat, 4 Nov 2017 15:03:43 +0100 Subject: [PATCH] Fix TypeError on retrying stripe sofort payments --- src/pretix/plugins/stripe/payment.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/pretix/plugins/stripe/payment.py b/src/pretix/plugins/stripe/payment.py index bf6e284b73..c1fe0c127e 100644 --- a/src/pretix/plugins/stripe/payment.py +++ b/src/pretix/plugins/stripe/payment.py @@ -743,9 +743,10 @@ class StripeSofort(StripeMethod): def order_can_retry(self, order): try: - d = json.loads(order.payment_info) + if order.payment_info: + d = json.loads(order.payment_info) + if d.get('object') == 'charge' and d.get('status') == 'pending': + return False except ValueError: - return self._is_still_available(order=order) - return not ( - d.get('object') == 'charge' and d.get('status') == 'pending' - ) + pass + return self._is_still_available(order=order)