@@ -73,8 +73,6 @@ jobs:
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
apt update && apt install -y gettext-base
|
||||
|
||||
# Экспортируем все секреты как env-переменные
|
||||
while IFS= read -r -d '' entry; do
|
||||
key="${entry%%=*}"
|
||||
@@ -103,7 +101,7 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
envsubst < "$src" > "$dst"
|
||||
perl -pe 's/\$\{(\w+)\}/exists $ENV{$1} ? $ENV{$1} : ""/ge' "$src" > "$dst"
|
||||
}
|
||||
|
||||
render config.template.yaml config.rendered.yaml
|
||||
|
||||
@@ -241,9 +241,23 @@ async def handle_tbank_payment_notification(
|
||||
notification: TBankPaymentNotification,
|
||||
service: AggregatorService = Depends(get_aggregator_service),
|
||||
) -> PlainTextResponse:
|
||||
logger.info(
|
||||
"tbank_notification_received",
|
||||
order_id=notification.OrderId,
|
||||
status=notification.Status,
|
||||
success=notification.Success,
|
||||
payment_id=notification.PaymentId,
|
||||
error_code=notification.ErrorCode,
|
||||
amount=notification.Amount,
|
||||
)
|
||||
try:
|
||||
response_body = await service.handle_tbank_payment_notification(notification)
|
||||
except InvalidTBankPaymentNotificationError as exc:
|
||||
logger.warning(
|
||||
"tbank_notification_rejected",
|
||||
order_id=notification.OrderId,
|
||||
reason="invalid_token",
|
||||
)
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_400_BAD_REQUEST,
|
||||
detail={
|
||||
@@ -252,6 +266,11 @@ async def handle_tbank_payment_notification(
|
||||
},
|
||||
) from exc
|
||||
except TBankPaymentNotificationProcessingError as exc:
|
||||
logger.error(
|
||||
"tbank_notification_processing_failed",
|
||||
order_id=notification.OrderId,
|
||||
exc_info=True,
|
||||
)
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_503_SERVICE_UNAVAILABLE,
|
||||
detail={
|
||||
@@ -260,6 +279,11 @@ async def handle_tbank_payment_notification(
|
||||
},
|
||||
) from exc
|
||||
except AggregatorServiceError as exc:
|
||||
logger.error(
|
||||
"tbank_notification_processing_failed",
|
||||
order_id=notification.OrderId,
|
||||
exc_info=True,
|
||||
)
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_503_SERVICE_UNAVAILABLE,
|
||||
detail={
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user