feat(subscription): default pay channel by country
This commit is contained in:
@@ -4,6 +4,7 @@ import { PaymentPlan } from "@/data/dto/payment";
|
||||
|
||||
import {
|
||||
findSelectedSubscriptionPlan,
|
||||
getDefaultPayChannelForCountryCode,
|
||||
getDefaultSubscriptionPlanId,
|
||||
toCoinsOfferPlanViews,
|
||||
toVipOfferPlanViews,
|
||||
@@ -28,6 +29,14 @@ function makePlan(
|
||||
}
|
||||
|
||||
describe("subscription screen helpers", () => {
|
||||
it("defaults Philippines users to Ezpay and other countries to Stripe", () => {
|
||||
expect(getDefaultPayChannelForCountryCode("PH")).toBe("ezpay");
|
||||
expect(getDefaultPayChannelForCountryCode("ph")).toBe("ezpay");
|
||||
expect(getDefaultPayChannelForCountryCode("HK")).toBe("stripe");
|
||||
expect(getDefaultPayChannelForCountryCode("")).toBe("stripe");
|
||||
expect(getDefaultPayChannelForCountryCode(null)).toBe("stripe");
|
||||
});
|
||||
|
||||
it("maps at most three VIP plans and all coin plans", () => {
|
||||
const plans = [
|
||||
makePlan({ planId: "vip_monthly", planName: "Monthly" }),
|
||||
|
||||
Reference in New Issue
Block a user