MM-43529 - start freemium trial (#20163)
* MM-43529 - start freemium trial * change the method to put * Add unit testing for the request-trial-endpoint * use correct require * add the translation texts * fix texts * remove unnecessary log * change response status code to forbidden when non cloud Co-authored-by: Pablo Velez Vidal <pablo.velez@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
617007a56d
Коммит
f08d65909f
@@ -7784,6 +7784,19 @@ func (c *Client4) ConfirmCustomerPayment(confirmRequest *ConfirmPaymentMethodReq
|
||||
return BuildResponse(r), nil
|
||||
}
|
||||
|
||||
func (c *Client4) RequestCloudTrial() (*Subscription, *Response, error) {
|
||||
r, err := c.DoAPIPut(c.cloudRoute()+"/request-trial", "")
|
||||
if err != nil {
|
||||
return nil, BuildResponse(r), err
|
||||
}
|
||||
defer closeBody(r)
|
||||
|
||||
var subscription *Subscription
|
||||
json.NewDecoder(r.Body).Decode(&subscription)
|
||||
|
||||
return subscription, BuildResponse(r), nil
|
||||
}
|
||||
|
||||
func (c *Client4) GetCloudCustomer() (*CloudCustomer, *Response, error) {
|
||||
r, err := c.DoAPIGet(c.cloudRoute()+"/customer", "")
|
||||
if err != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user