[MM-28211] API pass-thru to the CWS for getting subscription (#15666)
* API pass-thru to the CWS for getting subscription * Remove use of parameter in favour of env var * Remove unnecessary param * Removed unnecessary fields and added client4 method * Some cleanup * Translation fix Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
ca145a83bd
Коммит
2403aae0c4
@@ -5650,3 +5650,16 @@ func (c *Client4) ConfirmCustomerPayment(confirmRequest *ConfirmPaymentMethodReq
|
||||
|
||||
return BuildResponse(r)
|
||||
}
|
||||
|
||||
func (c *Client4) GetSubscription() (*Subscription, *Response) {
|
||||
r, appErr := c.DoApiGet(c.GetCloudRoute()+"/subscription", "")
|
||||
if appErr != nil {
|
||||
return nil, BuildErrorResponse(r, appErr)
|
||||
}
|
||||
defer closeBody(r)
|
||||
|
||||
var subscription *Subscription
|
||||
json.NewDecoder(r.Body).Decode(&subscription)
|
||||
|
||||
return subscription, BuildResponse(r)
|
||||
}
|
||||
|
||||
@@ -30,3 +30,16 @@ type StripeSetupIntent struct {
|
||||
type ConfirmPaymentMethodRequest struct {
|
||||
StripeSetupIntentID string `json:"stripe_setup_intent_id"`
|
||||
}
|
||||
|
||||
// Subscription model represents a subscription on the system.
|
||||
type Subscription struct {
|
||||
ID string `json:"id"`
|
||||
CustomerID string `json:"customer_id"`
|
||||
ProductID string `json:"product_id"`
|
||||
AddOns []string `json:"add_ons"`
|
||||
StartAt int64 `json:"start_at"`
|
||||
EndAt int64 `json:"end_at"`
|
||||
CreateAt int64 `json:"create_at"`
|
||||
Seats int `json:"seats"`
|
||||
DNS string `json:"dns"`
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user