MCPcopy Index your code
hub / github.com/sqlchat/sqlchat / getPlanFromPriceId

Function getPlanFromPriceId

src/utils/plan.ts:1–22  ·  view source on GitHub ↗
(priceId: string)

Source from the content-addressed store, hash-verified

1export const getPlanFromPriceId = (priceId: string) => {
2 switch (priceId) {
3 case process.env.NEXT_PUBLIC_STRIPE_PRICE_ID_PRO_1_MONTH_SUBSCRIPTION:
4 return {
5 month: 1,
6 description: "Pro 1 Month (Early Bird)",
7 };
8 case process.env.NEXT_PUBLIC_STRIPE_PRICE_ID_PRO_3_MONTH_SUBSCRIPTION:
9 return {
10 month: 1,
11 description: "Pro 3 Months (Early Bird)",
12 };
13 case process.env.NEXT_PUBLIC_STRIPE_PRICE_ID_PRO_1_YEAR_SUBSCRIPTION:
14 return {
15 month: 12,
16 description: "Pro 1 Year (Early Bird)",
17 };
18 default: {
19 throw Error(`Invalid price ID ${priceId}`);
20 }
21 }
22};

Callers 1

webhookHandlerFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected