feat(subscription): default pay channel by country

This commit is contained in:
2026-06-30 16:49:47 +08:00
parent 9cff16e2d9
commit e254c93078
9 changed files with 63 additions and 5 deletions
@@ -1,10 +1,16 @@
import type { PaymentPlan } from "@/data/dto/payment";
import type { PayChannel, PaymentPlan } from "@/data/dto/payment";
import type { CoinsOfferPlanView } from "./components/subscription-coins-offer-section";
import type { VipOfferPlanView } from "./components/subscription-vip-offer-section";
export type SubscriptionType = "vip" | "topup";
export function getDefaultPayChannelForCountryCode(
countryCode: string | null | undefined,
): PayChannel {
return countryCode?.trim().toUpperCase() === "PH" ? "ezpay" : "stripe";
}
export function isVipPlan(plan: PaymentPlan): boolean {
return plan.vipDays !== null;
}