mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
PPv2: ISU: Retry up to three times to retrieve connected merchant information before failing.
This commit is contained in:
@@ -212,8 +212,16 @@ def isu_return(request, *args, **kwargs):
|
||||
)
|
||||
response = prov.client.execute(req)
|
||||
except IOError as e:
|
||||
messages.error(request, _('An error occurred during connecting with PayPal, please try again.'))
|
||||
logger.exception('PayPal PartnersMerchantIntegrationsGetRequest: {}'.format(str(e)))
|
||||
retry = request.GET.get('retry', 0)
|
||||
retry = int(retry)
|
||||
if retry < 3:
|
||||
params = request.GET.copy()
|
||||
params['retry'] = retry + 1
|
||||
logger.exception('PayPal PartnersMerchantIntegrationsGetRequest: {}; Retrying.'.format(str(e)))
|
||||
return redirect('{}?{}'.format(request.path, params.urlencode()))
|
||||
else:
|
||||
messages.error(request, _('An error occurred during connecting with PayPal, please try again.'))
|
||||
logger.exception('PayPal PartnersMerchantIntegrationsGetRequest: {}'.format(str(e)))
|
||||
else:
|
||||
params = ['merchant_id', 'tracking_id', 'payments_receivable', 'primary_email_confirmed']
|
||||
if not any(k in response.result for k in params):
|
||||
|
||||
Reference in New Issue
Block a user