Add billing-contact config option

This commit is contained in:
binwiederhier 2023-02-28 14:38:31 -05:00
parent f862341997
commit fe3a225f8f
10 changed files with 51 additions and 7 deletions

View file

@ -128,6 +128,7 @@ type Config struct {
StripeSecretKey string
StripeWebhookKey string
StripePriceCacheDuration time.Duration
BillingContact string
EnableWeb bool
EnableSignup bool // Enable creation of accounts via API and UI
EnableLogin bool

View file

@ -485,6 +485,7 @@ func (s *Server) handleWebConfig(w http.ResponseWriter, _ *http.Request, _ *visi
EnableSignup: s.config.EnableSignup,
EnablePayments: s.config.StripeSecretKey != "",
EnableReservations: s.config.EnableReservations,
BillingContact: s.config.BillingContact,
DisallowedTopics: s.config.DisallowedTopics,
}
b, err := json.MarshalIndent(response, "", " ")

View file

@ -240,9 +240,12 @@
# enables payments in the ntfy web app (e.g. Upgrade dialog). See https://dashboard.stripe.com/apikeys.
# - stripe-webhook-key is the key required to validate the authenticity of incoming webhooks from Stripe.
# Webhooks are essential up keep the local database in sync with the payment provider. See https://dashboard.stripe.com/webhooks.
# - billing-contact is an email address or website displayed in the "Upgrade tier" dialog to let people reach
# out with billing questions. If unset, nothing will be displayed.
#
# stripe-secret-key:
# stripe-webhook-key:
# billing-contact:
# Logging options
#

View file

@ -341,6 +341,7 @@ type apiConfigResponse struct {
EnableSignup bool `json:"enable_signup"`
EnablePayments bool `json:"enable_payments"`
EnableReservations bool `json:"enable_reservations"`
BillingContact string `json:"billing_contact"`
DisallowedTopics []string `json:"disallowed_topics"`
}