Apply suggestions from code review

Co-authored-by: pajowu <pajowu@pajowu.de>
This commit is contained in:
Lukas Bockstaller
2026-08-13 12:39:15 +02:00
committed by GitHub
co-authored by pajowu
parent d85a2c877e
commit 33d1b47c5a
4 changed files with 7 additions and 11 deletions
+3 -7
View File
@@ -199,7 +199,7 @@ class PaypalSettingsHolder(BasePaymentProvider):
help_text=_(
'PayPals fraud prevention might block processing of individual payments for a considerable amount '
'of time. The payment is marked as "pending" during this time window. You can allow your customers to '
'start another payment attempts during that window. This might result in overpayment of orders if the'
'start another payment attempts during that window. This might result in them being charged twice if the'
'original payment is approved.'
),
required=False
@@ -893,11 +893,7 @@ class PaypalMethod(BasePaymentProvider):
def payment_pending_render(self, request, payment) -> str:
stuck_in_compliance = False
retry = True
if payment.state == OrderPayment.PAYMENT_STATE_PENDING:
retry = self.abort_pending_payment_allowed(payment) and self.abort_pending_allowed
retry = self.payment_abort_pending_allowed(payment)
try:
if (
payment.info
@@ -908,7 +904,7 @@ class PaypalMethod(BasePaymentProvider):
pass
try:
if payment.info and payment.info_data['status'] == "APPROVED":
if payment.info_data.get('status') == "APPROVED":
stuck_in_compliance = True
except (KeyError):
pass