Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(desktop): 恢复客户端计费业务门禁

liugaowei95aca3812799
diff --git a/apps/desktop/src/renderer/features/billing/BillingCheckoutDialog.tsx b/apps/desktop/src/renderer/features/billing/BillingCheckoutDialog.tsx
index af0c7a0dd5..02a7634e2d 100644
--- a/apps/desktop/src/renderer/features/billing/BillingCheckoutDialog.tsx
+++ b/apps/desktop/src/renderer/features/billing/BillingCheckoutDialog.tsx
@@ -1,14 +1,12 @@
-import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
+import { useEffect, useMemo, useState } from 'react';
import * as Dialog from '@radix-ui/react-dialog';
import * as QRCode from 'qrcode';
import { Check, CircleAlert, ExternalLink, LoaderCircle, RotateCcw, X } from 'lucide-react';
import { useTranslation } from 'react-i18next';
-import { useConfirmDialog } from '@/components/ui/confirm-dialog-provider';
import { Spinner } from '@/components/ui/spinner';
import { cn } from '@/lib/utils';
import { billingApi } from './api';
-import { formatBillingAmount as formatMoney } from './money';
import type { BillingCheckoutState } from './useBillingCheckout';
interface BillingCheckoutDialogProps {
@@ -31,8 +29,6 @@ export function BillingCheckoutDialog({
onCancel,
}: BillingCheckoutDialogProps) {
const { t } = useTranslation();
- const { confirm } = useConfirmDialog();
- const confirmationPendingRef = useRef(false);
const action = actionOf(state);
const [qrDataUrl, setQrDataUrl] = useState<string | null>(null);
const [remainingSeconds, setRemainingSeconds] = useState<number | null>(null);
@@ -94,44 +90,6 @@ export function BillingCheckoutDialog({
state.kind === 'TOPUP' &&
state.order !== null &&
(state.order.status === 'CREATED' || state.order.status === 'PENDING');
- const confirmOnce = useCallback(
- async (options: Parameters<typeof confirm>[0]) => {
- if (confirmationPendingRef.current) return false;
- confirmationPendingRef.current = true;
- try {
- return await confirm(options);
- } finally {
- confirmationPendingRef.current = false;
- }
- },
- [confirm],
- );
- const confirmCancel = async () => {
- if (!state.order) return;
- const accepted = await confirmOnce({
- title: t('billing.confirmActions.cancelPaymentTitle'),
- description: t('billing.confirmActions.cancelPaymentDescription', {
- amount: formatMoney(state.order.amount, state.order.currency),
- }),
- confirmText: t('billing.confirmActions.cancelPayment'),
- cancelText: t('billing.confirmActions.back'),
- });
- if (accepted) onCancel();
- };
- const confirmRetry = async () => {
- const accepted = await confirmOnce({
- title: t('billing.confirmActions.retryPaymentTitle'),
- description: state.order
- ? t('billing.confirmActions.retryPaymentDescription', {
- amount: formatMoney(state.order.amount, state.order.currency),
- })
- : t('billing.confirmActions.retryUnknownPaymentDescription'),
- confirmText: t('billing.confirmActions.retryPayment'),
- cancelText: t('billing.confirmActions.back'),
- autoFocusConfirm: true,
- });
- if (accepted) onRetry();
- };
return (
<Dialog.Root
@@ -139,10 +97,10 @@ export function BillingCheckoutDialog({
onOpenChange={(open) => !open && state.phase !== 'CREATING' && onClose()}
>
<Dialog.Portal>
- <Dialog.Overlay className="fixed inset-0 z-[9990] bg-[var(--overlay-modal)]" />
+ <Dialog.Overlay className="fixed inset-0 z-[10000] bg-[var(--overlay-modal)]" />
<Dialog.Content
className={cn(
- 'fixed left-1/2 top-1/2 z-[9991] w-[calc(100vw-40px)] max-w-[620px]',
+ 'fixed left-1/2 top-1/2 z-[10001] w-[calc(100vw-40px)] max-w-[620px]',
'-translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-xl',
'border border-[var(--border-default)] bg-[var(--surface-elevated)]',
'text-[var(--text-primary)] focus:outline-none',
@@ -277,7 +235,7 @@ export function BillingCheckoutDialog({
{canCancel && (
<button
type="button"
- onClick={() => void confirmCancel()}
+ onClick={onCancel}
className="h-9 rounded-full px-3 text-12 text-[var(--text-secondary)] transition-colors hover:bg-[var(--surface-hover-soft)]"
>
{t('billing.actions.cancelPayment')}
@@ -298,7 +256,7 @@ export function BillingCheckoutDialog({
{(state.phase === 'FAILED' || state.phase === 'EXPIRED') && canRetry && (
<button
type="button"
- onClick={() => void confirmRetry()}
+ onClick={onRetry}
className="inline-flex h-9 items-center gap-2 rounded-full bg-[var(--text-primary)] px-4 text-12 font-medium text-[var(--surface)]"
>
<RotateCcw size={14} />
diff --git a/apps/desktop/src/renderer/features/billing/BillingPage.tsx b/apps/desktop/src/renderer/features/billing/BillingPage.tsx
index 1027e70af5..126d300b9f 100644
--- a/apps/desktop/src/renderer/features/billing/BillingPage.tsx
+++ b/apps/desktop/src/renderer/features/billing/BillingPage.tsx
@@ -12,7 +12,6 @@ import {
} from 'lucide-react';
import { useTranslation } from 'react-i18next';
-import { useConfirmDialog } from '@/components/ui/confirm-dialog-provider';
import { Spinner } from '@/components/ui/spinner';
import { useAuth } from '@/contexts/AuthContext';
import { cn } from '@/lib/utils';
@@ -77,6 +76,15 @@ const SUPPORTED_SUBSCRIPTION_CAPABILITIES = new Set<BillingPurchaseOption['capab
'PROVIDER_MANAGED_SUBSCRIPTION',
]);
+const SUBSCRIPTION_PURCHASE_BLOCKING_STATUSES: BillingSubscription['status'][] = [
+ 'INCOMPLETE',
+ 'TRIALING',
+ 'ACTIVE',
+ 'PAST_DUE',
+ 'UNPAID',
+ 'PAUSED',
+];
+
function decimalParts(value: string): { value: bigint; scale: number } | null {
const match = /^(0|[1-9]\d{0,14})(?:\.(\d{1,9}))?$/.exec(value.trim());
if (!match) return null;
@@ -187,8 +195,6 @@ export function BillingPage() {
export function BillingSettingsSection({ accountId }: { accountId: string | null }) {
const { t } = useTranslation();
- const { confirm } = useConfirmDialog();
- const confirmationPendingRef = useRef(false);
const [catalog, setCatalog] = useState<BillingCatalog | null>(null);
const [catalogError, setCatalogError] = useState(false);
const [loadingCatalog, setLoadingCatalog] = useState(true);
@@ -302,18 +308,6 @@ export function BillingSettingsSection({ accountId }: { accountId: string | null
checkout.state.intent !== null &&
checkout.state.order === null &&
checkout.state.subscription === null;
- const confirmOnce = useCallback(
- async (options: Parameters<typeof confirm>[0]) => {
- if (confirmationPendingRef.current) return false;
- confirmationPendingRef.current = true;
- try {
- return await confirm(options);
- } finally {
- confirmationPendingRef.current = false;
- }
- },
- [confirm],
- );
const offers = useMemo<PurchasableOffer[]>(() => {
if (!catalog) return [];
@@ -391,10 +385,17 @@ export function BillingSettingsSection({ accountId }: { accountId: string | null
return null;
}, [customAmount, selected, t]);
+ const subscriptionPurchaseBlocked =
+ currentSubscription !== null &&
+ SUBSCRIPTION_PURCHASE_BLOCKING_STATUSES.includes(currentSubscription.status);
const canCheckout =
!checkout.recovering &&
selected !== null &&
selectedOption !== null &&
+ !(
+ selected.product.kind === 'SUBSCRIPTION' &&
+ (loadingSubscription || subscriptionError || subscriptionPurchaseBlocked)
+ ) &&
(!isCustomTopup(selected.offer) || (customAmount.length > 0 && amountError === null));
const planNameOf = useCallback(
@@ -412,6 +413,10 @@ export function BillingSettingsSection({ accountId }: { accountId: string | null
const currentPlan = currentSubscription?.effectivePlan ?? null;
const pendingPlanChange = currentSubscription?.pendingPlanChange ?? null;
+ const planChangeable =
+ currentSubscription?.status === 'ACTIVE' &&
+ !currentSubscription.cancelAtPeriodEnd &&
+ currentPlan?.offer.interval === 'MONTH';
const currentPlanFacts = useMemo(() => {
if (!currentSubscription) return null;
const plan = currentSubscription.effectivePlan;
@@ -426,17 +431,31 @@ export function BillingSettingsSection({ accountId }: { accountId: string | null
};
}, [currentSubscription, planNameOf, t]);
- // The server quote owns reachability and direction. The renderer only removes
- // the exact current offer because selecting it cannot express a change.
+ // UI candidates only. The quote is the authority on whether a target is
+ // actually reachable; this filter just avoids offering obviously invalid
+ // targets (other interval, same level, or another provider's offers).
const planChangeCandidates = useMemo<PlanChangeCandidate[]>(() => {
- if (!currentSubscription) return [];
+ if (!planChangeable || !currentPlan) return [];
+ const currentProvider = currentSubscription?.provider ?? null;
return subscriptionOffers
- .filter(({ offer }) => offer.code !== currentPlan?.offer.code)
+ .filter(
+ ({ product, offer }) =>
+ offer.interval === currentPlan.offer.interval &&
+ offer.code !== currentPlan.offer.code &&
+ product.level !== null &&
+ product.level !== currentPlan.product.level &&
+ (currentProvider === null ||
+ offer.purchaseOptions.some((option) => option.provider === currentProvider)),
+ )
.map(({ product, offer }) => ({
product,
offer,
+ direction:
+ (product.level ?? 0) > currentPlan.product.level
+ ? ('UPGRADE' as const)
+ : ('DOWNGRADE' as const),
}));
- }, [currentPlan?.offer.code, currentSubscription, subscriptionOffers]);
+ }, [subscriptionOffers, planChangeable, currentPlan, currentSubscription?.provider]);
const openPurchaseDialog = (kind: PurchaseKind) => {
resetSelection();
@@ -454,41 +473,8 @@ export function BillingSettingsSection({ accountId }: { accountId: string | null
setCustomAmount('');
};
- const submit = async () => {
+ const submit = () => {
if (!selected || !selectedOption || !canCheckout) return;
- const amount = formatMoney(
- isCustomTopup(selected.offer) ? customAmount.trim() : selected.offer.amount!,
- selected.offer.currency,
- );
- const accepted =
- selected.product.kind === 'CREDIT_TOPUP'
- ? await confirmOnce({
- title: t('billing.confirmActions.purchaseTopupTitle'),
- description: t('billing.confirmActions.purchaseTopupDescription', {
- product: selected.product.name,
- amount,
- provider: providerLabel(selectedOption.provider, t),
- }),
- confirmText: t('billing.confirmActions.purchaseTopup'),
- cancelText: t('billing.confirmActions.back'),
- autoFocusConfirm: true,
- })
- : await confirmOnce({
- title: t('billing.confirmActions.purchaseSubscriptionTitle', {
- plan: selected.product.name,
- }),
- description: t('billing.confirmActions.purchaseSubscriptionDescription', {
- price: amount,
- interval: selected.offer.interval
- ? t(`billing.intervals.${selected.offer.interval}`)
- : '',
- provider: providerLabel(selectedOption.provider, t),
- }),
- confirmText: t('billing.confirmActions.purchaseSubscription'),
- cancelText: t('billing.confirmActions.back'),
- autoFocusConfirm: true,
- });
- if (!accepted) return;
setSubscriptionDialogOpen(false);
setTopupDialogOpen(false);
if (selected.product.kind === 'CREDIT_TOPUP') {
@@ -523,19 +509,8 @@ export function BillingSettingsSection({ accountId }: { accountId: string | null
}
};
- const selectPlanChangeTarget = async (candidate: PlanChangeCandidate) => {
+ const selectPlanChangeTarget = (candidate: PlanChangeCandidate) => {
if (candidate.offer.interval === null) return;
- const accepted = await confirmOnce({
- title: t('billing.confirmActions.quotePlanChangeTitle'),
- description: t('billing.confirmActions.quotePlanChangeDescription', {
- current: currentPlanName ?? t('billing.settings.subscriptionCard.unnamedPlan'),
- target: candidate.product.name,
- }),
- confirmText: t('billing.confirmActions.quotePlanChange'),
- cancelText: t('billing.confirmActions.back'),
- autoFocusConfirm: true,
- });
- if (!accepted) return;
setPlanChangeTargetOpen(false);
void planChange.startQuote(candidate.offer.code, {
product: { code: candidate.product.code, level: candidate.product.level ?? 0 },
@@ -548,20 +523,6 @@ export function BillingSettingsSection({ accountId }: { accountId: string | null
});
};
- const cancelPendingPlanChange = async (pending: BillingPendingPlanChange) => {
- const accepted = await confirmOnce({
- title: t('billing.confirmActions.cancelPlanChangeTitle'),
- description: t('billing.confirmActions.cancelPlanChangeDescription', {
- target:
- planNameOf(pending.targetPlan?.product.code) ??
- t('billing.settings.subscriptionCard.unnamedPlan'),
- }),
- confirmText: t('billing.confirmActions.cancelPlanChange'),
- cancelText: t('billing.confirmActions.back'),
- });
- if (accepted) await planChange.cancelChange(pending.planChangeId);
- };
-
const closePlanChangeStatus = () => {
const phase = planChange.state.phase;
planChange.close();
@@ -627,6 +588,8 @@ export function BillingSettingsSection({ accountId }: { accountId: string | null
facts={currentPlanFacts}
loading={loadingSubscription}
error={subscriptionError}
+ planChangeable={planChangeable}
+ actionDisabled={loadingSubscription || subscriptionError}
pendingPlanChange={pendingPlanChange}
pendingTargetName={planNameOf(pendingPlanChange?.targetPlan?.product.code)}
onChangePlan={openPlanChange}
@@ -635,7 +598,7 @@ export function BillingSettingsSection({ accountId }: { accountId: string | null
if (pendingPlanChange) planChange.resumePending(pendingPlanChange);
}}
onCancelPending={() => {
- if (pendingPlanChange) void cancelPendingPlanChange(pendingPlanChange);
+ if (pendingPlanChange) void planChange.cancelChange(pendingPlanChange.planChangeId);
}}
/>
<TopupOverviewCard onPurchase={() => openPurchaseDialog('CREDIT_TOPUP')} />
@@ -652,13 +615,14 @@ export function BillingSettingsSection({ accountId }: { accountId: string | null
selectedPurchaseOptionId={selectedPurchaseOptionId}
customAmount={customAmount}
amountError={amountError}
+ subscriptionPurchaseBlocked={subscriptionPurchaseBlocked}
canCheckout={canCheckout}
onClose={closeSubscriptionDialog}
onRetry={() => void loadBillingState()}
onSelectOffer={selectOffer}
onSelectPurchaseOption={setSelectedPurchaseOptionId}
onCustomAmountChange={setCustomAmount}
- onSubmit={() => void submit()}
+ onSubmit={submit}
/>
<BillingOfferDialog
@@ -671,13 +635,14 @@ export function BillingSettingsSection({ accountId }: { accountId: string | null
selectedPurchaseOptionId={selectedPurchaseOptionId}
customAmount={customAmount}
amountError={amountError}
+ subscriptionPurchaseBlocked={false}
canCheckout={canCheckout}
onClose={closeTopupDialog}
onRetry={() => void loadBillingState()}
onSelectOffer={selectOffer}
onSelectPurchaseOption={setSelectedPurchaseOptionId}
onCustomAmountChange={setCustomAmount}
- onSubmit={() => void submit()}
+ onSubmit={submit}
/>
<BillingCheckoutDialog
@@ -775,6 +740,8 @@ function SubscriptionOverviewCard({
facts,
loading,
error,
+ planChangeable,
+ actionDisabled,
pendingPlanChange,
pendingTargetName,
onChangePlan,
@@ -785,6 +752,8 @@ function SubscriptionOverviewCard({
facts: CurrentPlanFacts | null;
loading: boolean;
error: boolean;
+ planChangeable: boolean;
+ actionDisabled: boolean;
pendingPlanChange: BillingPendingPlanChange | null;
pendingTargetName: string | null;
onChangePlan: () => void;
@@ -857,22 +826,14 @@ function SubscriptionOverviewCard({
)}
</div>
<div className="mt-5 flex flex-wrap gap-2">
- {facts && (
- <button
- type="button"
- onClick={onChangePlan}
- className="h-8 select-none rounded-full border border-[var(--border-default)] px-3.5 text-12 font-medium text-[var(--text-primary)] transition-colors hover:bg-[var(--surface-hover-soft)]"
- >
- {t('billing.settings.subscriptionCard.changeAction')}
- </button>
- )}
<button
type="button"
- onClick={onPurchase}
- className="h-8 select-none rounded-full border border-[var(--border-default)] px-3.5 text-12 font-medium text-[var(--text-primary)] transition-colors hover:bg-[var(--surface-hover-soft)]"
+ onClick={planChangeable ? onChangePlan : onPurchase}
+ disabled={actionDisabled}
+ className="h-8 select-none rounded-full border border-[var(--border-default)] px-3.5 text-12 font-medium text-[var(--text-primary)] transition-colors hover:bg-[var(--surface-hover-soft)] disabled:cursor-not-allowed disabled:opacity-40"
>
- {facts
- ? t('billing.settings.subscriptionCard.purchaseAnother')
+ {planChangeable
+ ? t('billing.settings.subscriptionCard.changeAction')
: t('billing.settings.subscriptionCard.action')}
</button>
</div>
@@ -1284,6 +1245,7 @@ function BillingOfferDialog({
selectedPurchaseOptionId,
customAmount,
amountError,
+ subscriptionPurchaseBlocked,
canCheckout,
onClose,
onRetry,
@@ -1301,6 +1263,7 @@ function BillingOfferDialog({
selectedPurchaseOptionId: string | null;
customAmount: string;
amountError: string | null;
+ subscriptionPurchaseBlocked: boolean;
canCheckout: boolean;
onClose: () => void;
onRetry: () => void;
@@ -1481,6 +1444,12 @@ function BillingOfferDialog({
</p>
</label>
)}
+
+ {kind === 'SUBSCRIPTION' && subscriptionPurchaseBlocked && (
+ <p className="mt-5 rounded-lg bg-[var(--surface-chip)] px-4 py-3 text-12 leading-5 text-[var(--text-secondary)]">
+ {t('billing.currentSubscription.purchaseBlocked')}
+ </p>
+ )}
</div>
)}
</>
diff --git a/apps/desktop/src/renderer/features/billing/PlanChangeDialog.tsx b/apps/desktop/src/renderer/features/billing/PlanChangeDialog.tsx
index 94681604e3..3acc4f6433 100644
--- a/apps/desktop/src/renderer/features/billing/PlanChangeDialog.tsx
+++ b/apps/desktop/src/renderer/features/billing/PlanChangeDialog.tsx
@@ -1,7 +1,9 @@
-import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
+import { useEffect, useMemo, useState } from 'react';
import * as Dialog from '@radix-ui/react-dialog';
import * as QRCode from 'qrcode';
import {
+ ArrowDownRight,
+ ArrowUpRight,
Check,
CircleAlert,
ExternalLink,
@@ -12,7 +14,6 @@ import {
} from 'lucide-react';
import { useTranslation } from 'react-i18next';
-import { useConfirmDialog } from '@/components/ui/confirm-dialog-provider';
import { Spinner } from '@/components/ui/spinner';
import { cn } from '@/lib/utils';
import type {
@@ -30,6 +31,8 @@ import type { PlanChangeState } from './usePlanChange';
export type PlanChangeCandidate = {
product: BillingCatalogProduct;
offer: BillingCatalogOffer;
+ /** UI hint only; the server quote is the authority on the change type. */
+ direction: 'UPGRADE' | 'DOWNGRADE';
};
function formatEffectiveDate(iso: string): string {
@@ -109,6 +112,8 @@ export function PlanChangeTargetDialog({
) : (
<div className="space-y-2.5">
{candidates.map((candidate) => {
+ const DirectionIcon =
+ candidate.direction === 'UPGRADE' ? ArrowUpRight : ArrowDownRight;
return (
<button
key={candidate.offer.code}
@@ -126,7 +131,10 @@ export function PlanChangeTargetDialog({
{candidate.product.name}
</p>
<p className="mt-1 inline-flex items-center gap-1 text-11 text-[var(--text-tertiary)]">
- {t('billing.planChange.serverDecisionHint')}
+ <DirectionIcon size={12} />
+ {candidate.direction === 'UPGRADE'
+ ? t('billing.planChange.upgradeBadge')
+ : t('billing.planChange.downgradeBadge')}
</p>
</div>
<div className="shrink-0 text-right">
@@ -191,8 +199,6 @@ export function PlanChangeStatusDialog({
onAbandon: () => void;
}) {
const { t } = useTranslation();
- const { confirm } = useConfirmDialog();
- const confirmationPendingRef = useRef(false);
const change = state.planChange;
const action: BillingPaymentAction | null = change?.paymentAction ?? null;
const [qrDataUrl, setQrDataUrl] = useState<string | null>(null);
@@ -257,59 +263,14 @@ export function PlanChangeStatusDialog({
state.phase === 'CANCELED' ||
state.phase === 'FAILED' ||
state.phase === 'EXPIRED';
- const confirmOnce = useCallback(
- async (options: Parameters<typeof confirm>[0]) => {
- if (confirmationPendingRef.current) return false;
- confirmationPendingRef.current = true;
- try {
- return await confirm(options);
- } finally {
- confirmationPendingRef.current = false;
- }
- },
- [confirm],
- );
- const confirmPlanChange = async () => {
- if (!change) return;
- const impact =
- change.changeType === 'UPGRADE'
- ? quotedAmount
- ? t('billing.planChange.upgradeDueNow', { amount: quotedAmount })
- : t('billing.planChange.upgradeNoAmount')
- : t('billing.planChange.downgradeAt', {
- date: formatEffectiveDate(change.effectiveAt),
- });
- const accepted = await confirmOnce({
- title: t('billing.confirmActions.confirmPlanChangeTitle'),
- description: t('billing.confirmActions.confirmPlanChangeDescription', {
- target: targetName ?? t('billing.settings.subscriptionCard.unnamedPlan'),
- impact,
- }),
- confirmText: t('billing.confirmActions.confirmPlanChange'),
- cancelText: t('billing.confirmActions.back'),
- autoFocusConfirm: true,
- });
- if (accepted) onConfirm();
- };
- const abandonPlanChange = async () => {
- const accepted = await confirmOnce({
- title: t('billing.confirmActions.cancelPlanChangeTitle'),
- description: t('billing.confirmActions.cancelPlanChangeDescription', {
- target: targetName ?? t('billing.settings.subscriptionCard.unnamedPlan'),
- }),
- confirmText: t('billing.confirmActions.cancelPlanChange'),
- cancelText: t('billing.confirmActions.back'),
- });
- if (accepted) onAbandon();
- };
return (
<Dialog.Root open={state.open} onOpenChange={(open) => !open && !busy && onClose()}>
<Dialog.Portal>
- <Dialog.Overlay className="fixed inset-0 z-[9990] bg-[var(--overlay-modal)]" />
+ <Dialog.Overlay className="fixed inset-0 z-[10000] bg-[var(--overlay-modal)]" />
<Dialog.Content
className={cn(
- 'fixed left-1/2 top-1/2 z-[9991] w-[calc(100vw-40px)] max-w-[600px]',
+ 'fixed left-1/2 top-1/2 z-[10001] w-[calc(100vw-40px)] max-w-[600px]',
'-translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-xl',
'border border-[var(--border-default)] bg-[var(--surface-elevated)]',
'text-[var(--text-primary)] focus:outline-none',
@@ -492,7 +453,7 @@ export function PlanChangeStatusDialog({
{state.phase === 'QUOTE_READY' && change?.status === 'QUOTED' && !state.stale && (
<button
type="button"
- onClick={() => void abandonPlanChange()}
+ onClick={onAbandon}
className="h-9 rounded-full px-3 text-12 text-[var(--text-secondary)] transition-colors hover:bg-[var(--surface-hover-soft)]"
>
{t('billing.planChange.abandon')}
@@ -517,7 +478,7 @@ export function PlanChangeStatusDialog({
{state.phase === 'QUOTE_READY' && change?.status === 'QUOTED' && !state.stale && (
<button
type="button"
- onClick={() => void confirmPlanChange()}
+ onClick={onConfirm}
className="inline-flex h-9 items-center gap-2 rounded-full bg-[var(--text-primary)] px-5 text-13 font-medium text-[var(--surface)]"
>
{t('billing.planChange.confirm')}
diff --git a/apps/desktop/src/renderer/features/billing/__tests__/BillingCheckoutDialog.test.tsx b/apps/desktop/src/renderer/features/billing/__tests__/BillingCheckoutDialog.test.tsx
deleted file mode 100644
index 4c4ad56ef1..0000000000
--- a/apps/desktop/src/renderer/features/billing/__tests__/BillingCheckoutDialog.test.tsx
+++ /dev/null
@@ -1,124 +0,0 @@
-// @vitest-environment jsdom
-
-import { fireEvent, render, screen, waitFor } from '@testing-library/react';
-import { beforeEach, describe, expect, it, vi } from 'vitest';
-
-const confirm = vi.hoisted(() => vi.fn());
-
-vi.mock('react-i18next', () => ({
- useTranslation: () => ({
- t: (key: string, params?: Record<string, string>) =>
- params ? `${key}:${JSON.stringify(params)}` : key,
- }),
-}));
-vi.mock('qrcode', () => ({
- toDataURL: vi.fn(async () => 'data:image/png;base64,fixture'),
-}));
-vi.mock('@/components/ui/confirm-dialog-provider', () => ({
- useConfirmDialog: () => ({ confirm }),
-}));
-
-import { BillingCheckoutDialog } from '../BillingCheckoutDialog';
-import type { BillingCheckoutState } from '../useBillingCheckout';
-
-function topupState(overrides: Partial<BillingCheckoutState> = {}): BillingCheckoutState {
- return {
- open: true,
- kind: 'TOPUP',
- phase: 'AWAITING_PAYMENT',
- intent: null,
- order: {
- orderId: 'order_fixture',
- productCode: 'credit_topup',
- offerCode: 'credit_topup_20',
- amount: '20',
- currency: 'cny',
- status: 'PENDING',
- fulfillmentStatus: 'NOT_STARTED',
- paymentAction: null,
- createdAt: '2026-01-01T00:00:00.000Z',
- updatedAt: '2026-01-01T00:01:00.000Z',
- },
- subscription: null,
- error: false,
- ...overrides,
- };
-}
-
-describe('BillingCheckoutDialog confirmations', () => {
- beforeEach(() => {
- confirm.mockReset().mockResolvedValue(true);
- });
-
- it('cancels a pending payment only after confirmation is accepted', async () => {
- confirm.mockResolvedValueOnce(false).mockResolvedValueOnce(true);
- const onCancel = vi.fn();
- render(
- <BillingCheckoutDialog
- state={topupState()}
- onClose={vi.fn()}
- onRefresh={vi.fn()}
- onRetry={vi.fn()}
- onCancel={onCancel}
- />,
- );
-
- fireEvent.click(screen.getByText('billing.actions.cancelPayment'));
- await waitFor(() => expect(confirm).toHaveBeenCalledTimes(1));
- expect(onCancel).not.toHaveBeenCalled();
-
- fireEvent.click(screen.getByText('billing.actions.cancelPayment'));
- await waitFor(() => expect(onCancel).toHaveBeenCalledTimes(1));
- expect(confirm).toHaveBeenLastCalledWith(
- expect.objectContaining({
- confirmText: 'billing.confirmActions.cancelPayment',
- }),
- );
- });
-
- it('retries an expired payment only after confirmation is accepted', async () => {
- const onRetry = vi.fn();
- render(
- <BillingCheckoutDialog
- state={topupState({
- phase: 'EXPIRED',
- order: {
- ...topupState().order!,
- status: 'EXPIRED',
- },
- })}
- onClose={vi.fn()}
- onRefresh={vi.fn()}
- onRetry={onRetry}
- onCancel={vi.fn()}
- />,
- );
-
- fireEvent.click(screen.getByText('billing.actions.retry'));
- expect(onRetry).not.toHaveBeenCalled();
- await waitFor(() => expect(onRetry).toHaveBeenCalledTimes(1));
- expect(confirm).toHaveBeenCalledWith(
- expect.objectContaining({
- confirmText: 'billing.confirmActions.retryPayment',
- autoFocusConfirm: true,
- }),
- );
- });
-
- it('refreshes payment status without confirmation', () => {
- const onRefresh = vi.fn();
- render(
- <BillingCheckoutDialog
- state={topupState()}
- onClose={vi.fn()}
- onRefresh={onRefresh}
- onRetry={vi.fn()}
- onCancel={vi.fn()}
- />,
- );
-
- fireEvent.click(screen.getByText('billing.actions.refresh'));
- expect(onRefresh).toHaveBeenCalledTimes(1);
- expect(confirm).not.toHaveBeenCalled();
- });
-});
diff --git a/apps/desktop/src/renderer/features/billing/__tests__/BillingPage.test.tsx b/apps/desktop/src/renderer/features/billing/__tests__/BillingPage.test.tsx
index 5b9a4ed51e..8ae79ccc86 100644
--- a/apps/desktop/src/renderer/features/billing/__tests__/BillingPage.test.tsx
+++ b/apps/desktop/src/renderer/features/billing/__tests__/BillingPage.test.tsx
@@ -4,7 +4,6 @@ import { fireEvent, render, screen, waitFor } from '@testing-library/react';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import type { BillingPaymentOrder, BillingSubscription } from '../../../../shared/billing';
-const confirm = vi.hoisted(() => vi.fn());
const checkout = {
state: {
open: false,
@@ -50,9 +49,6 @@ vi.mock('@/features/feature-context', () => ({
vi.mock('@/contexts/AuthContext', () => ({
useAuth: () => ({ dataOwnerId: 'account-fixture' }),
}));
-vi.mock('@/components/ui/confirm-dialog-provider', () => ({
- useConfirmDialog: () => ({ confirm }),
-}));
vi.mock('../useBillingCheckout', () => ({
useBillingCheckout: () => checkout,
}));
@@ -62,10 +58,6 @@ vi.mock('qrcode', () => ({
import { BillingPage } from '../BillingPage';
-beforeEach(() => {
- confirm.mockReset().mockResolvedValue(true);
-});
-
describe('BillingPage remote catalog rendering', () => {
beforeEach(() => {
Object.assign(checkout.state, {
@@ -344,7 +336,6 @@ describe('BillingPage remote catalog rendering', () => {
screen.getByText((text) => text.startsWith('billing.settings.subscriptionCard.renewsAt')),
).toBeTruthy();
expect(screen.getByText('billing.settings.subscriptionCard.changeAction')).toBeTruthy();
- expect(screen.getByText('billing.settings.subscriptionCard.purchaseAnother')).toBeTruthy();
});
it('shows an end date for period-end cancellation and omits invalid dates', async () => {
@@ -593,70 +584,10 @@ describe('BillingPage remote catalog rendering', () => {
expect(screen.queryByText('alipay')).toBeNull();
fireEvent.click(screen.getByText('stripe').closest('button')!);
fireEvent.click(screen.getByText('billing.actions.pay'));
- await waitFor(() =>
- expect(checkout.startSubscription).toHaveBeenCalledWith({
- offerCode: 'plus_month',
- purchaseOptionId: 'listing_stripe',
- }),
- );
- expect(confirm).toHaveBeenCalledWith(
- expect.objectContaining({
- confirmText: 'billing.confirmActions.purchaseSubscription',
- autoFocusConfirm: true,
- }),
- );
- });
-
- it('does not create a top-up when its confirmation is canceled', async () => {
- confirm.mockResolvedValue(false);
- render(<BillingPage />);
-
- fireEvent.click(screen.getByText('billing.settings.topupCard.action'));
- fireEvent.click((await screen.findByText('Configured top-up')).closest('button')!);
- fireEvent.click((await screen.findByText('alipay')).closest('button')!);
- fireEvent.change(screen.getByPlaceholderText('billing.amount.placeholder'), {
- target: { value: '10' },
+ expect(checkout.startSubscription).toHaveBeenCalledWith({
+ offerCode: 'plus_month',
+ purchaseOptionId: 'listing_stripe',
});
- fireEvent.click(screen.getByText('billing.actions.pay'));
-
- await waitFor(() => expect(confirm).toHaveBeenCalledTimes(1));
- expect(checkout.startTopup).not.toHaveBeenCalled();
- expect(screen.getByText('Configured top-up')).toBeTruthy();
- });
-
- it('queues only one confirmation when the payment action is double-clicked', async () => {
- let acceptConfirmation: ((value: boolean) => void) | null = null;
- confirm.mockReturnValue(
- new Promise<boolean>((resolve) => {
- acceptConfirmation = resolve;
- }),
- );
- render(<BillingPage />);
-
- fireEvent.click(screen.getByText('billing.settings.topupCard.action'));
- fireEvent.click((await screen.findByText('Configured top-up')).closest('button')!);
- fireEvent.click((await screen.findByText('alipay')).closest('button')!);
- fireEvent.change(screen.getByPlaceholderText('billing.amount.placeholder'), {
- target: { value: '10' },
- });
- const pay = screen.getByText('billing.actions.pay');
- fireEvent.click(pay);
- fireEvent.click(pay);
-
- expect(confirm).toHaveBeenCalledTimes(1);
- expect(checkout.startTopup).not.toHaveBeenCalled();
-
- acceptConfirmation!(true);
- await waitFor(() => expect(checkout.startTopup).toHaveBeenCalledTimes(1));
- });
-
- it('does not confirm read-only refresh actions', async () => {
- render(<BillingPage />);
- await screen.findByText('billing.balance.title');
-
- fireEvent.click(screen.getByText('billing.actions.refreshCatalog'));
- await waitFor(() => expect(window.electronAPI.billing.getCatalog).toHaveBeenCalledTimes(2));
- expect(confirm).not.toHaveBeenCalled();
});
it('keeps checkout disabled until startup recovery finishes', async () => {
@@ -680,7 +611,7 @@ describe('BillingPage remote catalog rendering', () => {
expect(pay).toHaveProperty('disabled', false);
});
- it('keeps new subscription purchase available while one is still live', async () => {
+ it('does not create a second subscription while one is still live', async () => {
window.electronAPI.billing.getCurrentSubscription = vi.fn(async () => ({
subscription: {
subscriptionId: 'subscription_fixture',
@@ -696,25 +627,18 @@ describe('BillingPage remote catalog rendering', () => {
}));
render(<BillingPage />);
- const purchaseAnother = await screen.findByText(
- 'billing.settings.subscriptionCard.purchaseAnother',
- );
- fireEvent.click(purchaseAnother);
+ fireEvent.click(await screen.findByText('billing.settings.subscriptionCard.action'));
fireEvent.click((await screen.findByText('Configured subscription')).closest('button')!);
fireEvent.click((await screen.findByText('stripe')).closest('button')!);
const pay = screen.getByText('billing.actions.pay').closest('button')!;
- expect(pay).toHaveProperty('disabled', false);
+ expect(pay).toHaveProperty('disabled', true);
+ expect(screen.getByText('billing.currentSubscription.purchaseBlocked')).toBeTruthy();
fireEvent.click(pay);
- await waitFor(() =>
- expect(checkout.startSubscription).toHaveBeenCalledWith({
- offerCode: 'plus_month',
- purchaseOptionId: 'listing_stripe',
- }),
- );
+ expect(checkout.startSubscription).not.toHaveBeenCalled();
});
- it('keeps subscription purchases available when subscription status is unavailable', async () => {
+ it('keeps subscription purchases disabled when subscription status is unavailable', async () => {
window.electronAPI.billing.getCurrentSubscription = vi.fn(async () => {
throw new Error('subscription status unavailable');
});
@@ -724,7 +648,7 @@ describe('BillingPage remote catalog rendering', () => {
expect(await screen.findByText('billing.settings.subscriptionCard.unavailable')).toBeTruthy();
expect(
screen.getByText('billing.settings.subscriptionCard.action').closest('button'),
- ).toHaveProperty('disabled', false);
+ ).toHaveProperty('disabled', true);
expect(screen.getByText('billing.settings.topupCard.action').closest('button')).toHaveProperty(
'disabled',
false,
@@ -776,7 +700,7 @@ describe('BillingPage remote catalog rendering', () => {
expect(screen.queryByText('Configured subscription')).toBeNull();
expect(
screen.getByText('billing.settings.subscriptionCard.action').closest('button'),
- ).toHaveProperty('disabled', false);
+ ).toHaveProperty('disabled', true);
});
it('renders multiple remote subscription offers as independent choices', async () => {
@@ -1043,7 +967,7 @@ describe('BillingPage plan change', () => {
});
});
- it('offers cross-provider plan targets and lets the server decide', async () => {
+ it('offers plan change for an active subscription with same-provider candidates only', async () => {
const billing = install(billingMocks());
billing.quotePlanChange.mockResolvedValue({
planChangeId: 'plan_change_1',
@@ -1061,18 +985,12 @@ describe('BillingPage plan change', () => {
await screen.findByText('billing.planChange.targetTitle');
expect(screen.getByText('Max plan')).toBeTruthy();
- expect(screen.getByText('Alipay-only Max')).toBeTruthy();
+ expect(screen.queryByText('Alipay-only Max')).toBeNull();
// The current plan renders in the summary card but must not be a candidate.
- expect(screen.getAllByText('billing.planChange.serverDecisionHint')).toHaveLength(2);
+ expect(screen.getByText('billing.planChange.upgradeBadge')).toBeTruthy();
fireEvent.click(screen.getByText('Max plan'));
await screen.findByText('billing.planChange.quoteTitle');
- expect(confirm).toHaveBeenCalledWith(
- expect.objectContaining({
- confirmText: 'billing.confirmActions.quotePlanChange',
- autoFocusConfirm: true,
- }),
- );
expect(billing.quotePlanChange).toHaveBeenCalledTimes(1);
expect(billing.quotePlanChange).toHaveBeenCalledWith({
targetOfferCode: 'max_month',
@@ -1094,18 +1012,12 @@ describe('BillingPage plan change', () => {
});
fireEvent.click(screen.getByText('billing.planChange.confirm'));
await screen.findByText('billing.planChange.appliedTitle');
- expect(confirm).toHaveBeenLastCalledWith(
- expect.objectContaining({
- confirmText: 'billing.confirmActions.confirmPlanChange',
- autoFocusConfirm: true,
- }),
- );
// APPLIED refreshes subscription, catalog, and balance exactly once more.
await waitFor(() => expect(billing.getBalance).toHaveBeenCalledTimes(2));
expect(billing.getCurrentSubscription).toHaveBeenCalledTimes(2);
});
- it('offers plan change for yearly subscriptions and lets the server decide', async () => {
+ it('does not expose plan change for yearly subscriptions while server v1 is monthly-only', async () => {
const billing = billingMocks();
billing.getCurrentSubscription = vi.fn(async () => ({
subscription: activeSubscription(null, 'YEAR'),
@@ -1115,9 +1027,8 @@ describe('BillingPage plan change', () => {
render(<BillingPage />);
await screen.findByText('Plus plan');
- fireEvent.click(screen.getByText('billing.settings.subscriptionCard.changeAction'));
- expect(await screen.findByText('Max plan')).toBeTruthy();
- expect(screen.getByText('Alipay-only Max')).toBeTruthy();
+ expect(screen.queryByText('billing.settings.subscriptionCard.changeAction')).toBeNull();
+ expect(screen.getByText('billing.settings.subscriptionCard.action')).toBeTruthy();
expect(billing.quotePlanChange).not.toHaveBeenCalled();
});
@@ -1159,11 +1070,6 @@ describe('BillingPage plan change', () => {
await waitFor(() =>
expect(billing.cancelPlanChange).toHaveBeenCalledWith({ planChangeId: 'plan_change_down' }),
);
- expect(confirm).toHaveBeenCalledWith(
- expect.objectContaining({
- confirmText: 'billing.confirmActions.cancelPlanChange',
- }),
- );
// The canceled settle re-syncs the subscription projection for the banner.
await waitFor(() => expect(billing.getCurrentSubscription).toHaveBeenCalledTimes(2));
});
diff --git a/apps/desktop/src/renderer/features/billing/__tests__/PlanChangeDialog.test.tsx b/apps/desktop/src/renderer/features/billing/__tests__/PlanChangeDialog.test.tsx
index 97fd0435bc..7896be8d54 100644
--- a/apps/desktop/src/renderer/features/billing/__tests__/PlanChangeDialog.test.tsx
+++ b/apps/desktop/src/renderer/features/billing/__tests__/PlanChangeDialog.test.tsx
@@ -1,9 +1,8 @@
// @vitest-environment jsdom
-import { fireEvent, render, screen, waitFor } from '@testing-library/react';
-import { beforeEach, describe, expect, it, vi } from 'vitest';
+import { fireEvent, render, screen } from '@testing-library/react';
+import { describe, expect, it, vi } from 'vitest';
-const confirm = vi.hoisted(() => vi.fn());
vi.mock('react-i18next', () => ({
useTranslation: () => ({
t: (key: string, params?: Record<string, string>) =>
@@ -13,9 +12,6 @@ vi.mock('react-i18next', () => ({
vi.mock('qrcode', () => ({
toDataURL: vi.fn(async () => 'data:image/png;base64,fixture'),
}));
-vi.mock('@/components/ui/confirm-dialog-provider', () => ({
- useConfirmDialog: () => ({ confirm }),
-}));
import { PlanChangeStatusDialog } from '../PlanChangeDialog';
import type { PlanChangeState } from '../usePlanChange';
@@ -42,10 +38,6 @@ function quoteReadyState(overrides: Partial<PlanChangeState> = {}): PlanChangeSt
}
describe('PlanChangeStatusDialog stale snapshot handling', () => {
- beforeEach(() => {
- confirm.mockReset().mockResolvedValue(true);
- });
-
it('lets a fresh quote be confirmed or abandoned', () => {
render(
<PlanChangeStatusDialog
@@ -111,47 +103,4 @@ describe('PlanChangeStatusDialog stale snapshot handling', () => {
fireEvent.click(screen.getByText('billing.actions.refresh'));
expect(onRefresh).toHaveBeenCalledTimes(1);
});
-
- it('does not submit the final change until confirmation is accepted', async () => {
- const onConfirm = vi.fn();
- render(
- <PlanChangeStatusDialog
- state={quoteReadyState()}
- targetName="Plus"
- onClose={vi.fn()}
- onConfirm={onConfirm}
- onRefresh={vi.fn()}
- onAbandon={vi.fn()}
- />,
- );
-
- fireEvent.click(screen.getByText('billing.planChange.confirm'));
- expect(onConfirm).not.toHaveBeenCalled();
- await waitFor(() => expect(onConfirm).toHaveBeenCalledTimes(1));
- expect(confirm).toHaveBeenCalledWith(
- expect.objectContaining({
- confirmText: 'billing.confirmActions.confirmPlanChange',
- autoFocusConfirm: true,
- }),
- );
- });
-
- it('keeps the quote when cancel-plan-change confirmation is declined', async () => {
- confirm.mockResolvedValue(false);
- const onAbandon = vi.fn();
- render(
- <PlanChangeStatusDialog
- state={quoteReadyState()}
- targetName="Plus"
- onClose={vi.fn()}
- onConfirm={vi.fn()}
- onRefresh={vi.fn()}
- onAbandon={onAbandon}
- />,
- );
-
- fireEvent.click(screen.getByText('billing.planChange.abandon'));
- await waitFor(() => expect(confirm).toHaveBeenCalledTimes(1));
- expect(onAbandon).not.toHaveBeenCalled();
- });
});
diff --git a/apps/desktop/src/renderer/i18n/locales/en/common.json b/apps/desktop/src/renderer/i18n/locales/en/common.json
index 87949ca663..06e1ca8f40 100644
--- a/apps/desktop/src/renderer/i18n/locales/en/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/en/common.json
@@ -6938,7 +6938,6 @@
"unavailable": "Subscription status is temporarily unavailable. Refresh to try again.",
"action": "View plans",
"changeAction": "Change plan",
- "purchaseAnother": "Buy new subscription",
"priceInterval": "{{price}} / {{interval}}",
"includedCredits": "Includes {{amount}} credits per {{interval}}",
"renewsAt": "Renews {{date}}",
@@ -7053,31 +7052,6 @@
"confirm": {
"channel": "Pay with {{provider}}"
},
- "confirmActions": {
- "back": "Back to Review",
- "purchaseTopupTitle": "Buy Credits?",
- "purchaseTopupDescription": "{{product}} · {{amount}} · Pay with {{provider}}",
- "purchaseTopup": "Buy Credits",
- "purchaseSubscriptionTitle": "Buy {{plan}}?",
- "purchaseSubscriptionDescription": "{{price}} / {{interval}} · Pay with {{provider}}",
- "purchaseSubscription": "Buy Plan",
- "quotePlanChangeTitle": "Get a Plan Change Quote?",
- "quotePlanChangeDescription": "{{current}} → {{target}}. The next step shows the actual price difference and effective time.",
- "quotePlanChange": "Get Change Quote",
- "confirmPlanChangeTitle": "Apply This Plan Change?",
- "confirmPlanChangeDescription": "{{target}} · {{impact}}",
- "confirmPlanChange": "Apply Plan Change",
- "cancelPaymentTitle": "Cancel This Payment?",
- "cancelPaymentDescription": "The {{amount}} payment will be canceled. You will need to create a new payment.",
- "cancelPayment": "Cancel Payment",
- "cancelPlanChangeTitle": "Cancel This Plan Change?",
- "cancelPlanChangeDescription": "Target plan: {{target}}. Your current plan remains unchanged.",
- "cancelPlanChange": "Cancel Plan Change",
- "retryPaymentTitle": "Retry This Payment?",
- "retryPaymentDescription": "The {{amount}} payment will retry with the original idempotent intent.",
- "retryUnknownPaymentDescription": "This payment will retry with the original idempotent intent.",
- "retryPayment": "Retry Payment"
- },
"paymentActions": {
"QR_CODE": "Scan to pay",
"REDIRECT": "Open payment page"
@@ -7137,7 +7111,6 @@
"targetTitle": "Change subscription plan",
"targetDescription": "Plan changes keep your current payment method. The final price and effective time are confirmed on the next step.",
"targetDescriptionWithCurrent": "Current plan: {{plan}}. Plan changes keep your current payment method; the final price and effective time are confirmed on the next step.",
- "serverDecisionHint": "Price and timing are confirmed by the next quote",
"upgradeBadge": "Upgrade",
"downgradeBadge": "Downgrade",
"emptyTitle": "No plans available to switch to",
diff --git a/apps/desktop/src/renderer/i18n/locales/ja/common.json b/apps/desktop/src/renderer/i18n/locales/ja/common.json
index d753fa399d..8947096602 100644
--- a/apps/desktop/src/renderer/i18n/locales/ja/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/ja/common.json
@@ -6927,7 +6927,6 @@
"unavailable": "サブスクリプションの状態を取得できません。更新してもう一度お試しください。",
"action": "プランを見る",
"changeAction": "プランを変更",
- "purchaseAnother": "新しいサブスクリプションを購入",
"priceInterval": "{{price}} / {{interval}}",
"includedCredits": "毎{{interval}} {{amount}} クレジットを付与",
"renewsAt": "次回更新日: {{date}}",
@@ -7042,31 +7041,6 @@
"confirm": {
"channel": "{{provider}}で支払う"
},
- "confirmActions": {
- "back": "内容を確認",
- "purchaseTopupTitle": "クレジットを購入しますか?",
- "purchaseTopupDescription": "{{product}} · {{amount}} · {{provider}}で支払う",
- "purchaseTopup": "クレジットを購入",
- "purchaseSubscriptionTitle": "{{plan}}を購入しますか?",
- "purchaseSubscriptionDescription": "{{price}} / {{interval}} · {{provider}}で支払う",
- "purchaseSubscription": "プランを購入",
- "quotePlanChangeTitle": "プラン変更の見積もりを取得しますか?",
- "quotePlanChangeDescription": "{{current}} → {{target}}。次のステップで実際の差額と適用時期を表示します。",
- "quotePlanChange": "変更見積もりを取得",
- "confirmPlanChangeTitle": "プラン変更を確定しますか?",
- "confirmPlanChangeDescription": "{{target}} · {{impact}}",
- "confirmPlanChange": "プラン変更を確定",
- "cancelPaymentTitle": "この支払いをキャンセルしますか?",
- "cancelPaymentDescription": "{{amount}}の支払いをキャンセルします。続行するには新しい支払いの作成が必要です。",
- "cancelPayment": "この支払いをキャンセル",
- "cancelPlanChangeTitle": "プラン変更を取り消しますか?",
- "cancelPlanChangeDescription": "変更先プラン: {{target}}。取り消しても現在のプランは変わりません。",
- "cancelPlanChange": "プラン変更を取り消す",
- "retryPaymentTitle": "この支払いを再試行しますか?",
- "retryPaymentDescription": "{{amount}}の支払いを元の冪等な処理で再試行します。",
- "retryUnknownPaymentDescription": "この支払いを元の冪等な処理で再試行します。",
- "retryPayment": "この支払いを再試行"
- },
"paymentActions": {
"QR_CODE": "QRコードで支払う",
"REDIRECT": "支払いページを開く"
@@ -7126,7 +7100,6 @@
"targetTitle": "サブスクリプションプランの変更",
"targetDescription": "プラン変更は現在の支払い方法を引き継ぎます。最終的な金額と適用時期は次のステップで確認します。",
"targetDescriptionWithCurrent": "現在のプラン:{{plan}}。変更は現在の支払い方法を引き継ぎ、最終的な金額と適用時期は次のステップで確認します。",
- "serverDecisionHint": "金額と適用時期は次の見積もりで確定します",
"upgradeBadge": "アップグレード",
"downgradeBadge": "ダウングレード",
"emptyTitle": "切り替え可能なプランがありません",
diff --git a/apps/desktop/src/renderer/i18n/locales/ko/common.json b/apps/desktop/src/renderer/i18n/locales/ko/common.json
index 8d37e129e7..e9d3542bce 100644
--- a/apps/desktop/src/renderer/i18n/locales/ko/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/ko/common.json
@@ -6927,7 +6927,6 @@
"unavailable": "구독 상태를 불러올 수 없습니다. 새로고침 후 다시 시도하세요.",
"action": "요금제 보기",
"changeAction": "요금제 변경",
- "purchaseAnother": "새 구독 구매",
"priceInterval": "{{price}} / {{interval}}",
"includedCredits": "매{{interval}} {{amount}} 크레딧 포함",
"renewsAt": "다음 갱신일 {{date}}",
@@ -7042,31 +7041,6 @@
"confirm": {
"channel": "{{provider}}로 결제"
},
- "confirmActions": {
- "back": "내용 다시 보기",
- "purchaseTopupTitle": "크레딧을 구매할까요?",
- "purchaseTopupDescription": "{{product}} · {{amount}} · {{provider}}로 결제",
- "purchaseTopup": "크레딧 구매",
- "purchaseSubscriptionTitle": "{{plan}}을(를) 구매할까요?",
- "purchaseSubscriptionDescription": "{{price}} / {{interval}} · {{provider}}로 결제",
- "purchaseSubscription": "요금제 구매",
- "quotePlanChangeTitle": "요금제 변경 견적을 받을까요?",
- "quotePlanChangeDescription": "{{current}} → {{target}}. 다음 단계에서 실제 차액과 적용 시점을 확인할 수 있습니다.",
- "quotePlanChange": "변경 견적 받기",
- "confirmPlanChangeTitle": "요금제 변경을 확정할까요?",
- "confirmPlanChangeDescription": "{{target}} · {{impact}}",
- "confirmPlanChange": "요금제 변경 확정",
- "cancelPaymentTitle": "이 결제를 취소할까요?",
- "cancelPaymentDescription": "{{amount}} 결제가 취소됩니다. 계속하려면 새 결제를 만들어야 합니다.",
- "cancelPayment": "이 결제 취소",
- "cancelPlanChangeTitle": "요금제 변경을 취소할까요?",
- "cancelPlanChangeDescription": "대상 요금제: {{target}}. 취소해도 현재 요금제는 유지됩니다.",
- "cancelPlanChange": "요금제 변경 취소",
- "retryPaymentTitle": "이 결제를 다시 시도할까요?",
- "retryPaymentDescription": "{{amount}} 결제를 기존 멱등 요청으로 다시 시도합니다.",
- "retryUnknownPaymentDescription": "이 결제를 기존 멱등 요청으로 다시 시도합니다.",
- "retryPayment": "이 결제 다시 시도"
- },
"paymentActions": {
"QR_CODE": "QR 코드 결제",
"REDIRECT": "결제 페이지 열기"
@@ -7126,7 +7100,6 @@
"targetTitle": "구독 플랜 변경",
"targetDescription": "플랜 변경은 현재 결제 수단을 그대로 사용합니다. 최종 금액과 적용 시점은 다음 단계에서 확인합니다.",
"targetDescriptionWithCurrent": "현재 플랜: {{plan}}. 변경은 현재 결제 수단을 그대로 사용하며, 최종 금액과 적용 시점은 다음 단계에서 확인합니다.",
- "serverDecisionHint": "금액과 적용 시점은 다음 견적에서 확정됩니다",
"upgradeBadge": "업그레이드",
"downgradeBadge": "다운그레이드",
"emptyTitle": "전환 가능한 플랜이 없습니다",
diff --git a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
index 708c52269b..1c638a26ae 100644
--- a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
@@ -6927,7 +6927,6 @@
"unavailable": "暂时无法获取订阅状态,请刷新后重试。",
"action": "查看套餐",
"changeAction": "更改套餐",
- "purchaseAnother": "购买新订阅",
"priceInterval": "{{price}} / {{interval}}",
"includedCredits": "每{{interval}}包含 {{amount}} 点数",
"renewsAt": "下次续费 {{date}}",
@@ -7042,31 +7041,6 @@
"confirm": {
"channel": "通过 {{provider}} 支付"
},
- "confirmActions": {
- "back": "返回检查",
- "purchaseTopupTitle": "购买点数?",
- "purchaseTopupDescription": "{{product}} · {{amount}} · 通过 {{provider}} 支付",
- "purchaseTopup": "确认购买点数",
- "purchaseSubscriptionTitle": "购买 {{plan}}?",
- "purchaseSubscriptionDescription": "{{price}} / {{interval}} · 通过 {{provider}} 支付",
- "purchaseSubscription": "确认购买套餐",
- "quotePlanChangeTitle": "获取套餐变更报价?",
- "quotePlanChangeDescription": "{{current}} → {{target}}。下一步将显示实际差价和生效时间。",
- "quotePlanChange": "获取变更报价",
- "confirmPlanChangeTitle": "确认套餐变更?",
- "confirmPlanChangeDescription": "{{target}} · {{impact}}",
- "confirmPlanChange": "确认套餐变更",
- "cancelPaymentTitle": "取消本次支付?",
- "cancelPaymentDescription": "{{amount}} 的支付将被取消,之后需要重新创建支付。",
- "cancelPayment": "取消本次支付",
- "cancelPlanChangeTitle": "撤销套餐变更?",
- "cancelPlanChangeDescription": "目标套餐:{{target}}。撤销后当前套餐保持不变。",
- "cancelPlanChange": "撤销套餐变更",
- "retryPaymentTitle": "重试本次支付?",
- "retryPaymentDescription": "{{amount}} 的支付将复用原幂等意图重试。",
- "retryUnknownPaymentDescription": "本次支付将复用原幂等意图重试。",
- "retryPayment": "重试本次支付"
- },
"paymentActions": {
"QR_CODE": "扫码支付",
"REDIRECT": "跳转支付页面"
@@ -7126,7 +7100,6 @@
"targetTitle": "更改订阅套餐",
"targetDescription": "套餐变更沿用当前支付方式,最终价格与生效时间以下一步确认为准。",
"targetDescriptionWithCurrent": "当前套餐:{{plan}}。变更沿用当前支付方式,最终价格与生效时间以下一步确认为准。",
- "serverDecisionHint": "价格与生效方式以下一步报价为准",
"upgradeBadge": "升级",
"downgradeBadge": "降级",
"emptyTitle": "暂无可切换的套餐",