логи для нотификации tbank
Deploy / deploy (push) Successful in 56s

This commit is contained in:
Раис Юсупалиев
2026-06-20 00:26:48 +03:00
parent 65c07f1da3
commit cbcd9ca1bc
3 changed files with 45 additions and 3 deletions
+20
View File
@@ -425,6 +425,10 @@ class AggregatorService:
try:
self._payment_adapter.verify_payment_notification(notification)
except TBankPaymentNotificationTokenError as exc:
logger.warning(
"tbank_notification_token_invalid",
order_id=notification.OrderId,
)
raise InvalidTBankPaymentNotificationError(
"TBank payment notification token is invalid."
) from exc
@@ -438,6 +442,12 @@ class AggregatorService:
success=notification.Success,
error_code=notification.ErrorCode,
)
logger.info(
"tbank_notification_action_resolved",
order_id=notification.OrderId,
status=notification.Status,
action=action.name,
)
order = await self._load_order_and_mark_payment_status(notification)
if action is TBankPaymentNotificationAction.ACKNOWLEDGE_ONLY:
@@ -445,6 +455,11 @@ class AggregatorService:
provider = self._resolve_order_provider(order)
if self._has_existing_registration(order, provider):
logger.info(
"tbank_notification_registration_skipped_duplicate",
order_id=notification.OrderId,
provider=provider,
)
return "OK"
registration_result = await self._register_provider_order(
@@ -455,6 +470,11 @@ class AggregatorService:
provider=provider,
result=registration_result,
)
logger.info(
"tbank_notification_order_registered",
order_id=notification.OrderId,
provider=provider,
)
await self._send_payment_confirmation_email(
order, order_uuid=notification.OrderId
)