diff --git a/bot/handlers/user/payment.py b/bot/handlers/user/payment.py index 3c3ee9e..0dcfba8 100644 --- a/bot/handlers/user/payment.py +++ b/bot/handlers/user/payment.py @@ -170,6 +170,18 @@ async def process_successful_payment(session: AsyncSession, bot: Bot, card_last4=display_last4, card_network=display_network, ) + try: + await user_billing_dal.upsert_user_payment_method( + session, + user_id=user_id, + provider_payment_method_id=pm_id, + provider="yookassa", + card_last4=display_last4, + card_network=display_network, + set_default=True, + ) + except Exception: + logging.exception("Failed to persist multi-card YooKassa method from webhook") except Exception: logging.exception("Failed to persist YooKassa payment method from webhook") updated_payment_record = await payment_dal.update_payment_status_by_db_id(