package config

import (
	"os"
)

type Config struct {
	ListenAddr          string
	StripeWebhookSecret string
	// Add other config fields as needed
}

func Load() (*Config, error) {
	return &Config{
		ListenAddr:          getEnvOrDefault("LISTEN_ADDR", ":8080"),
		StripeWebhookSecret: os.Getenv("STRIPE_WEBHOOK_SECRET"),
	}, nil
}

func getEnvOrDefault(key, defaultValue string) string {
	if value := os.Getenv(key); value != "" {
		return value
	}
	return defaultValue
}
