mirror of
https://github.com/pretix/pretix.git
synced 2026-05-03 14:54:04 +00:00
PayPal: Add additional error handling for old SDK (PRETIXEU-77B)
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user