Files
mostlymatter/model/hosted_customer.go
Nathaniel Allred a8fa3f29e9 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>
2022-12-13 13:36:18 -06:00

59 строки
1.8 KiB
Go

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
package model
type BootstrapSelfHostedSignupRequest struct {
Email string `json:"email"`
Reset bool `json:"reset"`
}
type BootstrapSelfHostedSignupResponse struct {
Progress string `json:"progress"`
}
type BootstrapSelfHostedSignupResponseInternal struct {
Progress string `json:"progress"`
License string `json:"license"`
}
// email contained in token, so not in the request body.
type SelfHostedCustomerForm struct {
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
BillingAddress *Address `json:"billing_address"`
Organization string `json:"organization"`
}
type SelfHostedConfirmPaymentMethodRequest struct {
StripeSetupIntentID string `json:"stripe_setup_intent_id"`
Subscription CreateSubscriptionRequest `json:"subscription"`
}
// SelfHostedSignupPaymentResponse contains feels needed for self hosted signup to confirm payment and receive license.
type SelfHostedSignupCustomerResponse struct {
CustomerId string `json:"customer_id"`
SetupIntentId string `json:"setup_intent_id"`
SetupIntentSecret string `json:"setup_intent_secret"`
Progress string `json:"progress"`
}
// SelfHostedSignupConfirmResponse contains data received on successful self hosted signup
type SelfHostedSignupConfirmResponse struct {
License string `json:"license"`
Progress string `json:"progress"`
}
type SelfHostedSignupConfirmClientResponse struct {
License map[string]string `json:"license"`
Progress string `json:"progress"`
}
type SelfHostedBillingAccessRequest struct {
LicenseId string `json:"license_id"`
}
type SelfHostedBillingAccessResponse struct {
Token string `json:"token"`
}