From cdd1e0ae3aa246c771f5327ca561d275e5845d6b Mon Sep 17 00:00:00 2001 From: Ivo Branco Date: Fri, 19 Apr 2024 10:05:02 +0100 Subject: [PATCH] feat: log HandledProcessorResponse --- .../management/commands/retry_baskets_payed_in_paygate.py | 3 +++ paygate/processors.py | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/paygate/management/commands/retry_baskets_payed_in_paygate.py b/paygate/management/commands/retry_baskets_payed_in_paygate.py index 986ca48..d0ecb43 100644 --- a/paygate/management/commands/retry_baskets_payed_in_paygate.py +++ b/paygate/management/commands/retry_baskets_payed_in_paygate.py @@ -15,6 +15,9 @@ class Command(BaseCommand): """ Command that retries to receive the missing server callbacks from PayGate. + + Example to retry last 24 hours: + python manage.py retry_baskets_payed_in_paygate --delta_in_minutes=1440 """ help = """retries to receive the missing server callbacks from PayGate.""" diff --git a/paygate/processors.py b/paygate/processors.py index 017bd2a..dc0c6fd 100644 --- a/paygate/processors.py +++ b/paygate/processors.py @@ -471,7 +471,7 @@ def handle_processor_response(self, response, basket=None): basic_auth_pass=self.api_basic_auth_pass, ) logger.info( - "Search Transactions on PayGate received the response data: [%s]", + "Search Transactions on PayGate received the response data: %s", search_response_data, ) confirmed_payed_on_paygate = False @@ -505,13 +505,15 @@ def handle_processor_response(self, response, basket=None): # Save only a mask of the card card_number = paygate_transaction.get("CARD_MASKED_PAN", card_type) - return HandledProcessorResponse( + hpr = HandledProcessorResponse( transaction_id=transaction_id, total=total, currency=currency, card_number=card_number, card_type=card_type, ) + logger.info("HandledProcessorResponse is %s", hpr) + return hpr def issue_credit( self, order_number, basket, reference_number, amount, currency