forked from CGM_Public/pretix_original
Gracefully handle PayPal exceptions
This commit is contained in:
@@ -177,7 +177,7 @@ class Paypal(BasePaymentProvider):
|
|||||||
logger.error('Error on creating payment: ' + str(payment.error))
|
logger.error('Error on creating payment: ' + str(payment.error))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
messages.error(request, _('We had trouble communicating with PayPal'))
|
messages.error(request, _('We had trouble communicating with PayPal'))
|
||||||
logger.error('Error on creating payment: ' + str(e))
|
logger.exception('Error on creating payment: ' + str(e))
|
||||||
|
|
||||||
def checkout_confirm_render(self, request) -> str:
|
def checkout_confirm_render(self, request) -> str:
|
||||||
"""
|
"""
|
||||||
@@ -231,7 +231,11 @@ class Paypal(BasePaymentProvider):
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
payment.execute({"payer_id": request.session.get('payment_paypal_payer')})
|
try:
|
||||||
|
payment.execute({"payer_id": request.session.get('payment_paypal_payer')})
|
||||||
|
except Exception as e:
|
||||||
|
messages.error(request, _('We had trouble communicating with PayPal'))
|
||||||
|
logger.exception('Error on creating payment: ' + str(e))
|
||||||
|
|
||||||
payment_obj.refresh_from_db()
|
payment_obj.refresh_from_db()
|
||||||
if payment.state == 'pending':
|
if payment.state == 'pending':
|
||||||
|
|||||||
Reference in New Issue
Block a user