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