diff --git a/internal/config/config.go b/internal/config/config.go
index ea657cef..8013622e 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -87,10 +87,24 @@ func InitConfig(logger *otelzap.Logger) Config {
viper.SetDefault("config.require_teams", false)
viper.SetDefault("config.subscriptions_enabled", false)
- viper.SetDefault("subscription.checkout_link", "")
- viper.SetDefault("subscription.manage_link", "")
viper.SetDefault("subscription.account_secret", "")
viper.SetDefault("subscription.webhook_secret", "")
+ viper.SetDefault("subscription.manage_link", "https://billing.stripe.com/p/login/5kA5lKeb7eU9bp6cMM")
+ viper.SetDefault("subscription.individual.enabled", true)
+ viper.SetDefault("subscription.individual.month_price", "5")
+ viper.SetDefault("subscription.individual.year_price", "50")
+ viper.SetDefault("subscription.individual.month_checkout_link", "https://buy.stripe.com/7sIcP8gdhc3nc6YeUU")
+ viper.SetDefault("subscription.individual.year_checkout_link", "https://buy.stripe.com/14kcP8e590kFb2UdQR")
+ viper.SetDefault("subscription.team.enabled", false)
+ viper.SetDefault("subscription.team.month_price", "20")
+ viper.SetDefault("subscription.team.year_price", "200")
+ viper.SetDefault("subscription.team.month_checkout_link", "https://buy.stripe.com/28o6qK5yD4AV3As5ks")
+ viper.SetDefault("subscription.team.year_checkout_link", "https://buy.stripe.com/aEUg1kaSX4AV7QI14d")
+ viper.SetDefault("subscription.organization.enabled", false)
+ viper.SetDefault("subscription.organization.month_price", "50")
+ viper.SetDefault("subscription.organization.year_price", "500")
+ viper.SetDefault("subscription.organization.month_checkout_link", "https://buy.stripe.com/8wM6qK2mr0kF5IA8wC")
+ viper.SetDefault("subscription.organization.year_checkout_link", "https://buy.stripe.com/eVa02m2mr7N74EwcMT")
viper.SetDefault("admin.email", "")
diff --git a/internal/config/types.go b/internal/config/types.go
index 65939570..295a5cc3 100644
--- a/internal/config/types.go
+++ b/internal/config/types.go
@@ -1,5 +1,7 @@
package config
+import "github.com/StevenWeathers/thunderdome-planning-poker/thunderdome"
+
type Config struct {
Http
Analytics
@@ -10,7 +12,7 @@ type Config struct {
Config AppConfig
Feature
Auth
- Subscription
+ Subscription thunderdome.SubscriptionConfig
}
type Http struct {
@@ -124,10 +126,3 @@ type AuthLdap struct {
MailAttr string `mapstructure:"mail_attr"`
CnAttr string `mapstructure:"cn_attr"`
}
-
-type Subscription struct {
- CheckoutLink string `mapstructure:"checkout_link"`
- ManageLink string `mapstructure:"manage_link"`
- AccountSecret string `mapstructure:"account_secret"`
- WebhookSecret string `mapstructure:"webhook_secret"`
-}
diff --git a/main.go b/main.go
index c5b94b85..3a35ad0f 100644
--- a/main.go
+++ b/main.go
@@ -231,8 +231,7 @@ func main() {
FeatureStoryboard: c.Feature.Storyboard,
RequireTeams: c.Config.RequireTeams,
SubscriptionsEnabled: c.Config.SubscriptionsEnabled,
- SubscriptionCheckoutLink: c.Subscription.CheckoutLink,
- SubscriptionManageLink: c.Subscription.ManageLink,
+ Subscription: c.Subscription,
RepoURL: repoURL,
},
},
diff --git a/thunderdome/app.go b/thunderdome/app.go
index 24b7890b..0e96c3e2 100644
--- a/thunderdome/app.go
+++ b/thunderdome/app.go
@@ -1,5 +1,22 @@
package thunderdome
+type SubscriptionPlanConfig struct {
+ Enabled bool `mapstructure:"enabled"`
+ MonthPrice string `mapstructure:"month_price"`
+ YearPrice string `mapstructure:"year_price"`
+ MonthCheckoutLink string `mapstructure:"month_checkout_link"`
+ YearCheckoutLink string `mapstructure:"year_checkout_link"`
+}
+
+type SubscriptionConfig struct {
+ ManageLink string `mapstructure:"manage_link"`
+ AccountSecret string `mapstructure:"account_secret" json:"-"`
+ WebhookSecret string `mapstructure:"webhook_secret" json:"-"`
+ Individual SubscriptionPlanConfig `mapstructure:"individual"`
+ Team SubscriptionPlanConfig `mapstructure:"team"`
+ Organization SubscriptionPlanConfig `mapstructure:"organization"`
+}
+
type AppConfig struct {
AllowedPointValues []string
DefaultPointValues []string
@@ -29,10 +46,9 @@ type AppConfig struct {
FeatureRetro bool
FeatureStoryboard bool
RequireTeams bool
- SubscriptionsEnabled bool
- SubscriptionCheckoutLink string
- SubscriptionManageLink string
RepoURL string
+ SubscriptionsEnabled bool
+ Subscription SubscriptionConfig
}
type UIConfig struct {
diff --git a/ui/src/components/icons/ArrowRight.svelte b/ui/src/components/icons/ArrowRight.svelte
new file mode 100644
index 00000000..f202515a
--- /dev/null
+++ b/ui/src/components/icons/ArrowRight.svelte
@@ -0,0 +1,16 @@
+
+
+
diff --git a/ui/src/components/pricing/Checkmark.svelte b/ui/src/components/pricing/Checkmark.svelte
new file mode 100644
index 00000000..fb92ab26
--- /dev/null
+++ b/ui/src/components/pricing/Checkmark.svelte
@@ -0,0 +1,9 @@
+
+
+
+
+ Login + or + Register to subscribe +
+ {:else if $user.subscribed} ++ Already subscribed, thank you! +
+ {:else} + + Subscribe Today ++ Payments processed by Stripe. +
+ {/if} + {:else} ++ Coming soon! +
+ {/if} +- All the primary features at no cost. -
-+ Everything you need, nothing you don't. Pick a plan that best suits your + needs. +
+- Primary features plus enhanced ones. -
-