Skip to content

Commit 59ab5f8

Browse files
fix: multiple paypal refund transactions bug (#313)
1 parent 33d054c commit 59ab5f8

File tree

1 file changed

+3
-3
lines changed
  • commerce_coordinator/apps/commercetools

1 file changed

+3
-3
lines changed

commerce_coordinator/apps/commercetools/tasks.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ def refund_from_paypal_task(
8989
try:
9090
payment = client.get_payment_by_transaction_interaction_id(paypal_capture_id)
9191
if has_full_refund_transaction(payment):
92-
logger.info(f"PayPal payment.capture.refunded event received, but Payment with ID {payment.id} "
93-
f"already has a refund with id:{refund.id}. Skipping task to add refund transaction.")
92+
logger.info(f"PayPal PAYMENT.CAPTURE.REFUNDED event received, but Payment with ID {payment.id} "
93+
f"already has a refund with ID: {refund.get('id')}. Skipping task to add refund transaction.")
9494
return None
9595
updated_payment = client.create_return_payment_transaction(
9696
payment_id=payment.id,
@@ -101,6 +101,6 @@ def refund_from_paypal_task(
101101
return updated_payment
102102
except CommercetoolsError as err:
103103
logger.error(f"Unable to create refund transaction for payment {payment.key} "
104-
f"on PayPal refund {refund.id} "
104+
f"on PayPal refund {refund.get('id')} "
105105
f"with error {err.errors} and correlation id {err.correlation_id}")
106106
return None

0 commit comments

Comments
 (0)