mirror of
https://github.com/Dvorinka/Bookra.git
synced 2026-06-03 20:13:00 +00:00
33 lines
877 B
Go
33 lines
877 B
Go
package config
|
|
|
|
import "testing"
|
|
|
|
func TestPaddleCheckoutConfigured(t *testing.T) {
|
|
cfg := Config{
|
|
PaddleAPIKey: "pdl_sdbx_apikey_123",
|
|
PaddleWebhookKey: "pdl_ntf_123",
|
|
PaddlePriceMatrix: map[string]map[string]string{
|
|
"starter": {"czk": "pri_starter_czk", "usd": "pri_starter_usd"},
|
|
"pro": {"czk": "pri_pro_czk", "usd": "pri_pro_usd"},
|
|
"business": {"czk": "pri_business_czk", "usd": "pri_business_usd"},
|
|
},
|
|
}
|
|
|
|
if !cfg.PaddleCheckoutConfigured("pro") {
|
|
t.Fatal("expected pro checkout configured")
|
|
}
|
|
}
|
|
|
|
func TestPaddleCheckoutConfiguredRequiresWebhook(t *testing.T) {
|
|
cfg := Config{
|
|
PaddleAPIKey: "pdl_sdbx_apikey_123",
|
|
PaddlePriceMatrix: map[string]map[string]string{
|
|
"pro": {"czk": "pri_pro_czk", "usd": "pri_pro_usd"},
|
|
},
|
|
}
|
|
|
|
if cfg.PaddleCheckoutConfigured("pro") {
|
|
t.Fatal("expected checkout disabled without webhook key")
|
|
}
|
|
}
|