-
-
Notifications
You must be signed in to change notification settings - Fork 70
/
api_application_order_list.go
100 lines (89 loc) · 6.13 KB
/
api_application_order_list.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
// Code generated by lark_sdk_gen. DO NOT EDIT.
/**
* Copyright 2022 chyroc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package lark
import (
"context"
)
// GetApplicationOrderList 该接口用于分页查询应用租户下的已付费订单, 每次购买对应一个唯一的订单, 订单会记录购买的套餐的相关信息, 业务方需要自行处理套餐的有效期和付费方案的升级。
//
// > 备注: 免费模式的应用不会产生订单, 仅收费应用会产生订单 (含免费版)。
//
// doc: https://open.feishu.cn/document/ukTMukTMukTM/uETNwUjLxUDM14SM1ATN
// new doc: https://open.feishu.cn/document/server-docs/application-v6/appstore-paid-info/query-an-app-tenant’s-paid-orders
func (r *ApplicationService) GetApplicationOrderList(ctx context.Context, request *GetApplicationOrderListReq, options ...MethodOptionFunc) (*GetApplicationOrderListResp, *Response, error) {
if r.cli.mock.mockApplicationGetApplicationOrderList != nil {
r.cli.Log(ctx, LogLevelDebug, "[lark] Application#GetApplicationOrderList mock enable")
return r.cli.mock.mockApplicationGetApplicationOrderList(ctx, request, options...)
}
req := &RawRequestReq{
Scope: "Application",
API: "GetApplicationOrderList",
Method: "GET",
URL: r.cli.openBaseURL + "/open-apis/pay/v1/order/list",
Body: request,
MethodOption: newMethodOption(options),
NeedTenantAccessToken: true,
}
resp := new(getApplicationOrderListResp)
response, err := r.cli.RawRequest(ctx, req, resp)
return resp.Data, response, err
}
// MockApplicationGetApplicationOrderList mock ApplicationGetApplicationOrderList method
func (r *Mock) MockApplicationGetApplicationOrderList(f func(ctx context.Context, request *GetApplicationOrderListReq, options ...MethodOptionFunc) (*GetApplicationOrderListResp, *Response, error)) {
r.mockApplicationGetApplicationOrderList = f
}
// UnMockApplicationGetApplicationOrderList un-mock ApplicationGetApplicationOrderList method
func (r *Mock) UnMockApplicationGetApplicationOrderList() {
r.mockApplicationGetApplicationOrderList = nil
}
// GetApplicationOrderListReq ...
type GetApplicationOrderListReq struct {
Status *string `query:"status" json:"-"` // 获取用户购买套餐信息设置的过滤条件, normal为正常状态, refunded为已退款, 该字段为空或者all表示所有, 未支付的订单无法查到
PageSize int64 `query:"page_size" json:"-"` // 每页显示的订单数量
PageToken *string `query:"page_token" json:"-"` // 翻页标识, 可以从上次请求的响应中获取, 不填或者为空时表示从开头获取
TenantKey *string `query:"tenant_key" json:"-"` // 购买应用的租户唯一标识, 为空表示获取应用下所有订单, 有值表示获取应用下该租户购买的订单
}
// GetApplicationOrderListResp ...
type GetApplicationOrderListResp struct {
Total int64 `json:"total,omitempty"` // 总订单数
HasMore bool `json:"has_more,omitempty"` // 是否还有数据, true还有数据, false没有数据
PageToken string `json:"page_token,omitempty"` // 下一页数据的标识, 可作为请求下一页数据的参数, 当has_more为false时该字段为空
OrderList *GetApplicationOrderListRespOrderList `json:"order_list,omitempty"` // 订单信息列表
}
// GetApplicationOrderListRespOrderList ...
type GetApplicationOrderListRespOrderList struct {
OrderID string `json:"order_id,omitempty"` // 订单ID, 唯一标识
PricePlanID string `json:"price_plan_id,omitempty"` // 价格方案ID, 唯一标识
PricePlanType string `json:"price_plan_type,omitempty"` // 价格方案类型 。 可选值包括: "trial" -试用;"permanent"-免费;"per_year"-企业年付费;"per_month"-企业月付费;"per_seat_per_year"-按人按年付费;"per_seat_per_month"-按人按月付费;"permanent_count"-按次付费;
Seats int64 `json:"seats,omitempty"` // 实际购买人数 仅对price_plan_type为per_seat_per_year和per_seat_per_month 有效
BuyCount int64 `json:"buy_count,omitempty"` // 购买数量 总是为1
CreateTime string `json:"create_time,omitempty"` // 订单创建时间戳
PayTime string `json:"pay_time,omitempty"` // 订单支付时间戳
Status string `json:"status,omitempty"` // 订单当前状态, "normal" -正常;"refund"-已退款;
BuyType string `json:"buy_type,omitempty"` // 购买类型, "buy" - 普通购买;"upgrade"-为升级购买(仅price_plan_type 为per_year, per_month, per_seat_per_year, per_seat_per_month时可升级购买);"renew" - 续费购买;
SrcOrderID string `json:"src_order_id,omitempty"` // 源订单ID, 当前订单为升级购买时, 即buy_type为upgrade时, 此字段记录源订单等ID
DstOrderID string `json:"dst_order_id,omitempty"` // 升级后的新订单ID, 当前订单如果做过升级购买, 此字段记录升级购买后生成的新订单ID, 当前订单仍然有效
OrderPayPrice int64 `json:"order_pay_price,omitempty"` // 订单实际支付金额, 单位分
TenantKey string `json:"tenant_key,omitempty"` // 租户唯一标识
}
// getApplicationOrderListResp ...
type getApplicationOrderListResp struct {
Code int64 `json:"code,omitempty"` // 返回码, 非 0 表示失败
Msg string `json:"msg,omitempty"` // 返回码的描述
Data *GetApplicationOrderListResp `json:"data,omitempty"` // 返回的业务信息
Error *ErrorDetail `json:"error,omitempty"`
}