[MM-29157] Cloud invoices logic (#16056)

* Cloud invoices logic

This commit includes all the code needed to get and print invoices
from CWS
Этот коммит содержится в:
Mario de Frutos Dieguez
2020-10-26 18:17:55 +01:00
коммит произвёл GitHub
родитель 8f895908fc
Коммит b68f171162
6 изменённых файлов: 131 добавлений и 0 удалений

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

@@ -5702,6 +5702,19 @@ func (c *Client4) GetSubscription() (*Subscription, *Response) {
return subscription, BuildResponse(r)
}
func (c *Client4) GetInvoicesForSubscription() ([]*Invoice, *Response) {
r, appErr := c.DoApiGet(c.GetCloudRoute()+"/subscription/invoices", "")
if appErr != nil {
return nil, BuildErrorResponse(r, appErr)
}
defer closeBody(r)
var invoices []*Invoice
json.NewDecoder(r.Body).Decode(&invoices)
return invoices, BuildResponse(r)
}
func (c *Client4) UpdateCloudCustomer(customerInfo *CloudCustomerInfo) (*CloudCustomer, *Response) {
customerBytes, _ := json.Marshal(customerInfo)