mirror of
https://github.com/Dvorinka/Bookra.git
synced 2026-06-03 20:13:00 +00:00
refactor(config): remove paddle configuration validation
This commit is contained in:
@@ -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)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user