package config import "testing" func TestStripeCheckoutConfigured(t *testing.T) { cfg := Config{ StripeAPIKey: "sk_test_123", StripeWebhookKey: "whsec_test_123", StripePriceMatrix: map[string]map[string]string{ "starter": {"czk": "price_starter_czk", "usd": "price_starter_usd"}, "pro": {"czk": "price_pro_czk", "usd": "price_pro_usd"}, "business": {"czk": "price_business_czk", "usd": "price_business_usd"}, }, } if !cfg.StripeCheckoutConfigured("pro") { t.Fatal("expected pro checkout configured") } } func TestStripeCheckoutConfiguredRequiresWebhook(t *testing.T) { cfg := Config{ StripeAPIKey: "sk_test_123", StripePriceMatrix: map[string]map[string]string{ "pro": {"czk": "price_pro_czk", "usd": "price_pro_usd"}, }, } if cfg.StripeCheckoutConfigured("pro") { t.Fatal("expected checkout disabled without webhook key") } } func TestBillingProviderIsStripe(t *testing.T) { if (Config{}).BillingProvider() != "stripe" { t.Fatal("expected stripe billing provider") } }