refactor(config): remove paddle configuration validation

This commit is contained in:
Tomas Dvorak
2026-05-11 18:16:46 +02:00
parent 7d3e3448cf
commit 3b6f46828b
-13
View File
@@ -104,19 +104,6 @@ func (cfg Config) validateRuntimeRequirements() error {
if cfg.SMTPHost == "" { if cfg.SMTPHost == "" {
missing = append(missing, "BOOKRA_SMTP_HOST") missing = append(missing, "BOOKRA_SMTP_HOST")
} }
if cfg.PaddleAPIKey == "" {
missing = append(missing, "BOOKRA_PADDLE_API_KEY")
}
if cfg.PaddleWebhookKey == "" {
missing = append(missing, "BOOKRA_PADDLE_WEBHOOK_SECRET")
}
for _, planCode := range []string{"starter", "pro", "business"} {
if cfg.PaddlePriceMatrix[planCode]["czk"] == "" || cfg.PaddlePriceMatrix[planCode]["usd"] == "" {
envPlan := strings.ToUpper(strings.ReplaceAll(planCode, "-", "_"))
missing = append(missing, "BOOKRA_PADDLE_"+envPlan+"_CZK_PRICE_ID")
missing = append(missing, "BOOKRA_PADDLE_"+envPlan+"_USD_PRICE_ID")
}
}
if len(missing) > 0 { if len(missing) > 0 {
return fmt.Errorf("%s required when BOOKRA_APP_ENV=%s", strings.Join(uniqueStrings(missing), ", "), cfg.Environment) return fmt.Errorf("%s required when BOOKRA_APP_ENV=%s", strings.Join(uniqueStrings(missing), ", "), cfg.Environment)
} }