feat(payment): sync plans and add coins rules
This commit is contained in:
@@ -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_") &&
|
||||
|
||||
Reference in New Issue
Block a user