PP/PPv2: Fix display of retry-message on pending captures

This commit is contained in:
Martin Gross
2022-06-29 15:41:52 +02:00
parent 20e281d0a4
commit 7f0604ff8b
2 changed files with 8 additions and 2 deletions

View File

@@ -468,7 +468,10 @@ class Paypal(BasePaymentProvider):
def payment_pending_render(self, request, payment) -> str:
retry = True
try:
if payment.info and payment.info_data['state'] == 'pending':
if (
payment.info
and payment.info_data['transactions'][0]['related_resources'][0]['sale']['state'] == 'pending'
):
retry = False
except KeyError:
pass