Enhance payment processing and user detail updates in YooKassa integration

- Added handling for 'waiting_for_capture' event in the YooKassa webhook to manage bind-only payment flows, including saving payment methods and canceling authorizations.
- Introduced a new method in the YooKassaService to cancel payments, improving error handling and logging for payment cancellations.
- Updated user detail synchronization to conditionally update descriptions only when they differ from the current panel state, enhancing efficiency.
This commit is contained in:
machka-pasla
2025-09-04 16:30:45 +03:00
parent e0e2cde9a7
commit 257597ccb7
3 changed files with 46 additions and 1 deletions
+4 -1
View File
@@ -144,7 +144,10 @@ async def perform_sync(panel_service: PanelApiService, session: AsyncSession,
existing_user.first_name or "",
existing_user.last_name or "",
])
if description_text.strip():
# Update description only when it differs from the current one on panel
current_panel_description = (panel_user_dict.get("description") or "").strip()
desired_description = description_text.strip()
if desired_description and desired_description != current_panel_description:
await panel_service.update_user_details_on_panel(
panel_uuid, {"description": description_text}
)