From 948952875cf87468922239da4672437c76fffca2 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Mon, 12 Sep 2022 12:57:21 +0200 Subject: [PATCH] PayPal: Add additional error handling for old SDK (PRETIXEU-77B) --- src/pretix/plugins/paypal/payment.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pretix/plugins/paypal/payment.py b/src/pretix/plugins/paypal/payment.py index f2b18fbff7..6455dea334 100644 --- a/src/pretix/plugins/paypal/payment.py +++ b/src/pretix/plugins/paypal/payment.py @@ -51,6 +51,7 @@ from django.utils.translation import gettext as __, gettext_lazy as _ from i18nfield.strings import LazyI18nString from paypalrestsdk.exceptions import BadRequest, UnauthorizedAccess from paypalrestsdk.openid_connect import Tokeninfo +from requests import RequestException from pretix.base.decimal import round_decimal from pretix.base.models import Event, Order, OrderPayment, OrderRefund, Quota @@ -423,6 +424,9 @@ class Paypal(BasePaymentProvider): except paypalrestsdk.exceptions.ConnectionError as e: messages.error(request, _('We had trouble communicating with PayPal')) logger.exception('Error on creating payment: ' + str(e)) + except RequestException as e: + messages.error(request, _('We had trouble communicating with PayPal')) + logger.exception('Error on creating payment: ' + str(e)) for trans in payment.transactions: for rr in trans.related_resources: