@wix/auto_sdk_pricing-plans_orders 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.d.ts +1 -0
- package/build/cjs/index.js +18 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +1 -0
- package/build/cjs/index.typings.js +18 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +1 -0
- package/build/cjs/meta.js +18 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/cjs/src/pricing-plans-v2-order-orders.context.d.ts +111 -0
- package/build/cjs/src/pricing-plans-v2-order-orders.context.js +126 -0
- package/build/cjs/src/pricing-plans-v2-order-orders.context.js.map +1 -0
- package/build/cjs/src/pricing-plans-v2-order-orders.http.d.ts +149 -0
- package/build/cjs/src/pricing-plans-v2-order-orders.http.js +877 -0
- package/build/cjs/src/pricing-plans-v2-order-orders.http.js.map +1 -0
- package/build/cjs/src/pricing-plans-v2-order-orders.meta.d.ts +43 -0
- package/build/cjs/src/pricing-plans-v2-order-orders.meta.js +313 -0
- package/build/cjs/src/pricing-plans-v2-order-orders.meta.js.map +1 -0
- package/build/cjs/src/pricing-plans-v2-order-orders.public.d.ts +249 -0
- package/build/cjs/src/pricing-plans-v2-order-orders.public.js +373 -0
- package/build/cjs/src/pricing-plans-v2-order-orders.public.js.map +1 -0
- package/build/cjs/src/pricing-plans-v2-order-orders.types.d.ts +1331 -0
- package/build/cjs/src/pricing-plans-v2-order-orders.types.js +145 -0
- package/build/cjs/src/pricing-plans-v2-order-orders.types.js.map +1 -0
- package/build/cjs/src/pricing-plans-v2-order-orders.universal.d.ts +2015 -0
- package/build/cjs/src/pricing-plans-v2-order-orders.universal.js +889 -0
- package/build/cjs/src/pricing-plans-v2-order-orders.universal.js.map +1 -0
- package/build/es/index.d.ts +1 -0
- package/build/es/index.js +2 -0
- package/build/es/index.js.map +1 -0
- package/build/es/index.typings.d.ts +1 -0
- package/build/es/index.typings.js +2 -0
- package/build/es/index.typings.js.map +1 -0
- package/build/es/meta.d.ts +1 -0
- package/build/es/meta.js +2 -0
- package/build/es/meta.js.map +1 -0
- package/build/es/package.json +3 -0
- package/build/es/src/pricing-plans-v2-order-orders.context.d.ts +111 -0
- package/build/es/src/pricing-plans-v2-order-orders.context.js +111 -0
- package/build/es/src/pricing-plans-v2-order-orders.context.js.map +1 -0
- package/build/es/src/pricing-plans-v2-order-orders.http.d.ts +149 -0
- package/build/es/src/pricing-plans-v2-order-orders.http.js +859 -0
- package/build/es/src/pricing-plans-v2-order-orders.http.js.map +1 -0
- package/build/es/src/pricing-plans-v2-order-orders.meta.d.ts +43 -0
- package/build/es/src/pricing-plans-v2-order-orders.meta.js +272 -0
- package/build/es/src/pricing-plans-v2-order-orders.meta.js.map +1 -0
- package/build/es/src/pricing-plans-v2-order-orders.public.d.ts +249 -0
- package/build/es/src/pricing-plans-v2-order-orders.public.js +343 -0
- package/build/es/src/pricing-plans-v2-order-orders.public.js.map +1 -0
- package/build/es/src/pricing-plans-v2-order-orders.types.d.ts +1331 -0
- package/build/es/src/pricing-plans-v2-order-orders.types.js +142 -0
- package/build/es/src/pricing-plans-v2-order-orders.types.js.map +1 -0
- package/build/es/src/pricing-plans-v2-order-orders.universal.d.ts +2015 -0
- package/build/es/src/pricing-plans-v2-order-orders.universal.js +848 -0
- package/build/es/src/pricing-plans-v2-order-orders.universal.js.map +1 -0
- package/build/internal/cjs/index.d.ts +1 -0
- package/build/internal/cjs/index.js +18 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +1 -0
- package/build/internal/cjs/index.typings.js +18 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +1 -0
- package/build/internal/cjs/meta.js +18 -0
- package/build/internal/cjs/meta.js.map +1 -0
- package/build/internal/cjs/src/pricing-plans-v2-order-orders.context.d.ts +111 -0
- package/build/internal/cjs/src/pricing-plans-v2-order-orders.context.js +126 -0
- package/build/internal/cjs/src/pricing-plans-v2-order-orders.context.js.map +1 -0
- package/build/internal/cjs/src/pricing-plans-v2-order-orders.http.d.ts +149 -0
- package/build/internal/cjs/src/pricing-plans-v2-order-orders.http.js +877 -0
- package/build/internal/cjs/src/pricing-plans-v2-order-orders.http.js.map +1 -0
- package/build/internal/cjs/src/pricing-plans-v2-order-orders.meta.d.ts +43 -0
- package/build/internal/cjs/src/pricing-plans-v2-order-orders.meta.js +313 -0
- package/build/internal/cjs/src/pricing-plans-v2-order-orders.meta.js.map +1 -0
- package/build/internal/cjs/src/pricing-plans-v2-order-orders.public.d.ts +249 -0
- package/build/internal/cjs/src/pricing-plans-v2-order-orders.public.js +373 -0
- package/build/internal/cjs/src/pricing-plans-v2-order-orders.public.js.map +1 -0
- package/build/internal/cjs/src/pricing-plans-v2-order-orders.types.d.ts +1333 -0
- package/build/internal/cjs/src/pricing-plans-v2-order-orders.types.js +145 -0
- package/build/internal/cjs/src/pricing-plans-v2-order-orders.types.js.map +1 -0
- package/build/internal/cjs/src/pricing-plans-v2-order-orders.universal.d.ts +2034 -0
- package/build/internal/cjs/src/pricing-plans-v2-order-orders.universal.js +889 -0
- package/build/internal/cjs/src/pricing-plans-v2-order-orders.universal.js.map +1 -0
- package/build/internal/es/index.d.ts +1 -0
- package/build/internal/es/index.js +2 -0
- package/build/internal/es/index.js.map +1 -0
- package/build/internal/es/index.typings.d.ts +1 -0
- package/build/internal/es/index.typings.js +2 -0
- package/build/internal/es/index.typings.js.map +1 -0
- package/build/internal/es/meta.d.ts +1 -0
- package/build/internal/es/meta.js +2 -0
- package/build/internal/es/meta.js.map +1 -0
- package/build/internal/es/src/pricing-plans-v2-order-orders.context.d.ts +111 -0
- package/build/internal/es/src/pricing-plans-v2-order-orders.context.js +111 -0
- package/build/internal/es/src/pricing-plans-v2-order-orders.context.js.map +1 -0
- package/build/internal/es/src/pricing-plans-v2-order-orders.http.d.ts +149 -0
- package/build/internal/es/src/pricing-plans-v2-order-orders.http.js +859 -0
- package/build/internal/es/src/pricing-plans-v2-order-orders.http.js.map +1 -0
- package/build/internal/es/src/pricing-plans-v2-order-orders.meta.d.ts +43 -0
- package/build/internal/es/src/pricing-plans-v2-order-orders.meta.js +272 -0
- package/build/internal/es/src/pricing-plans-v2-order-orders.meta.js.map +1 -0
- package/build/internal/es/src/pricing-plans-v2-order-orders.public.d.ts +249 -0
- package/build/internal/es/src/pricing-plans-v2-order-orders.public.js +343 -0
- package/build/internal/es/src/pricing-plans-v2-order-orders.public.js.map +1 -0
- package/build/internal/es/src/pricing-plans-v2-order-orders.types.d.ts +1333 -0
- package/build/internal/es/src/pricing-plans-v2-order-orders.types.js +142 -0
- package/build/internal/es/src/pricing-plans-v2-order-orders.types.js.map +1 -0
- package/build/internal/es/src/pricing-plans-v2-order-orders.universal.d.ts +2034 -0
- package/build/internal/es/src/pricing-plans-v2-order-orders.universal.js +848 -0
- package/build/internal/es/src/pricing-plans-v2-order-orders.universal.js.map +1 -0
- package/meta/package.json +3 -0
- package/package.json +52 -0
|
@@ -0,0 +1,877 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resumeOrder = exports.pauseOrder = exports.markAsPaid = exports.cancelOrder = exports.postponeEndDate = exports.managementListOrders = exports.managementGetOrder = exports.getPricePreview = exports.getOfflineOrderPreview = exports.getOnlineOrderPreview = exports.createOfflineOrder = exports.createOnlineOrder = exports.requestCancellation = exports.memberListOrders = exports.memberGetOrder = void 0;
|
|
4
|
+
const rest_modules_1 = require("@wix/sdk-runtime/rest-modules");
|
|
5
|
+
const timestamp_1 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
6
|
+
const timestamp_2 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
7
|
+
const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
8
|
+
const rest_modules_2 = require("@wix/sdk-runtime/rest-modules");
|
|
9
|
+
function resolveComWixpressMembershipV2OrdersOrderManagementServiceUrl(opts) {
|
|
10
|
+
const domainToMappings = {
|
|
11
|
+
'api._api_base_domain_': [
|
|
12
|
+
{
|
|
13
|
+
srcPath: '/order-management-service-proxy',
|
|
14
|
+
destPath: '',
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
'*.dev.wix-code.com': [
|
|
18
|
+
{
|
|
19
|
+
srcPath: '/_api/paid-plans/v2/orders',
|
|
20
|
+
destPath: '/v2/orders',
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
'*.pub.wix-code.com': [
|
|
24
|
+
{
|
|
25
|
+
srcPath: '/_api/paid-plans/v2/orders',
|
|
26
|
+
destPath: '/v2/orders',
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
'*.wixapps.net': [
|
|
30
|
+
{
|
|
31
|
+
srcPath: '/_api/paid-plans/v2/orders',
|
|
32
|
+
destPath: '/v2/orders',
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
_: [
|
|
36
|
+
{
|
|
37
|
+
srcPath: '/_api/paid-plans/v2/orders',
|
|
38
|
+
destPath: '/v2/orders',
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
'editor-flow.wixapps.net': [
|
|
42
|
+
{
|
|
43
|
+
srcPath: '/_api/paid-plans/v2/orders',
|
|
44
|
+
destPath: '/v2/orders',
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
'editor._base_domain_': [
|
|
48
|
+
{
|
|
49
|
+
srcPath: '/_api/paid-plans/v2/orders',
|
|
50
|
+
destPath: '/v2/orders',
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
'blocks._base_domain_': [
|
|
54
|
+
{
|
|
55
|
+
srcPath: '/_api/paid-plans/v2/orders',
|
|
56
|
+
destPath: '/v2/orders',
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
'create.editorx': [
|
|
60
|
+
{
|
|
61
|
+
srcPath: '/_api/paid-plans/v2/orders',
|
|
62
|
+
destPath: '/v2/orders',
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
'editor.wixapps.net': [
|
|
66
|
+
{
|
|
67
|
+
srcPath: '/_api/paid-plans/v2/orders',
|
|
68
|
+
destPath: '/v2/orders',
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
'forums._base_domain_': [
|
|
72
|
+
{
|
|
73
|
+
srcPath: '/_api/paid-plans/v2/orders',
|
|
74
|
+
destPath: '/v2/orders',
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
'forums.wixapps.net': [
|
|
78
|
+
{
|
|
79
|
+
srcPath: '/_api/paid-plans/v2/orders',
|
|
80
|
+
destPath: '/v2/orders',
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
'manage._base_domain_': [
|
|
84
|
+
{
|
|
85
|
+
srcPath: '/_api/pricing-plans/v2/orders',
|
|
86
|
+
destPath: '/v2/orders',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
srcPath: '/_api/paid-plans/v2/orders',
|
|
90
|
+
destPath: '/v2/orders',
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
'www._base_domain_': [
|
|
94
|
+
{
|
|
95
|
+
srcPath: '/_api/paid-plans/v2/orders',
|
|
96
|
+
destPath: '/v2/orders',
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
'www.wixapis.com': [
|
|
100
|
+
{
|
|
101
|
+
srcPath: '/pricing-plans/v2/orders',
|
|
102
|
+
destPath: '/v2/orders',
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
};
|
|
106
|
+
return (0, rest_modules_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
107
|
+
}
|
|
108
|
+
function resolveComWixpressMembershipV2OrdersCheckoutServiceUrl(opts) {
|
|
109
|
+
const domainToMappings = {
|
|
110
|
+
'api._api_base_domain_': [
|
|
111
|
+
{
|
|
112
|
+
srcPath: '/pricing-plans-checkout-proxy',
|
|
113
|
+
destPath: '',
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
'*.dev.wix-code.com': [
|
|
117
|
+
{
|
|
118
|
+
srcPath: '/_api/paid-plans/v2/checkout',
|
|
119
|
+
destPath: '/v2/checkout',
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
'*.pub.wix-code.com': [
|
|
123
|
+
{
|
|
124
|
+
srcPath: '/_api/paid-plans/v2/checkout',
|
|
125
|
+
destPath: '/v2/checkout',
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
'*.wixapps.net': [
|
|
129
|
+
{
|
|
130
|
+
srcPath: '/_api/paid-plans/v2/checkout',
|
|
131
|
+
destPath: '/v2/checkout',
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
_: [
|
|
135
|
+
{
|
|
136
|
+
srcPath: '/pricing-plans/v2/checkout',
|
|
137
|
+
destPath: '/v2/checkout',
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
srcPath: '/_api/paid-plans/v2/checkout',
|
|
141
|
+
destPath: '/v2/checkout',
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
srcPath: '/_api/pricing-plans/v2/checkout',
|
|
145
|
+
destPath: '/v2/checkout',
|
|
146
|
+
},
|
|
147
|
+
],
|
|
148
|
+
'editor-flow.wixapps.net': [
|
|
149
|
+
{
|
|
150
|
+
srcPath: '/_api/paid-plans/v2/checkout',
|
|
151
|
+
destPath: '/v2/checkout',
|
|
152
|
+
},
|
|
153
|
+
],
|
|
154
|
+
'editor._base_domain_': [
|
|
155
|
+
{
|
|
156
|
+
srcPath: '/_api/paid-plans/v2/checkout',
|
|
157
|
+
destPath: '/v2/checkout',
|
|
158
|
+
},
|
|
159
|
+
],
|
|
160
|
+
'blocks._base_domain_': [
|
|
161
|
+
{
|
|
162
|
+
srcPath: '/_api/paid-plans/v2/checkout',
|
|
163
|
+
destPath: '/v2/checkout',
|
|
164
|
+
},
|
|
165
|
+
],
|
|
166
|
+
'create.editorx': [
|
|
167
|
+
{
|
|
168
|
+
srcPath: '/_api/paid-plans/v2/checkout',
|
|
169
|
+
destPath: '/v2/checkout',
|
|
170
|
+
},
|
|
171
|
+
],
|
|
172
|
+
'editor.wixapps.net': [
|
|
173
|
+
{
|
|
174
|
+
srcPath: '/_api/paid-plans/v2/checkout',
|
|
175
|
+
destPath: '/v2/checkout',
|
|
176
|
+
},
|
|
177
|
+
],
|
|
178
|
+
'forums._base_domain_': [
|
|
179
|
+
{
|
|
180
|
+
srcPath: '/_api/paid-plans/v2/checkout',
|
|
181
|
+
destPath: '/v2/checkout',
|
|
182
|
+
},
|
|
183
|
+
],
|
|
184
|
+
'forums.wixapps.net': [
|
|
185
|
+
{
|
|
186
|
+
srcPath: '/_api/paid-plans/v2/checkout',
|
|
187
|
+
destPath: '/v2/checkout',
|
|
188
|
+
},
|
|
189
|
+
],
|
|
190
|
+
'manage._base_domain_': [
|
|
191
|
+
{
|
|
192
|
+
srcPath: '/_api/pricing-plans/v2/checkout',
|
|
193
|
+
destPath: '/v2/checkout',
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
srcPath: '/_api/paid-plans/v2/checkout',
|
|
197
|
+
destPath: '/v2/checkout',
|
|
198
|
+
},
|
|
199
|
+
],
|
|
200
|
+
'www._base_domain_': [
|
|
201
|
+
{
|
|
202
|
+
srcPath: '/_api/paid-plans/v2/checkout',
|
|
203
|
+
destPath: '/v2/checkout',
|
|
204
|
+
},
|
|
205
|
+
],
|
|
206
|
+
'www.wixapis.com': [
|
|
207
|
+
{
|
|
208
|
+
srcPath: '/pricing-plans/v2/checkout',
|
|
209
|
+
destPath: '/v2/checkout',
|
|
210
|
+
},
|
|
211
|
+
],
|
|
212
|
+
};
|
|
213
|
+
return (0, rest_modules_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
214
|
+
}
|
|
215
|
+
function resolveComWixpressMembershipV2OrdersMemberMemberOrdersServiceUrl(opts) {
|
|
216
|
+
const domainToMappings = {
|
|
217
|
+
'api._api_base_domain_': [
|
|
218
|
+
{
|
|
219
|
+
srcPath: '/member-orders-service-proxy',
|
|
220
|
+
destPath: '',
|
|
221
|
+
},
|
|
222
|
+
],
|
|
223
|
+
'*.dev.wix-code.com': [
|
|
224
|
+
{
|
|
225
|
+
srcPath: '/_api/pricing-plans-member-orders/v2/member/orders',
|
|
226
|
+
destPath: '/v2/member/orders',
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
srcPath: '/_api/pricing-plans/v2/member/orders',
|
|
230
|
+
destPath: '/v2/member/orders',
|
|
231
|
+
},
|
|
232
|
+
],
|
|
233
|
+
'*.pub.wix-code.com': [
|
|
234
|
+
{
|
|
235
|
+
srcPath: '/_api/pricing-plans-member-orders/v2/member/orders',
|
|
236
|
+
destPath: '/v2/member/orders',
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
srcPath: '/_api/pricing-plans/v2/member/orders',
|
|
240
|
+
destPath: '/v2/member/orders',
|
|
241
|
+
},
|
|
242
|
+
],
|
|
243
|
+
_: [
|
|
244
|
+
{
|
|
245
|
+
srcPath: '/_api/pricing-plans/v2/member/orders',
|
|
246
|
+
destPath: '/v2/member/orders',
|
|
247
|
+
},
|
|
248
|
+
],
|
|
249
|
+
'editor.wixapps.net': [
|
|
250
|
+
{
|
|
251
|
+
srcPath: '/_api/pricing-plans/v2/member/orders',
|
|
252
|
+
destPath: '/v2/member/orders',
|
|
253
|
+
},
|
|
254
|
+
],
|
|
255
|
+
'manage._base_domain_': [
|
|
256
|
+
{
|
|
257
|
+
srcPath: '/_api/pricing-plans/v2/member/orders',
|
|
258
|
+
destPath: '/v2/member/orders',
|
|
259
|
+
},
|
|
260
|
+
],
|
|
261
|
+
'www._base_domain_': [
|
|
262
|
+
{
|
|
263
|
+
srcPath: '/_api/pricing-plans/v2/member/orders',
|
|
264
|
+
destPath: '/v2/member/orders',
|
|
265
|
+
},
|
|
266
|
+
],
|
|
267
|
+
'www.wixapis.com': [
|
|
268
|
+
{
|
|
269
|
+
srcPath: '/pricing-plans/v2/member/orders',
|
|
270
|
+
destPath: '/v2/member/orders',
|
|
271
|
+
},
|
|
272
|
+
],
|
|
273
|
+
};
|
|
274
|
+
return (0, rest_modules_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
275
|
+
}
|
|
276
|
+
const PACKAGE_NAME = '@wix/auto_sdk_pricing-plans_orders';
|
|
277
|
+
/** Retrieves an order for the currently logged-in member by ID. */
|
|
278
|
+
function memberGetOrder(payload) {
|
|
279
|
+
function __memberGetOrder({ host }) {
|
|
280
|
+
const metadata = {
|
|
281
|
+
entityFqdn: 'wix.pricing_plans.v2.order',
|
|
282
|
+
method: 'GET',
|
|
283
|
+
methodFqn: 'com.wixpress.membership.v2.orders.member.MemberOrdersService.GetOrder',
|
|
284
|
+
packageName: PACKAGE_NAME,
|
|
285
|
+
url: resolveComWixpressMembershipV2OrdersMemberMemberOrdersServiceUrl({
|
|
286
|
+
protoPath: '/v2/member/orders/{id}',
|
|
287
|
+
data: payload,
|
|
288
|
+
host,
|
|
289
|
+
}),
|
|
290
|
+
params: (0, rest_modules_1.toURLSearchParams)(payload),
|
|
291
|
+
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
292
|
+
{
|
|
293
|
+
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
294
|
+
paths: [
|
|
295
|
+
{ path: 'order.startDate' },
|
|
296
|
+
{ path: 'order.endDate' },
|
|
297
|
+
{ path: 'order.earliestEndDate' },
|
|
298
|
+
{ path: 'order.createdDate' },
|
|
299
|
+
{ path: 'order.updatedDate' },
|
|
300
|
+
{ path: 'order.cancellation.requestedDate' },
|
|
301
|
+
{ path: 'order.pausePeriods.pauseDate' },
|
|
302
|
+
{ path: 'order.pausePeriods.resumeDate' },
|
|
303
|
+
{ path: 'order.currentCycle.startedDate' },
|
|
304
|
+
{ path: 'order.currentCycle.endedDate' },
|
|
305
|
+
{ path: 'order.cycles.startedDate' },
|
|
306
|
+
{ path: 'order.cycles.endedDate' },
|
|
307
|
+
],
|
|
308
|
+
},
|
|
309
|
+
]),
|
|
310
|
+
};
|
|
311
|
+
return metadata;
|
|
312
|
+
}
|
|
313
|
+
return __memberGetOrder;
|
|
314
|
+
}
|
|
315
|
+
exports.memberGetOrder = memberGetOrder;
|
|
316
|
+
/** Retrieves a list of up to 100 pricing plan orders for currently logged-in member. */
|
|
317
|
+
function memberListOrders(payload) {
|
|
318
|
+
function __memberListOrders({ host }) {
|
|
319
|
+
const metadata = {
|
|
320
|
+
entityFqdn: 'wix.pricing_plans.v2.order',
|
|
321
|
+
method: 'GET',
|
|
322
|
+
methodFqn: 'com.wixpress.membership.v2.orders.member.MemberOrdersService.ListOrders',
|
|
323
|
+
packageName: PACKAGE_NAME,
|
|
324
|
+
url: resolveComWixpressMembershipV2OrdersMemberMemberOrdersServiceUrl({
|
|
325
|
+
protoPath: '/v2/member/orders',
|
|
326
|
+
data: payload,
|
|
327
|
+
host,
|
|
328
|
+
}),
|
|
329
|
+
params: (0, rest_modules_1.toURLSearchParams)(payload, true),
|
|
330
|
+
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
331
|
+
{
|
|
332
|
+
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
333
|
+
paths: [
|
|
334
|
+
{ path: 'orders.startDate' },
|
|
335
|
+
{ path: 'orders.endDate' },
|
|
336
|
+
{ path: 'orders.earliestEndDate' },
|
|
337
|
+
{ path: 'orders.createdDate' },
|
|
338
|
+
{ path: 'orders.updatedDate' },
|
|
339
|
+
{ path: 'orders.cancellation.requestedDate' },
|
|
340
|
+
{ path: 'orders.pausePeriods.pauseDate' },
|
|
341
|
+
{ path: 'orders.pausePeriods.resumeDate' },
|
|
342
|
+
{ path: 'orders.currentCycle.startedDate' },
|
|
343
|
+
{ path: 'orders.currentCycle.endedDate' },
|
|
344
|
+
{ path: 'orders.cycles.startedDate' },
|
|
345
|
+
{ path: 'orders.cycles.endedDate' },
|
|
346
|
+
],
|
|
347
|
+
},
|
|
348
|
+
]),
|
|
349
|
+
};
|
|
350
|
+
return metadata;
|
|
351
|
+
}
|
|
352
|
+
return __memberListOrders;
|
|
353
|
+
}
|
|
354
|
+
exports.memberListOrders = memberListOrders;
|
|
355
|
+
/**
|
|
356
|
+
* Cancels an order. Recurring orders can be canceled either immediately or at the next payment date. One time orders can only be canceled immediately.
|
|
357
|
+
*
|
|
358
|
+
* There may be some operations that continue to be processed before the status of the order is changed to `"CANCELED"`. For example, payments might need to be refunded before the order is fully canceled.
|
|
359
|
+
*
|
|
360
|
+
* Canceling during the free trial period: When a buyer cancels their order during the free trial period, the buyer's subscription expires at the end of the free trial period and they won't be billed. The buyer may continue using the benefits until the end of the free trial period.
|
|
361
|
+
*
|
|
362
|
+
* >**Note:**
|
|
363
|
+
* >This method requires [visitor or member authentication](https://dev.wix.com/docs/rest/articles/getting-started/access-types-and-permissions).
|
|
364
|
+
*/
|
|
365
|
+
function requestCancellation(payload) {
|
|
366
|
+
function __requestCancellation({ host }) {
|
|
367
|
+
const metadata = {
|
|
368
|
+
entityFqdn: 'wix.pricing_plans.v2.order',
|
|
369
|
+
method: 'POST',
|
|
370
|
+
methodFqn: 'com.wixpress.membership.v2.orders.member.MemberOrdersService.RequestCancellation',
|
|
371
|
+
packageName: PACKAGE_NAME,
|
|
372
|
+
url: resolveComWixpressMembershipV2OrdersMemberMemberOrdersServiceUrl({
|
|
373
|
+
protoPath: '/v2/member/orders/{id}/cancel',
|
|
374
|
+
data: payload,
|
|
375
|
+
host,
|
|
376
|
+
}),
|
|
377
|
+
data: payload,
|
|
378
|
+
};
|
|
379
|
+
return metadata;
|
|
380
|
+
}
|
|
381
|
+
return __requestCancellation;
|
|
382
|
+
}
|
|
383
|
+
exports.requestCancellation = requestCancellation;
|
|
384
|
+
/**
|
|
385
|
+
* Creates an online order for a site member.
|
|
386
|
+
*
|
|
387
|
+
* If this method is called by a site member ([SDK](https://dev.wix.com/docs/sdk/articles/get-started/about-identities#site-member) | [REST](https://dev.wix.com/docs/rest/articles/getting-started/about-identities#site-member)), the plan is automatically ordered on behalf of that site member. Otherwise, you must specify `onBehalf.memberId` in your call.
|
|
388
|
+
*
|
|
389
|
+
* When an online order is created, but payment hasn't been processed, its status is set to `DRAFT`. After the payment has been processed, if the start date is in the future the order's status is set to `PENDING`. Otherwise, it's set to `ACTIVE`.
|
|
390
|
+
*/
|
|
391
|
+
function createOnlineOrder(payload) {
|
|
392
|
+
function __createOnlineOrder({ host }) {
|
|
393
|
+
const serializedData = (0, transform_paths_1.transformPaths)(payload, [
|
|
394
|
+
{
|
|
395
|
+
transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
|
|
396
|
+
paths: [{ path: 'startDate' }],
|
|
397
|
+
},
|
|
398
|
+
]);
|
|
399
|
+
const metadata = {
|
|
400
|
+
entityFqdn: 'wix.pricing_plans.v2.order',
|
|
401
|
+
method: 'POST',
|
|
402
|
+
methodFqn: 'com.wixpress.membership.v2.orders.CheckoutService.CreateOnlineOrder',
|
|
403
|
+
packageName: PACKAGE_NAME,
|
|
404
|
+
url: resolveComWixpressMembershipV2OrdersCheckoutServiceUrl({
|
|
405
|
+
protoPath: '/v2/checkout/orders/online',
|
|
406
|
+
data: serializedData,
|
|
407
|
+
host,
|
|
408
|
+
}),
|
|
409
|
+
data: serializedData,
|
|
410
|
+
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
411
|
+
{
|
|
412
|
+
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
413
|
+
paths: [
|
|
414
|
+
{ path: 'order.startDate' },
|
|
415
|
+
{ path: 'order.endDate' },
|
|
416
|
+
{ path: 'order.earliestEndDate' },
|
|
417
|
+
{ path: 'order.createdDate' },
|
|
418
|
+
{ path: 'order.updatedDate' },
|
|
419
|
+
{ path: 'order.cancellation.requestedDate' },
|
|
420
|
+
{ path: 'order.pausePeriods.pauseDate' },
|
|
421
|
+
{ path: 'order.pausePeriods.resumeDate' },
|
|
422
|
+
{ path: 'order.currentCycle.startedDate' },
|
|
423
|
+
{ path: 'order.currentCycle.endedDate' },
|
|
424
|
+
{ path: 'order.cycles.startedDate' },
|
|
425
|
+
{ path: 'order.cycles.endedDate' },
|
|
426
|
+
],
|
|
427
|
+
},
|
|
428
|
+
]),
|
|
429
|
+
};
|
|
430
|
+
return metadata;
|
|
431
|
+
}
|
|
432
|
+
return __createOnlineOrder;
|
|
433
|
+
}
|
|
434
|
+
exports.createOnlineOrder = createOnlineOrder;
|
|
435
|
+
/**
|
|
436
|
+
* Creates an order for a buyer who purchased the plan with an offline transaction.
|
|
437
|
+
*
|
|
438
|
+
* An offline order is handled off of the Wix site and is marked as `type`: `offline`. If a pricing plan
|
|
439
|
+
* has a limit on the amount of purchases per buyer, that limit is ignored for offline orders.
|
|
440
|
+
* Tax is only applied if the site [has it configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection).
|
|
441
|
+
*
|
|
442
|
+
* When creating a free offline order:
|
|
443
|
+
* The order's status is set to `"PENDING"` if the start date is in the future. Otherwise, the status is set to `"ACTIVE"`.
|
|
444
|
+
* The order's last payment status is set to `"NOT_APPLICABLE"`. "
|
|
445
|
+
*
|
|
446
|
+
* When creating a non-free offline order:
|
|
447
|
+
* The order's status is set to `"PENDING"` if the start date is in the future. Otherwise, the status is set to `"ACTIVE"`.
|
|
448
|
+
* The order's last payment status is set to `"UNPAID"` or `"PAID"` based on the data passed in the `paid` boolean in the request.
|
|
449
|
+
*
|
|
450
|
+
* Payment for an offline order can be set in 1 of 2 ways:
|
|
451
|
+
* + During order creation, set `paid`: `true`.
|
|
452
|
+
* + After creation, call Mark As Paid.
|
|
453
|
+
*/
|
|
454
|
+
function createOfflineOrder(payload) {
|
|
455
|
+
function __createOfflineOrder({ host }) {
|
|
456
|
+
const serializedData = (0, transform_paths_1.transformPaths)(payload, [
|
|
457
|
+
{
|
|
458
|
+
transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
|
|
459
|
+
paths: [{ path: 'startDate' }],
|
|
460
|
+
},
|
|
461
|
+
]);
|
|
462
|
+
const metadata = {
|
|
463
|
+
entityFqdn: 'wix.pricing_plans.v2.order',
|
|
464
|
+
method: 'POST',
|
|
465
|
+
methodFqn: 'com.wixpress.membership.v2.orders.CheckoutService.CreateOfflineOrder',
|
|
466
|
+
packageName: PACKAGE_NAME,
|
|
467
|
+
url: resolveComWixpressMembershipV2OrdersCheckoutServiceUrl({
|
|
468
|
+
protoPath: '/v2/checkout/orders/offline',
|
|
469
|
+
data: serializedData,
|
|
470
|
+
host,
|
|
471
|
+
}),
|
|
472
|
+
data: serializedData,
|
|
473
|
+
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
474
|
+
{
|
|
475
|
+
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
476
|
+
paths: [
|
|
477
|
+
{ path: 'order.startDate' },
|
|
478
|
+
{ path: 'order.endDate' },
|
|
479
|
+
{ path: 'order.earliestEndDate' },
|
|
480
|
+
{ path: 'order.createdDate' },
|
|
481
|
+
{ path: 'order.updatedDate' },
|
|
482
|
+
{ path: 'order.cancellation.requestedDate' },
|
|
483
|
+
{ path: 'order.pausePeriods.pauseDate' },
|
|
484
|
+
{ path: 'order.pausePeriods.resumeDate' },
|
|
485
|
+
{ path: 'order.currentCycle.startedDate' },
|
|
486
|
+
{ path: 'order.currentCycle.endedDate' },
|
|
487
|
+
{ path: 'order.cycles.startedDate' },
|
|
488
|
+
{ path: 'order.cycles.endedDate' },
|
|
489
|
+
],
|
|
490
|
+
},
|
|
491
|
+
]),
|
|
492
|
+
};
|
|
493
|
+
return metadata;
|
|
494
|
+
}
|
|
495
|
+
return __createOfflineOrder;
|
|
496
|
+
}
|
|
497
|
+
exports.createOfflineOrder = createOfflineOrder;
|
|
498
|
+
/**
|
|
499
|
+
* Returns an `order` object that represents a potential online order for a site member.
|
|
500
|
+
*
|
|
501
|
+
* You can use this method to show a site member a preview of an online order before [creating](https://dev.wix.com/docs/rest/business-solutions/pricing-plans/pricing-plans/orders/create-online-order) it.
|
|
502
|
+
*
|
|
503
|
+
* This method must be called using the site member identity ([SDK](https://dev.wix.com/docs/sdk/articles/get-started/about-identities#site-member) | [REST](https://dev.wix.com/docs/rest/articles/getting-started/about-identities#site-member)). Therefore, [Wix apps](https://dev.wix.com/docs/build-apps) can't currently call this method using REST.
|
|
504
|
+
*/
|
|
505
|
+
function getOnlineOrderPreview(payload) {
|
|
506
|
+
function __getOnlineOrderPreview({ host }) {
|
|
507
|
+
const serializedData = (0, transform_paths_1.transformPaths)(payload, [
|
|
508
|
+
{
|
|
509
|
+
transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
|
|
510
|
+
paths: [{ path: 'startDate' }],
|
|
511
|
+
},
|
|
512
|
+
]);
|
|
513
|
+
const metadata = {
|
|
514
|
+
entityFqdn: 'wix.pricing_plans.v2.order',
|
|
515
|
+
method: 'POST',
|
|
516
|
+
methodFqn: 'com.wixpress.membership.v2.orders.CheckoutService.GetOnlineOrderPreview',
|
|
517
|
+
packageName: PACKAGE_NAME,
|
|
518
|
+
url: resolveComWixpressMembershipV2OrdersCheckoutServiceUrl({
|
|
519
|
+
protoPath: '/v2/checkout/orders/preview-online',
|
|
520
|
+
data: serializedData,
|
|
521
|
+
host,
|
|
522
|
+
}),
|
|
523
|
+
data: serializedData,
|
|
524
|
+
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
525
|
+
{
|
|
526
|
+
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
527
|
+
paths: [
|
|
528
|
+
{ path: 'order.startDate' },
|
|
529
|
+
{ path: 'order.endDate' },
|
|
530
|
+
{ path: 'order.earliestEndDate' },
|
|
531
|
+
{ path: 'order.createdDate' },
|
|
532
|
+
{ path: 'order.updatedDate' },
|
|
533
|
+
{ path: 'order.cancellation.requestedDate' },
|
|
534
|
+
{ path: 'order.pausePeriods.pauseDate' },
|
|
535
|
+
{ path: 'order.pausePeriods.resumeDate' },
|
|
536
|
+
{ path: 'order.currentCycle.startedDate' },
|
|
537
|
+
{ path: 'order.currentCycle.endedDate' },
|
|
538
|
+
{ path: 'order.cycles.startedDate' },
|
|
539
|
+
{ path: 'order.cycles.endedDate' },
|
|
540
|
+
],
|
|
541
|
+
},
|
|
542
|
+
]),
|
|
543
|
+
};
|
|
544
|
+
return metadata;
|
|
545
|
+
}
|
|
546
|
+
return __getOnlineOrderPreview;
|
|
547
|
+
}
|
|
548
|
+
exports.getOnlineOrderPreview = getOnlineOrderPreview;
|
|
549
|
+
/**
|
|
550
|
+
* Performs a dry run of a purchase and provides an order preview.
|
|
551
|
+
*
|
|
552
|
+
* The preview uses the same logic as purchasing a plan, but the preview is not saved. Because an order is not actually
|
|
553
|
+
* created, the preview order's `orderId` and `subscriptionId` are displayed as a string of multiple zero characters
|
|
554
|
+
* (`000000-0000`). Tax is only calculated if the site [has it configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection).
|
|
555
|
+
* <br>
|
|
556
|
+
* If a pricing plan has a limit on the amount of purchases per buyer, that limit is not considered for generating the preview.
|
|
557
|
+
* But, if that limit has been reached and this order would then exceed the amount of purchases permitted for this buyer, then
|
|
558
|
+
* `purchaseLimitExceeded` will return as `true`.
|
|
559
|
+
*
|
|
560
|
+
* To get a general price preview for a plan that's not buyer-specific, call Get Price Preview.
|
|
561
|
+
*/
|
|
562
|
+
function getOfflineOrderPreview(payload) {
|
|
563
|
+
function __getOfflineOrderPreview({ host }) {
|
|
564
|
+
const serializedData = (0, transform_paths_1.transformPaths)(payload, [
|
|
565
|
+
{
|
|
566
|
+
transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
|
|
567
|
+
paths: [{ path: 'startDate' }],
|
|
568
|
+
},
|
|
569
|
+
]);
|
|
570
|
+
const metadata = {
|
|
571
|
+
entityFqdn: 'wix.pricing_plans.v2.order',
|
|
572
|
+
method: 'POST',
|
|
573
|
+
methodFqn: 'com.wixpress.membership.v2.orders.CheckoutService.GetOfflineOrderPreview',
|
|
574
|
+
packageName: PACKAGE_NAME,
|
|
575
|
+
url: resolveComWixpressMembershipV2OrdersCheckoutServiceUrl({
|
|
576
|
+
protoPath: '/v2/checkout/orders/preview-offline',
|
|
577
|
+
data: serializedData,
|
|
578
|
+
host,
|
|
579
|
+
}),
|
|
580
|
+
data: serializedData,
|
|
581
|
+
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
582
|
+
{
|
|
583
|
+
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
584
|
+
paths: [
|
|
585
|
+
{ path: 'order.startDate' },
|
|
586
|
+
{ path: 'order.endDate' },
|
|
587
|
+
{ path: 'order.earliestEndDate' },
|
|
588
|
+
{ path: 'order.createdDate' },
|
|
589
|
+
{ path: 'order.updatedDate' },
|
|
590
|
+
{ path: 'order.cancellation.requestedDate' },
|
|
591
|
+
{ path: 'order.pausePeriods.pauseDate' },
|
|
592
|
+
{ path: 'order.pausePeriods.resumeDate' },
|
|
593
|
+
{ path: 'order.currentCycle.startedDate' },
|
|
594
|
+
{ path: 'order.currentCycle.endedDate' },
|
|
595
|
+
{ path: 'order.cycles.startedDate' },
|
|
596
|
+
{ path: 'order.cycles.endedDate' },
|
|
597
|
+
],
|
|
598
|
+
},
|
|
599
|
+
]),
|
|
600
|
+
};
|
|
601
|
+
return metadata;
|
|
602
|
+
}
|
|
603
|
+
return __getOfflineOrderPreview;
|
|
604
|
+
}
|
|
605
|
+
exports.getOfflineOrderPreview = getOfflineOrderPreview;
|
|
606
|
+
/**
|
|
607
|
+
* Retrieves a plan's pricing.
|
|
608
|
+
*
|
|
609
|
+
* The price preview uses the same logic as purchasing a plan, but the preview is not saved. Tax is only applied if
|
|
610
|
+
* the site [has it configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection). The price is returned
|
|
611
|
+
* in the pricing model format used for orders. Learn more about pricing models ([REST](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/introduction#wix-pricing-plans_pricing-plans_introduction_pricing-models)|[SDK](https://dev.wix.com/docs/sdk/backend-modules/pricing-plans/introduction#pricing-models)).
|
|
612
|
+
*
|
|
613
|
+
* Buyers do not have to be logged in to preview the price, and as such, the details returned are not buyer-specific. To
|
|
614
|
+
* generate a preview of a purchase for a specific buyer, call Get Offline Order Preview.
|
|
615
|
+
*/
|
|
616
|
+
function getPricePreview(payload) {
|
|
617
|
+
function __getPricePreview({ host }) {
|
|
618
|
+
const metadata = {
|
|
619
|
+
entityFqdn: 'wix.pricing_plans.v2.order',
|
|
620
|
+
method: 'POST',
|
|
621
|
+
methodFqn: 'com.wixpress.membership.v2.orders.CheckoutService.GetPricePreview',
|
|
622
|
+
packageName: PACKAGE_NAME,
|
|
623
|
+
url: resolveComWixpressMembershipV2OrdersCheckoutServiceUrl({
|
|
624
|
+
protoPath: '/v2/checkout/orders/price-preview',
|
|
625
|
+
data: payload,
|
|
626
|
+
host,
|
|
627
|
+
}),
|
|
628
|
+
data: payload,
|
|
629
|
+
};
|
|
630
|
+
return metadata;
|
|
631
|
+
}
|
|
632
|
+
return __getPricePreview;
|
|
633
|
+
}
|
|
634
|
+
exports.getPricePreview = getPricePreview;
|
|
635
|
+
/** Retrieves an order by ID. */
|
|
636
|
+
function managementGetOrder(payload) {
|
|
637
|
+
function __managementGetOrder({ host }) {
|
|
638
|
+
const metadata = {
|
|
639
|
+
entityFqdn: 'wix.pricing_plans.v2.order',
|
|
640
|
+
method: 'GET',
|
|
641
|
+
methodFqn: 'com.wixpress.membership.v2.orders.OrderManagementService.GetOrder',
|
|
642
|
+
packageName: PACKAGE_NAME,
|
|
643
|
+
url: resolveComWixpressMembershipV2OrdersOrderManagementServiceUrl({
|
|
644
|
+
protoPath: '/v2/orders/{id}',
|
|
645
|
+
data: payload,
|
|
646
|
+
host,
|
|
647
|
+
}),
|
|
648
|
+
params: (0, rest_modules_1.toURLSearchParams)(payload),
|
|
649
|
+
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
650
|
+
{
|
|
651
|
+
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
652
|
+
paths: [
|
|
653
|
+
{ path: 'order.startDate' },
|
|
654
|
+
{ path: 'order.endDate' },
|
|
655
|
+
{ path: 'order.earliestEndDate' },
|
|
656
|
+
{ path: 'order.createdDate' },
|
|
657
|
+
{ path: 'order.updatedDate' },
|
|
658
|
+
{ path: 'order.cancellation.requestedDate' },
|
|
659
|
+
{ path: 'order.pausePeriods.pauseDate' },
|
|
660
|
+
{ path: 'order.pausePeriods.resumeDate' },
|
|
661
|
+
{ path: 'order.currentCycle.startedDate' },
|
|
662
|
+
{ path: 'order.currentCycle.endedDate' },
|
|
663
|
+
{ path: 'order.cycles.startedDate' },
|
|
664
|
+
{ path: 'order.cycles.endedDate' },
|
|
665
|
+
],
|
|
666
|
+
},
|
|
667
|
+
]),
|
|
668
|
+
};
|
|
669
|
+
return metadata;
|
|
670
|
+
}
|
|
671
|
+
return __managementGetOrder;
|
|
672
|
+
}
|
|
673
|
+
exports.managementGetOrder = managementGetOrder;
|
|
674
|
+
/**
|
|
675
|
+
* Retrieves a list of up to 50 pricing plan orders and details, given the specified sorting and filtering.
|
|
676
|
+
*
|
|
677
|
+
* By default, this endpoint will retrieve all orders and return them sorted by `createdDate` in `DESC`, descending order.
|
|
678
|
+
* `sort.fieldName` supports `endDate` and `createdDate` fields and defaults to `ASC`, ascending order.
|
|
679
|
+
*/
|
|
680
|
+
function managementListOrders(payload) {
|
|
681
|
+
function __managementListOrders({ host }) {
|
|
682
|
+
const metadata = {
|
|
683
|
+
entityFqdn: 'wix.pricing_plans.v2.order',
|
|
684
|
+
method: 'GET',
|
|
685
|
+
methodFqn: 'com.wixpress.membership.v2.orders.OrderManagementService.ListOrders',
|
|
686
|
+
packageName: PACKAGE_NAME,
|
|
687
|
+
url: resolveComWixpressMembershipV2OrdersOrderManagementServiceUrl({
|
|
688
|
+
protoPath: '/v2/orders',
|
|
689
|
+
data: payload,
|
|
690
|
+
host,
|
|
691
|
+
}),
|
|
692
|
+
params: (0, rest_modules_1.toURLSearchParams)(payload, true),
|
|
693
|
+
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
694
|
+
{
|
|
695
|
+
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
696
|
+
paths: [
|
|
697
|
+
{ path: 'orders.startDate' },
|
|
698
|
+
{ path: 'orders.endDate' },
|
|
699
|
+
{ path: 'orders.earliestEndDate' },
|
|
700
|
+
{ path: 'orders.createdDate' },
|
|
701
|
+
{ path: 'orders.updatedDate' },
|
|
702
|
+
{ path: 'orders.cancellation.requestedDate' },
|
|
703
|
+
{ path: 'orders.pausePeriods.pauseDate' },
|
|
704
|
+
{ path: 'orders.pausePeriods.resumeDate' },
|
|
705
|
+
{ path: 'orders.currentCycle.startedDate' },
|
|
706
|
+
{ path: 'orders.currentCycle.endedDate' },
|
|
707
|
+
{ path: 'orders.cycles.startedDate' },
|
|
708
|
+
{ path: 'orders.cycles.endedDate' },
|
|
709
|
+
],
|
|
710
|
+
},
|
|
711
|
+
]),
|
|
712
|
+
};
|
|
713
|
+
return metadata;
|
|
714
|
+
}
|
|
715
|
+
return __managementListOrders;
|
|
716
|
+
}
|
|
717
|
+
exports.managementListOrders = managementListOrders;
|
|
718
|
+
/**
|
|
719
|
+
* Extends the duration of a pricing plan order by postponing the order's `endDate`. Postponing the end date of an order does not impact payments.
|
|
720
|
+
*
|
|
721
|
+
* New `endDate` must be later than the order's current `endDate`. Can't postpone orders that are unlimited.
|
|
722
|
+
* Can't postpone an order with `status`: `PAUSED`.
|
|
723
|
+
*/
|
|
724
|
+
function postponeEndDate(payload) {
|
|
725
|
+
function __postponeEndDate({ host }) {
|
|
726
|
+
const serializedData = (0, transform_paths_1.transformPaths)(payload, [
|
|
727
|
+
{
|
|
728
|
+
transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
|
|
729
|
+
paths: [{ path: 'endDate' }],
|
|
730
|
+
},
|
|
731
|
+
]);
|
|
732
|
+
const metadata = {
|
|
733
|
+
entityFqdn: 'wix.pricing_plans.v2.order',
|
|
734
|
+
method: 'PATCH',
|
|
735
|
+
methodFqn: 'com.wixpress.membership.v2.orders.OrderManagementService.PostponeEndDate',
|
|
736
|
+
packageName: PACKAGE_NAME,
|
|
737
|
+
url: resolveComWixpressMembershipV2OrdersOrderManagementServiceUrl({
|
|
738
|
+
protoPath: '/v2/orders/{id}',
|
|
739
|
+
data: serializedData,
|
|
740
|
+
host,
|
|
741
|
+
}),
|
|
742
|
+
data: serializedData,
|
|
743
|
+
};
|
|
744
|
+
return metadata;
|
|
745
|
+
}
|
|
746
|
+
return __postponeEndDate;
|
|
747
|
+
}
|
|
748
|
+
exports.postponeEndDate = postponeEndDate;
|
|
749
|
+
/**
|
|
750
|
+
* Cancels an existing order.
|
|
751
|
+
*
|
|
752
|
+
* For orders with recurring payments, a cancellation can be set to occur either `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`.
|
|
753
|
+
* For orders with one-time payments, a cancellation can only be set for `IMMEDIATELY`.
|
|
754
|
+
*
|
|
755
|
+
* #### Canceling during the free trial period.
|
|
756
|
+
*
|
|
757
|
+
* When a buyer cancels their order during the free trial period, the buyer's subscription expires at the end
|
|
758
|
+
* of the free trial period and they will not be billed. The buyer may continue using the benefits until the end
|
|
759
|
+
* of the free trial period.
|
|
760
|
+
*
|
|
761
|
+
* When a Wix user cancels an ordered plan during the free trial period, they choose whether to apply the cancellation
|
|
762
|
+
* `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`. Canceling `IMMEDIATELY` will end the subscription for the buyer
|
|
763
|
+
* immediately, even during the free trial period and the buyer won't be billed. Canceling at the
|
|
764
|
+
* `NEXT_PAYMENT_DATE` allows the buyer to continue using the benefits of the subscription until the end of the free trial period.
|
|
765
|
+
* Then, the subscription ends and the buyer is not billed.
|
|
766
|
+
*/
|
|
767
|
+
function cancelOrder(payload) {
|
|
768
|
+
function __cancelOrder({ host }) {
|
|
769
|
+
const metadata = {
|
|
770
|
+
entityFqdn: 'wix.pricing_plans.v2.order',
|
|
771
|
+
method: 'POST',
|
|
772
|
+
methodFqn: 'com.wixpress.membership.v2.orders.OrderManagementService.CancelOrder',
|
|
773
|
+
packageName: PACKAGE_NAME,
|
|
774
|
+
url: resolveComWixpressMembershipV2OrdersOrderManagementServiceUrl({
|
|
775
|
+
protoPath: '/v2/orders/{id}/cancel',
|
|
776
|
+
data: payload,
|
|
777
|
+
host,
|
|
778
|
+
}),
|
|
779
|
+
data: payload,
|
|
780
|
+
};
|
|
781
|
+
return metadata;
|
|
782
|
+
}
|
|
783
|
+
return __cancelOrder;
|
|
784
|
+
}
|
|
785
|
+
exports.cancelOrder = cancelOrder;
|
|
786
|
+
/**
|
|
787
|
+
* Marks an offline order as paid.
|
|
788
|
+
* > __Note__: Marking separate payment cycles as paid is not yet supported. The entire order will be marked as paid. Subsequent offline payments do trigger events and emails, but are not registered as additional offline payments.
|
|
789
|
+
*
|
|
790
|
+
* Marking an offline order as paid causes the following changes:
|
|
791
|
+
* - The order's `lastPaymentStatus` changes to `"PAID"`.
|
|
792
|
+
* - The order's status changes to either `"PENDING"` or `"ACTIVE"`, depending on the order's `startDate`.
|
|
793
|
+
*
|
|
794
|
+
* An error occurs if you attempt to:
|
|
795
|
+
* - Mark an already-paid, offline order as paid. You cannot mark an offline order as paid twice.
|
|
796
|
+
* - Mark an online order as paid. The Mark as Paid method is supported for offline orders only.
|
|
797
|
+
*/
|
|
798
|
+
function markAsPaid(payload) {
|
|
799
|
+
function __markAsPaid({ host }) {
|
|
800
|
+
const metadata = {
|
|
801
|
+
entityFqdn: 'wix.pricing_plans.v2.order',
|
|
802
|
+
method: 'POST',
|
|
803
|
+
methodFqn: 'com.wixpress.membership.v2.orders.OrderManagementService.MarkAsPaid',
|
|
804
|
+
packageName: PACKAGE_NAME,
|
|
805
|
+
url: resolveComWixpressMembershipV2OrdersOrderManagementServiceUrl({
|
|
806
|
+
protoPath: '/v2/orders/{id}/mark-as-paid',
|
|
807
|
+
data: payload,
|
|
808
|
+
host,
|
|
809
|
+
}),
|
|
810
|
+
data: payload,
|
|
811
|
+
};
|
|
812
|
+
return metadata;
|
|
813
|
+
}
|
|
814
|
+
return __markAsPaid;
|
|
815
|
+
}
|
|
816
|
+
exports.markAsPaid = markAsPaid;
|
|
817
|
+
/**
|
|
818
|
+
* Pauses an order. Calling this method changes the order status to `"PAUSED"` and updates the `pausePeriods` array.
|
|
819
|
+
*
|
|
820
|
+
* Only orders with `status`: `ACTIVE` can be paused.
|
|
821
|
+
* For orders with recurring payments, it also pauses the payment schedule. Buyers are not charged when an order is paused.
|
|
822
|
+
* Pausing an order affects the end date of the order by adding the time the order is paused to the `endDate`.
|
|
823
|
+
* The `endDate` and the `earliestEndDate` for the order are adjusted to include the pause period when the order is resumed.
|
|
824
|
+
*
|
|
825
|
+
* To resume a paused order, call Resume Order.
|
|
826
|
+
*/
|
|
827
|
+
function pauseOrder(payload) {
|
|
828
|
+
function __pauseOrder({ host }) {
|
|
829
|
+
const metadata = {
|
|
830
|
+
entityFqdn: 'wix.pricing_plans.v2.order',
|
|
831
|
+
method: 'POST',
|
|
832
|
+
methodFqn: 'com.wixpress.membership.v2.orders.OrderManagementService.PauseOrder',
|
|
833
|
+
packageName: PACKAGE_NAME,
|
|
834
|
+
url: resolveComWixpressMembershipV2OrdersOrderManagementServiceUrl({
|
|
835
|
+
protoPath: '/v2/orders/{id}/pause',
|
|
836
|
+
data: payload,
|
|
837
|
+
host,
|
|
838
|
+
}),
|
|
839
|
+
data: payload,
|
|
840
|
+
};
|
|
841
|
+
return metadata;
|
|
842
|
+
}
|
|
843
|
+
return __pauseOrder;
|
|
844
|
+
}
|
|
845
|
+
exports.pauseOrder = pauseOrder;
|
|
846
|
+
/**
|
|
847
|
+
* Resumes a paused order. For orders with recurring payments, it also restarts the payment schedule.
|
|
848
|
+
*
|
|
849
|
+
* Resuming an order causes the following changes:
|
|
850
|
+
* - The order status changes to `"ACTIVE"`.
|
|
851
|
+
* - The `pausePeriods` array is updated.
|
|
852
|
+
* - The `endDate` for the order is adjusted to include the pause period.
|
|
853
|
+
* - For orders with recurring payments, the payment schedule is restarted.
|
|
854
|
+
* - The `earliestEndDate` is adjusted to include the pause period. (This property is reserved for future use).
|
|
855
|
+
*
|
|
856
|
+
* To pause an order, call Pause Order.
|
|
857
|
+
*/
|
|
858
|
+
function resumeOrder(payload) {
|
|
859
|
+
function __resumeOrder({ host }) {
|
|
860
|
+
const metadata = {
|
|
861
|
+
entityFqdn: 'wix.pricing_plans.v2.order',
|
|
862
|
+
method: 'POST',
|
|
863
|
+
methodFqn: 'com.wixpress.membership.v2.orders.OrderManagementService.ResumeOrder',
|
|
864
|
+
packageName: PACKAGE_NAME,
|
|
865
|
+
url: resolveComWixpressMembershipV2OrdersOrderManagementServiceUrl({
|
|
866
|
+
protoPath: '/v2/orders/{id}/resume',
|
|
867
|
+
data: payload,
|
|
868
|
+
host,
|
|
869
|
+
}),
|
|
870
|
+
data: payload,
|
|
871
|
+
};
|
|
872
|
+
return metadata;
|
|
873
|
+
}
|
|
874
|
+
return __resumeOrder;
|
|
875
|
+
}
|
|
876
|
+
exports.resumeOrder = resumeOrder;
|
|
877
|
+
//# sourceMappingURL=pricing-plans-v2-order-orders.http.js.map
|