PPv2: Fix incomplete validation of capture status

This commit is contained in:
Raphael Michel
2022-12-20 14:53:43 +01:00
parent 8be09ee937
commit c4aed04a18
2 changed files with 23 additions and 6 deletions

View File

@@ -698,7 +698,7 @@ class PaypalMethod(BasePaymentProvider):
except ReferencedPayPalObject.MultipleObjectsReturned:
pass
if capture.status == 'PENDING':
if capture.status != 'COMPLETED':
messages.warning(request, _('PayPal has not yet approved the payment. We will inform you as '
'soon as the payment completed.'))
payment.info = json.dumps(pp_captured_order.dict())