@wix/auto_sdk_pricing-plans_orders 1.0.2 → 1.0.4

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.
Files changed (73) hide show
  1. package/build/cjs/src/pricing-plans-v2-order-orders.context.d.ts +42 -42
  2. package/build/cjs/src/pricing-plans-v2-order-orders.context.js +46 -46
  3. package/build/cjs/src/pricing-plans-v2-order-orders.context.js.map +1 -1
  4. package/build/cjs/src/pricing-plans-v2-order-orders.http.d.ts +72 -72
  5. package/build/cjs/src/pricing-plans-v2-order-orders.http.js +343 -343
  6. package/build/cjs/src/pricing-plans-v2-order-orders.http.js.map +1 -1
  7. package/build/cjs/src/pricing-plans-v2-order-orders.meta.d.ts +12 -12
  8. package/build/cjs/src/pricing-plans-v2-order-orders.meta.js +89 -89
  9. package/build/cjs/src/pricing-plans-v2-order-orders.meta.js.map +1 -1
  10. package/build/cjs/src/pricing-plans-v2-order-orders.public.d.ts +113 -113
  11. package/build/cjs/src/pricing-plans-v2-order-orders.public.js +94 -94
  12. package/build/cjs/src/pricing-plans-v2-order-orders.public.js.map +1 -1
  13. package/build/cjs/src/pricing-plans-v2-order-orders.types.d.ts +640 -382
  14. package/build/cjs/src/pricing-plans-v2-order-orders.types.js +9 -9
  15. package/build/cjs/src/pricing-plans-v2-order-orders.types.js.map +1 -1
  16. package/build/cjs/src/pricing-plans-v2-order-orders.universal.d.ts +1042 -729
  17. package/build/cjs/src/pricing-plans-v2-order-orders.universal.js +387 -379
  18. package/build/cjs/src/pricing-plans-v2-order-orders.universal.js.map +1 -1
  19. package/build/es/src/pricing-plans-v2-order-orders.context.d.ts +42 -42
  20. package/build/es/src/pricing-plans-v2-order-orders.context.js +41 -41
  21. package/build/es/src/pricing-plans-v2-order-orders.context.js.map +1 -1
  22. package/build/es/src/pricing-plans-v2-order-orders.http.d.ts +72 -72
  23. package/build/es/src/pricing-plans-v2-order-orders.http.js +335 -335
  24. package/build/es/src/pricing-plans-v2-order-orders.http.js.map +1 -1
  25. package/build/es/src/pricing-plans-v2-order-orders.meta.d.ts +12 -12
  26. package/build/es/src/pricing-plans-v2-order-orders.meta.js +73 -73
  27. package/build/es/src/pricing-plans-v2-order-orders.meta.js.map +1 -1
  28. package/build/es/src/pricing-plans-v2-order-orders.public.d.ts +113 -113
  29. package/build/es/src/pricing-plans-v2-order-orders.public.js +81 -81
  30. package/build/es/src/pricing-plans-v2-order-orders.public.js.map +1 -1
  31. package/build/es/src/pricing-plans-v2-order-orders.types.d.ts +640 -382
  32. package/build/es/src/pricing-plans-v2-order-orders.types.js +8 -8
  33. package/build/es/src/pricing-plans-v2-order-orders.types.js.map +1 -1
  34. package/build/es/src/pricing-plans-v2-order-orders.universal.d.ts +1042 -729
  35. package/build/es/src/pricing-plans-v2-order-orders.universal.js +371 -363
  36. package/build/es/src/pricing-plans-v2-order-orders.universal.js.map +1 -1
  37. package/build/internal/cjs/src/pricing-plans-v2-order-orders.context.d.ts +42 -42
  38. package/build/internal/cjs/src/pricing-plans-v2-order-orders.context.js +46 -46
  39. package/build/internal/cjs/src/pricing-plans-v2-order-orders.context.js.map +1 -1
  40. package/build/internal/cjs/src/pricing-plans-v2-order-orders.http.d.ts +72 -72
  41. package/build/internal/cjs/src/pricing-plans-v2-order-orders.http.js +343 -343
  42. package/build/internal/cjs/src/pricing-plans-v2-order-orders.http.js.map +1 -1
  43. package/build/internal/cjs/src/pricing-plans-v2-order-orders.meta.d.ts +12 -12
  44. package/build/internal/cjs/src/pricing-plans-v2-order-orders.meta.js +89 -89
  45. package/build/internal/cjs/src/pricing-plans-v2-order-orders.meta.js.map +1 -1
  46. package/build/internal/cjs/src/pricing-plans-v2-order-orders.public.d.ts +113 -113
  47. package/build/internal/cjs/src/pricing-plans-v2-order-orders.public.js +94 -94
  48. package/build/internal/cjs/src/pricing-plans-v2-order-orders.public.js.map +1 -1
  49. package/build/internal/cjs/src/pricing-plans-v2-order-orders.types.d.ts +640 -382
  50. package/build/internal/cjs/src/pricing-plans-v2-order-orders.types.js +9 -9
  51. package/build/internal/cjs/src/pricing-plans-v2-order-orders.types.js.map +1 -1
  52. package/build/internal/cjs/src/pricing-plans-v2-order-orders.universal.d.ts +1044 -731
  53. package/build/internal/cjs/src/pricing-plans-v2-order-orders.universal.js +387 -379
  54. package/build/internal/cjs/src/pricing-plans-v2-order-orders.universal.js.map +1 -1
  55. package/build/internal/es/src/pricing-plans-v2-order-orders.context.d.ts +42 -42
  56. package/build/internal/es/src/pricing-plans-v2-order-orders.context.js +41 -41
  57. package/build/internal/es/src/pricing-plans-v2-order-orders.context.js.map +1 -1
  58. package/build/internal/es/src/pricing-plans-v2-order-orders.http.d.ts +72 -72
  59. package/build/internal/es/src/pricing-plans-v2-order-orders.http.js +335 -335
  60. package/build/internal/es/src/pricing-plans-v2-order-orders.http.js.map +1 -1
  61. package/build/internal/es/src/pricing-plans-v2-order-orders.meta.d.ts +12 -12
  62. package/build/internal/es/src/pricing-plans-v2-order-orders.meta.js +73 -73
  63. package/build/internal/es/src/pricing-plans-v2-order-orders.meta.js.map +1 -1
  64. package/build/internal/es/src/pricing-plans-v2-order-orders.public.d.ts +113 -113
  65. package/build/internal/es/src/pricing-plans-v2-order-orders.public.js +81 -81
  66. package/build/internal/es/src/pricing-plans-v2-order-orders.public.js.map +1 -1
  67. package/build/internal/es/src/pricing-plans-v2-order-orders.types.d.ts +640 -382
  68. package/build/internal/es/src/pricing-plans-v2-order-orders.types.js +8 -8
  69. package/build/internal/es/src/pricing-plans-v2-order-orders.types.js.map +1 -1
  70. package/build/internal/es/src/pricing-plans-v2-order-orders.universal.d.ts +1044 -731
  71. package/build/internal/es/src/pricing-plans-v2-order-orders.universal.js +371 -363
  72. package/build/internal/es/src/pricing-plans-v2-order-orders.universal.js.map +1 -1
  73. package/package.json +4 -4
@@ -1,110 +1,11 @@
1
1
  "use strict";
2
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;
3
+ exports.getPricePreview = exports.getOfflineOrderPreview = exports.getOnlineOrderPreview = exports.createOfflineOrder = exports.createOnlineOrder = exports.requestCancellation = exports.memberListOrders = exports.memberGetOrder = exports.resumeOrder = exports.pauseOrder = exports.markAsPaid = exports.cancelOrder = exports.postponeEndDate = exports.managementListOrders = exports.managementGetOrder = void 0;
4
4
  const rest_modules_1 = require("@wix/sdk-runtime/rest-modules");
5
5
  const timestamp_1 = require("@wix/sdk-runtime/transformations/timestamp");
6
6
  const timestamp_2 = require("@wix/sdk-runtime/transformations/timestamp");
7
7
  const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
8
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
9
  function resolveComWixpressMembershipV2OrdersCheckoutServiceUrl(opts) {
109
10
  const domainToMappings = {
110
11
  'api._api_base_domain_': [
@@ -273,7 +174,348 @@ function resolveComWixpressMembershipV2OrdersMemberMemberOrdersServiceUrl(opts)
273
174
  };
274
175
  return (0, rest_modules_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
275
176
  }
276
- const PACKAGE_NAME = '@wix/auto_sdk_pricing-plans_orders';
177
+ function resolveComWixpressMembershipV2OrdersOrderManagementServiceUrl(opts) {
178
+ const domainToMappings = {
179
+ 'api._api_base_domain_': [
180
+ {
181
+ srcPath: '/order-management-service-proxy',
182
+ destPath: '',
183
+ },
184
+ ],
185
+ '*.dev.wix-code.com': [
186
+ {
187
+ srcPath: '/_api/paid-plans/v2/orders',
188
+ destPath: '/v2/orders',
189
+ },
190
+ ],
191
+ '*.pub.wix-code.com': [
192
+ {
193
+ srcPath: '/_api/paid-plans/v2/orders',
194
+ destPath: '/v2/orders',
195
+ },
196
+ ],
197
+ '*.wixapps.net': [
198
+ {
199
+ srcPath: '/_api/paid-plans/v2/orders',
200
+ destPath: '/v2/orders',
201
+ },
202
+ ],
203
+ _: [
204
+ {
205
+ srcPath: '/_api/paid-plans/v2/orders',
206
+ destPath: '/v2/orders',
207
+ },
208
+ ],
209
+ 'editor-flow.wixapps.net': [
210
+ {
211
+ srcPath: '/_api/paid-plans/v2/orders',
212
+ destPath: '/v2/orders',
213
+ },
214
+ ],
215
+ 'editor._base_domain_': [
216
+ {
217
+ srcPath: '/_api/paid-plans/v2/orders',
218
+ destPath: '/v2/orders',
219
+ },
220
+ ],
221
+ 'blocks._base_domain_': [
222
+ {
223
+ srcPath: '/_api/paid-plans/v2/orders',
224
+ destPath: '/v2/orders',
225
+ },
226
+ ],
227
+ 'create.editorx': [
228
+ {
229
+ srcPath: '/_api/paid-plans/v2/orders',
230
+ destPath: '/v2/orders',
231
+ },
232
+ ],
233
+ 'editor.wixapps.net': [
234
+ {
235
+ srcPath: '/_api/paid-plans/v2/orders',
236
+ destPath: '/v2/orders',
237
+ },
238
+ ],
239
+ 'forums._base_domain_': [
240
+ {
241
+ srcPath: '/_api/paid-plans/v2/orders',
242
+ destPath: '/v2/orders',
243
+ },
244
+ ],
245
+ 'forums.wixapps.net': [
246
+ {
247
+ srcPath: '/_api/paid-plans/v2/orders',
248
+ destPath: '/v2/orders',
249
+ },
250
+ ],
251
+ 'manage._base_domain_': [
252
+ {
253
+ srcPath: '/_api/pricing-plans/v2/orders',
254
+ destPath: '/v2/orders',
255
+ },
256
+ {
257
+ srcPath: '/_api/paid-plans/v2/orders',
258
+ destPath: '/v2/orders',
259
+ },
260
+ ],
261
+ 'www._base_domain_': [
262
+ {
263
+ srcPath: '/_api/paid-plans/v2/orders',
264
+ destPath: '/v2/orders',
265
+ },
266
+ ],
267
+ 'www.wixapis.com': [
268
+ {
269
+ srcPath: '/pricing-plans/v2/orders',
270
+ destPath: '/v2/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 by ID. */
278
+ function managementGetOrder(payload) {
279
+ function __managementGetOrder({ host }) {
280
+ const metadata = {
281
+ entityFqdn: 'wix.pricing_plans.v2.order',
282
+ method: 'GET',
283
+ methodFqn: 'com.wixpress.membership.v2.orders.OrderManagementService.GetOrder',
284
+ packageName: PACKAGE_NAME,
285
+ url: resolveComWixpressMembershipV2OrdersOrderManagementServiceUrl({
286
+ protoPath: '/v2/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 __managementGetOrder;
314
+ }
315
+ exports.managementGetOrder = managementGetOrder;
316
+ /**
317
+ * Retrieves a list of up to 50 pricing plan orders and details, given the specified sorting and filtering.
318
+ *
319
+ * By default, this endpoint will retrieve all orders and return them sorted by `createdDate` in `DESC`, descending order.
320
+ * `sort.fieldName` supports `endDate` and `createdDate` fields and defaults to `ASC`, ascending order.
321
+ */
322
+ function managementListOrders(payload) {
323
+ function __managementListOrders({ host }) {
324
+ const metadata = {
325
+ entityFqdn: 'wix.pricing_plans.v2.order',
326
+ method: 'GET',
327
+ methodFqn: 'com.wixpress.membership.v2.orders.OrderManagementService.ListOrders',
328
+ packageName: PACKAGE_NAME,
329
+ url: resolveComWixpressMembershipV2OrdersOrderManagementServiceUrl({
330
+ protoPath: '/v2/orders',
331
+ data: payload,
332
+ host,
333
+ }),
334
+ params: (0, rest_modules_1.toURLSearchParams)(payload, true),
335
+ transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
336
+ {
337
+ transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
338
+ paths: [
339
+ { path: 'orders.startDate' },
340
+ { path: 'orders.endDate' },
341
+ { path: 'orders.earliestEndDate' },
342
+ { path: 'orders.createdDate' },
343
+ { path: 'orders.updatedDate' },
344
+ { path: 'orders.cancellation.requestedDate' },
345
+ { path: 'orders.pausePeriods.pauseDate' },
346
+ { path: 'orders.pausePeriods.resumeDate' },
347
+ { path: 'orders.currentCycle.startedDate' },
348
+ { path: 'orders.currentCycle.endedDate' },
349
+ { path: 'orders.cycles.startedDate' },
350
+ { path: 'orders.cycles.endedDate' },
351
+ ],
352
+ },
353
+ ]),
354
+ };
355
+ return metadata;
356
+ }
357
+ return __managementListOrders;
358
+ }
359
+ exports.managementListOrders = managementListOrders;
360
+ /**
361
+ * 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.
362
+ *
363
+ * New `endDate` must be later than the order's current `endDate`. Can't postpone orders that are unlimited.
364
+ * Can't postpone an order with `status`: `PAUSED`.
365
+ */
366
+ function postponeEndDate(payload) {
367
+ function __postponeEndDate({ host }) {
368
+ const serializedData = (0, transform_paths_1.transformPaths)(payload, [
369
+ {
370
+ transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
371
+ paths: [{ path: 'endDate' }],
372
+ },
373
+ ]);
374
+ const metadata = {
375
+ entityFqdn: 'wix.pricing_plans.v2.order',
376
+ method: 'PATCH',
377
+ methodFqn: 'com.wixpress.membership.v2.orders.OrderManagementService.PostponeEndDate',
378
+ packageName: PACKAGE_NAME,
379
+ url: resolveComWixpressMembershipV2OrdersOrderManagementServiceUrl({
380
+ protoPath: '/v2/orders/{id}',
381
+ data: serializedData,
382
+ host,
383
+ }),
384
+ data: serializedData,
385
+ };
386
+ return metadata;
387
+ }
388
+ return __postponeEndDate;
389
+ }
390
+ exports.postponeEndDate = postponeEndDate;
391
+ /**
392
+ * Cancels an existing order.
393
+ *
394
+ * For orders with recurring payments, a cancellation can be set to occur either `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`.
395
+ * For orders with one-time payments, a cancellation can only be set for `IMMEDIATELY`.
396
+ *
397
+ * #### Canceling during the free trial period.
398
+ *
399
+ * When a buyer cancels their order during the free trial period, the buyer's subscription expires at the end
400
+ * of the free trial period and they will not be billed. The buyer may continue using the benefits until the end
401
+ * of the free trial period.
402
+ *
403
+ * When a Wix user cancels an ordered plan during the free trial period, they choose whether to apply the cancellation
404
+ * `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`. Canceling `IMMEDIATELY` will end the subscription for the buyer
405
+ * immediately, even during the free trial period and the buyer won't be billed. Canceling at the
406
+ * `NEXT_PAYMENT_DATE` allows the buyer to continue using the benefits of the subscription until the end of the free trial period.
407
+ * Then, the subscription ends and the buyer is not billed.
408
+ */
409
+ function cancelOrder(payload) {
410
+ function __cancelOrder({ host }) {
411
+ const metadata = {
412
+ entityFqdn: 'wix.pricing_plans.v2.order',
413
+ method: 'POST',
414
+ methodFqn: 'com.wixpress.membership.v2.orders.OrderManagementService.CancelOrder',
415
+ packageName: PACKAGE_NAME,
416
+ url: resolveComWixpressMembershipV2OrdersOrderManagementServiceUrl({
417
+ protoPath: '/v2/orders/{id}/cancel',
418
+ data: payload,
419
+ host,
420
+ }),
421
+ data: payload,
422
+ };
423
+ return metadata;
424
+ }
425
+ return __cancelOrder;
426
+ }
427
+ exports.cancelOrder = cancelOrder;
428
+ /**
429
+ * Marks an offline order as paid.
430
+ * > __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.
431
+ *
432
+ * Marking an offline order as paid causes the following changes:
433
+ * - The order's `lastPaymentStatus` changes to `"PAID"`.
434
+ * - The order's status changes to either `"PENDING"` or `"ACTIVE"`, depending on the order's `startDate`.
435
+ *
436
+ * An error occurs if you attempt to:
437
+ * - Mark an already-paid, offline order as paid. You cannot mark an offline order as paid twice.
438
+ * - Mark an online order as paid. The Mark as Paid method is supported for offline orders only.
439
+ */
440
+ function markAsPaid(payload) {
441
+ function __markAsPaid({ host }) {
442
+ const metadata = {
443
+ entityFqdn: 'wix.pricing_plans.v2.order',
444
+ method: 'POST',
445
+ methodFqn: 'com.wixpress.membership.v2.orders.OrderManagementService.MarkAsPaid',
446
+ packageName: PACKAGE_NAME,
447
+ url: resolveComWixpressMembershipV2OrdersOrderManagementServiceUrl({
448
+ protoPath: '/v2/orders/{id}/mark-as-paid',
449
+ data: payload,
450
+ host,
451
+ }),
452
+ data: payload,
453
+ };
454
+ return metadata;
455
+ }
456
+ return __markAsPaid;
457
+ }
458
+ exports.markAsPaid = markAsPaid;
459
+ /**
460
+ * Pauses an order. Calling this method changes the order status to `"PAUSED"` and updates the `pausePeriods` array.
461
+ *
462
+ * Only orders with `status`: `ACTIVE` can be paused.
463
+ * For orders with recurring payments, it also pauses the payment schedule. Buyers are not charged when an order is paused.
464
+ * Pausing an order affects the end date of the order by adding the time the order is paused to the `endDate`.
465
+ * The `endDate` and the `earliestEndDate` for the order are adjusted to include the pause period when the order is resumed.
466
+ *
467
+ * To resume a paused order, call Resume Order.
468
+ */
469
+ function pauseOrder(payload) {
470
+ function __pauseOrder({ host }) {
471
+ const metadata = {
472
+ entityFqdn: 'wix.pricing_plans.v2.order',
473
+ method: 'POST',
474
+ methodFqn: 'com.wixpress.membership.v2.orders.OrderManagementService.PauseOrder',
475
+ packageName: PACKAGE_NAME,
476
+ url: resolveComWixpressMembershipV2OrdersOrderManagementServiceUrl({
477
+ protoPath: '/v2/orders/{id}/pause',
478
+ data: payload,
479
+ host,
480
+ }),
481
+ data: payload,
482
+ };
483
+ return metadata;
484
+ }
485
+ return __pauseOrder;
486
+ }
487
+ exports.pauseOrder = pauseOrder;
488
+ /**
489
+ * Resumes a paused order. For orders with recurring payments, it also restarts the payment schedule.
490
+ *
491
+ * Resuming an order causes the following changes:
492
+ * - The order status changes to `"ACTIVE"`.
493
+ * - The `pausePeriods` array is updated.
494
+ * - The `endDate` for the order is adjusted to include the pause period.
495
+ * - For orders with recurring payments, the payment schedule is restarted.
496
+ * - The `earliestEndDate` is adjusted to include the pause period. (This property is reserved for future use).
497
+ *
498
+ * To pause an order, call Pause Order.
499
+ */
500
+ function resumeOrder(payload) {
501
+ function __resumeOrder({ host }) {
502
+ const metadata = {
503
+ entityFqdn: 'wix.pricing_plans.v2.order',
504
+ method: 'POST',
505
+ methodFqn: 'com.wixpress.membership.v2.orders.OrderManagementService.ResumeOrder',
506
+ packageName: PACKAGE_NAME,
507
+ url: resolveComWixpressMembershipV2OrdersOrderManagementServiceUrl({
508
+ protoPath: '/v2/orders/{id}/resume',
509
+ data: payload,
510
+ host,
511
+ }),
512
+ data: payload,
513
+ };
514
+ return metadata;
515
+ }
516
+ return __resumeOrder;
517
+ }
518
+ exports.resumeOrder = resumeOrder;
277
519
  /** Retrieves an order for the currently logged-in member by ID. */
278
520
  function memberGetOrder(payload) {
279
521
  function __memberGetOrder({ host }) {
@@ -632,246 +874,4 @@ function getPricePreview(payload) {
632
874
  return __getPricePreview;
633
875
  }
634
876
  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
877
  //# sourceMappingURL=pricing-plans-v2-order-orders.http.js.map