Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: multiple paypal refund transactions bug #313

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions commerce_coordinator/apps/commercetools/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@
try:
payment = client.get_payment_by_transaction_interaction_id(paypal_capture_id)
if has_full_refund_transaction(payment):
logger.info(f"PayPal payment.capture.refunded event received, but Payment with ID {payment.id} "
f"already has a refund with id:{refund.id}. Skipping task to add refund transaction.")
logger.info(f"PayPal PAYMENT.CAPTURE.REFUNDED event received, but Payment with ID {payment.id} "

Check failure on line 92 in commerce_coordinator/apps/commercetools/tasks.py

View workflow job for this annotation

GitHub Actions / tests (ubuntu-20.04, 3.12, django42)

Missing coverage

Missing coverage on line 92
f"already has a refund with ID: {refund.get('id')}. Skipping task to add refund transaction.")
return None
updated_payment = client.create_return_payment_transaction(
payment_id=payment.id,
Expand All @@ -101,6 +101,6 @@
return updated_payment
except CommercetoolsError as err:
logger.error(f"Unable to create refund transaction for payment {payment.key} "
f"on PayPal refund {refund.id} "
f"on PayPal refund {refund.get('id')} "
f"with error {err.errors} and correlation id {err.correlation_id}")
return None
Loading