Self-hosted in-product purchase (#21804)

* Self-hosted admins can purchase licenses in-app when `ServiceSettings,SelfHostedPurchase` is true (the default)
* Content Security Policy enables loading assets from `js.stripe.com/v3` when `ServiceSettings.SelfHostedPurchase` is true (the default).
* Add `hosted_customer` API subpath
* Add status of SelfHostedPurchase to telemetry config report.
* Support showing admins self-hosted invoices when `ServiceSettings.SelfHostedPurchase` is true (the default)

Co-authored-by: Conor Macpherson <116016004+ConorMacpherson@users.noreply.github.com>
Этот коммит содержится в:
Nathaniel Allred
2022-12-13 13:36:18 -06:00
коммит произвёл GitHub
родитель 6fd174a95f
Коммит a8fa3f29e9
16 изменённых файлов: 551 добавлений и 29 удалений

Просмотреть файл

@@ -383,7 +383,7 @@ type ServiceSettings struct {
CollapsedThreads *string `access:"experimental_features"`
ManagedResourcePaths *string `access:"environment_web_server,write_restrictable,cloud_restrictable"`
EnableCustomGroups *bool `access:"site_users_and_teams"`
SelfHostedFirstTimePurchase *bool `access:"write_restrictable,cloud_restrictable"`
SelfHostedPurchase *bool `access:"write_restrictable,cloud_restrictable"`
AllowSyncedDrafts *bool `access:"site_posts"`
}
@@ -854,8 +854,8 @@ func (s *ServiceSettings) SetDefaults(isUpdate bool) {
s.AllowSyncedDrafts = NewBool(true)
}
if s.SelfHostedFirstTimePurchase == nil {
s.SelfHostedFirstTimePurchase = NewBool(false)
if s.SelfHostedPurchase == nil {
s.SelfHostedPurchase = NewBool(true)
}
}