Last active
January 15, 2023 21:37
-
-
Save dipeshhkc/edea1c1017876e870df218aff647a80a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const plans = [ | |
{ | |
name: "Basic", | |
tier: "basic", | |
price: 5, | |
priceId: "price_1MNhAzFSrpGVHE9i8tGqm0R7", | |
}, | |
{ | |
name: "Pro", | |
tier: "pro", | |
price: 30, | |
priceId: "price_1MNmnJFSrpGVHE9itLCER4dX", | |
}, | |
]; | |
export const getPriceId = (name:string) => { | |
return plans.find((t) => {return t.tier === name})?.priceId; | |
}; | |
export const getTierName = (priceId:string) => { | |
return plans.find((t) => {return t.priceId === priceId})?.tier; | |
}; | |
export const getHumanReadableTierName = (priceId:string) => { | |
return plans.find((t) => {return t.priceId === priceId})?.name; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment