fix(subscription): preselect pay channel before navigation
This commit is contained in:
@@ -1,16 +1,11 @@
|
||||
import type { PayChannel, PaymentPlan } from "@/data/dto/payment";
|
||||
import type { PaymentPlan } from "@/data/dto/payment";
|
||||
export { getDefaultPayChannelForCountryCode } from "@/lib/payment/default_pay_channel";
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user