This commit is contained in:
KS Jannette
2026-03-28 11:55:51 -04:00
parent d9c3bd1db5
commit b0572451d3
18 changed files with 293 additions and 32 deletions

View File

@@ -94,6 +94,19 @@ func (c *Config) DSN() string {
)
}
// TierForPriceID maps a Stripe price ID back to the corresponding
// subscription tier. Returns empty string if the price is unrecognised.
func (c *Config) TierForPriceID(priceID string) string {
switch priceID {
case c.StripePriceIDPremium:
return "premium"
case c.StripePriceIDPro:
return "pro"
default:
return ""
}
}
func getEnv(key, fallback string) string {
if v := os.Getenv(key); v != "" {
return v