feat(payment): sync plans and add coins rules

This commit is contained in:
2026-06-29 14:11:50 +08:00
parent 274fe87ced
commit e372d58b4c
24 changed files with 1099 additions and 224 deletions
@@ -6,7 +6,12 @@ export function toPaymentErrorMessage(error: unknown): string {
return error instanceof Error ? error.message : String(error);
}
export function defaultAutoRenewForPlan(planId: string): boolean {
export function defaultAutoRenewForPlan(
planId: string,
plans: readonly PaymentPlan[] = [],
): boolean {
const plan = plans.find((item) => item.planId === planId);
if (plan?.dolAmount !== null && plan?.dolAmount !== undefined) return false;
return (
!planId.includes("lifetime") &&
!planId.startsWith("dol_") &&