fix: separate HWID device renewal flows

Keep one-off device top-ups scoped to the active subscription term and move device renewal into subscription checkout.

Carry HWID renewal metadata through provider callbacks and webhooks, including YooKassa saved-card flows.

Add admin extension controls, docs, demo data, and regression coverage.
This commit is contained in:
3252a8
2026-06-03 23:51:46 +03:00
parent a06884d816
commit fbb89793cb
48 changed files with 2410 additions and 224 deletions
+21 -6
View File
@@ -948,20 +948,32 @@
"buy_hwid_devices_menu_button": "+ HWID devices",
"buy_hwid_devices_button": "+{count} HWID for {price} {currency_symbol}",
"select_hwid_device_package": "Select HWID device package:",
"select_hwid_device_renewal_package": "Select an HWID device package for the new subscription period. Your current top-up is valid until {date}.",
"select_hwid_device_renewal_package": "Purchased HWID devices are renewed together with subscription renewal. Your current top-up is valid until {date}.",
"choose_payment_method_hwid_devices": "Choose a payment method for extra HWID devices:",
"payment_hwid_renewal_toggle_on": "✅ Also renew +{count} HWID devices for {price} {currency_symbol}",
"payment_hwid_renewal_toggle_off": "☐ Renew +{count} HWID devices for {price} {currency_symbol}",
"no_hwid_device_packages_available": "Extra HWID devices are not configured for this tariff.",
"hwid_devices_unlimited_no_topup": "Your device limit is already unlimited.",
"payment_description_hwid_devices": "Extra HWID devices +{count}",
"payment_successful_hwid_devices_renewal_note": "You currently have +{count} extra HWID devices valid until {date}. Buy them again if you need them for the renewed subscription period.",
"subscription_hwid_renewal_reminder": "You have +{count} extra HWID devices valid until {date}. Renewing the subscription does not renew the device top-up automatically.",
"payment_successful_hwid_devices_renewal_note": "Your +{count} extra HWID devices are valid until {date}. To keep them for the next period, enable device renewal while renewing the subscription.",
"payment_successful_hwid_devices_renewed_note": "Your +{count} extra HWID devices were renewed with the subscription until {date}.",
"subscription_hwid_renewal_reminder": "You have +{count} extra HWID devices valid until {date}. When renewing the subscription, you can include these devices in the same payment.",
"wa_buy_hwid_devices": "Buy devices",
"wa_device_topup_for_tariff": "Device packages for {tariff}",
"wa_hwid_devices_package": "+{count} devices",
"wa_hwid_devices_renewal_package": "Renew +{count} devices",
"wa_hwid_devices_active_until": "Active until {date}",
"wa_hwid_devices_renewal_period": "From {from} to {to}",
"wa_hwid_devices_valid_until": "+{count} extra devices are valid until {date}",
"wa_hwid_devices_renewal_notice": "Your +{count} extra devices are valid until {date}. Renewing the subscription does not renew them automatically.",
"wa_hwid_devices_renewal_offer": "Your current +{count} device top-up is valid until {date}. Choose a package to renew devices for the new subscription period.",
"wa_hwid_devices_renewal_prompt": "Subscription renewed. Buy devices again for the new period.",
"wa_hwid_devices_renewal_notice": "Your +{count} extra devices are valid until {date}. You can renew them together with the subscription.",
"wa_hwid_devices_renewal_checkbox": "Also renew +{count} extra devices for {price}",
"wa_hwid_devices_renewal_checkbox_aria": "Renew extra devices with the subscription",
"wa_hwid_devices_renewal_checkbox_hint": "New device period: from {from} to {to}",
"wa_hwid_devices_renewal_checkbox_hint_short": "Devices will be renewed for the new subscription period",
"wa_hwid_devices_desync_notice": "The current device top-up is valid until {date}; before the new period starts, the limit may return to the base tariff limit.",
"wa_hwid_devices_renewal_offer": "Your current +{count} device top-up is valid until {date}. Device renewal is handled together with subscription renewal.",
"wa_hwid_devices_renewal_prompt": "Subscription renewed. If devices were not renewed with it, the current device top-up remains valid until its own end date.",
"wa_hwid_devices_renewal_unavailable": "You currently have +{count} extra devices valid until {date}. Device renewal is not available for the selected payment method or tariff.",
"wa_no_hwid_device_options": "No device packages available",
"wa_device_topup_options_failed": "Could not load device packages",
"admin_nav_overview": "Overview",
@@ -1392,6 +1404,9 @@
"admin_user_btn_reset_trial": "Reset Trial",
"admin_user_label_extend": "Extend Subscription",
"admin_user_label_extend_days": "Days",
"admin_user_extend_hwid_devices": "Also extend +{count} HWID devices",
"admin_user_extend_hwid_devices_aria": "Extend purchased HWID devices",
"admin_user_extend_hwid_devices_hint": "Active device top-ups will receive the same number of extra days.",
"admin_user_btn_extend": "Extend",
"admin_user_label_telegram_msg": "Telegram Message",
"admin_user_hint_telegram_msg": "Telegram HTML formatting supported",