@wix/auto_sdk_subscription_subscriptions 1.0.0 → 1.0.1
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/src/billing-v1-subscription-subscriptions.context.d.ts +5 -5
- package/build/cjs/src/billing-v1-subscription-subscriptions.context.js +13 -11
- package/build/cjs/src/billing-v1-subscription-subscriptions.context.js.map +1 -1
- package/build/cjs/src/billing-v1-subscription-subscriptions.http.d.ts +19 -3
- package/build/cjs/src/billing-v1-subscription-subscriptions.http.js +1914 -1851
- package/build/cjs/src/billing-v1-subscription-subscriptions.http.js.map +1 -1
- package/build/cjs/src/billing-v1-subscription-subscriptions.meta.d.ts +8 -5
- package/build/cjs/src/billing-v1-subscription-subscriptions.meta.js +44 -25
- package/build/cjs/src/billing-v1-subscription-subscriptions.meta.js.map +1 -1
- package/build/cjs/src/billing-v1-subscription-subscriptions.public.d.ts +12 -12
- package/build/cjs/src/billing-v1-subscription-subscriptions.public.js +18 -11
- package/build/cjs/src/billing-v1-subscription-subscriptions.public.js.map +1 -1
- package/build/cjs/src/billing-v1-subscription-subscriptions.types.d.ts +2034 -1465
- package/build/cjs/src/billing-v1-subscription-subscriptions.types.js +59 -59
- package/build/cjs/src/billing-v1-subscription-subscriptions.types.js.map +1 -1
- package/build/cjs/src/billing-v1-subscription-subscriptions.universal.d.ts +2114 -1465
- package/build/cjs/src/billing-v1-subscription-subscriptions.universal.js +401 -339
- package/build/cjs/src/billing-v1-subscription-subscriptions.universal.js.map +1 -1
- package/build/es/src/billing-v1-subscription-subscriptions.context.d.ts +5 -5
- package/build/es/src/billing-v1-subscription-subscriptions.context.js +6 -4
- package/build/es/src/billing-v1-subscription-subscriptions.context.js.map +1 -1
- package/build/es/src/billing-v1-subscription-subscriptions.http.d.ts +19 -3
- package/build/es/src/billing-v1-subscription-subscriptions.http.js +1854 -1792
- package/build/es/src/billing-v1-subscription-subscriptions.http.js.map +1 -1
- package/build/es/src/billing-v1-subscription-subscriptions.meta.d.ts +8 -5
- package/build/es/src/billing-v1-subscription-subscriptions.meta.js +40 -22
- package/build/es/src/billing-v1-subscription-subscriptions.meta.js.map +1 -1
- package/build/es/src/billing-v1-subscription-subscriptions.public.d.ts +12 -12
- package/build/es/src/billing-v1-subscription-subscriptions.public.js +14 -8
- package/build/es/src/billing-v1-subscription-subscriptions.public.js.map +1 -1
- package/build/es/src/billing-v1-subscription-subscriptions.types.d.ts +2034 -1465
- package/build/es/src/billing-v1-subscription-subscriptions.types.js +58 -58
- package/build/es/src/billing-v1-subscription-subscriptions.types.js.map +1 -1
- package/build/es/src/billing-v1-subscription-subscriptions.universal.d.ts +2114 -1465
- package/build/es/src/billing-v1-subscription-subscriptions.universal.js +394 -333
- package/build/es/src/billing-v1-subscription-subscriptions.universal.js.map +1 -1
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.context.d.ts +7 -5
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.context.js +13 -11
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.context.js.map +1 -1
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.http.d.ts +19 -3
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.http.js +1914 -1851
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.http.js.map +1 -1
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.meta.d.ts +8 -5
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.meta.js +44 -25
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.meta.js.map +1 -1
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.public.d.ts +35 -13
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.public.js +18 -11
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.public.js.map +1 -1
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.types.d.ts +2034 -1465
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.types.js +59 -59
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.types.js.map +1 -1
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.universal.d.ts +2253 -1578
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.universal.js +401 -339
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.universal.js.map +1 -1
- package/build/internal/es/src/billing-v1-subscription-subscriptions.context.d.ts +7 -5
- package/build/internal/es/src/billing-v1-subscription-subscriptions.context.js +6 -4
- package/build/internal/es/src/billing-v1-subscription-subscriptions.context.js.map +1 -1
- package/build/internal/es/src/billing-v1-subscription-subscriptions.http.d.ts +19 -3
- package/build/internal/es/src/billing-v1-subscription-subscriptions.http.js +1854 -1792
- package/build/internal/es/src/billing-v1-subscription-subscriptions.http.js.map +1 -1
- package/build/internal/es/src/billing-v1-subscription-subscriptions.meta.d.ts +8 -5
- package/build/internal/es/src/billing-v1-subscription-subscriptions.meta.js +40 -22
- package/build/internal/es/src/billing-v1-subscription-subscriptions.meta.js.map +1 -1
- package/build/internal/es/src/billing-v1-subscription-subscriptions.public.d.ts +35 -13
- package/build/internal/es/src/billing-v1-subscription-subscriptions.public.js +14 -8
- package/build/internal/es/src/billing-v1-subscription-subscriptions.public.js.map +1 -1
- package/build/internal/es/src/billing-v1-subscription-subscriptions.types.d.ts +2034 -1465
- package/build/internal/es/src/billing-v1-subscription-subscriptions.types.js +58 -58
- package/build/internal/es/src/billing-v1-subscription-subscriptions.types.js.map +1 -1
- package/build/internal/es/src/billing-v1-subscription-subscriptions.universal.d.ts +2253 -1578
- package/build/internal/es/src/billing-v1-subscription-subscriptions.universal.js +394 -333
- package/build/internal/es/src/billing-v1-subscription-subscriptions.universal.js.map +1 -1
- package/package.json +2 -2
|
@@ -23,8 +23,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.updateSubscriptionBillingDate = exports.updateSubscriptionPaymentMethod = exports.getSubscription = exports.customerInitiatePaymentMethodSetup = exports.customerListUpcomingCharges = exports.customerAllowedActions = exports.customerUpdateSubscriptionPaymentMethod = exports.customerQuerySubscriptions = exports.customerExtendSubscription = exports.customerTurnOffSubscriptionAutoRenewal = exports.customerTurnOnSubscriptionAutoRenewal = exports.customerCancelSubscription = exports.customerGetSubscription = exports.
|
|
27
|
-
exports.
|
|
26
|
+
exports.updateSubscriptionBillingDate = exports.updateSubscriptionPaymentMethod = exports.getSubscription = exports.payCycle = exports.customerInitiatePaymentMethodSetup = exports.customerListUpcomingCharges = exports.customerAllowedActions = exports.customerUpdateSubscriptionPaymentMethod = exports.customerQuerySubscriptions = exports.customerExtendSubscription = exports.customerTurnOffSubscriptionAutoRenewal = exports.customerTurnOnSubscriptionAutoRenewal = exports.customerCancelSubscription = exports.customerGetSubscription = exports.PaymentSettlementMethod = exports.HistoryViewMode = exports.Status = exports.CancellationInitiator = exports.SubscriptionFrequency = exports.PaymentStatusEnumPaymentStatus = exports.V1SubscriptionStatusEnumSubscriptionStatus = exports.SubscriptionType = exports.IdentityType = exports.PaymentAttemptStatus = exports.CreationMode = exports.CollectionMethod = exports.InvoiceStatus = exports.RequestedFields = exports.UpdateAction = exports.ActionInitiator = exports.RevivePolicy = exports.PaymentTestMode = exports.WebhookIdentityType = exports.OrderMethod = exports.PaymentMode = exports.ExtendPolicyType = exports.ActionType = exports.SubscriptionStatusGroup = exports.SortOrder = exports.ItemCategory = exports.HistoryActionInitiator = exports.ResumeAt = exports.PauseAt = exports.PausePolicy = exports.PaymentStatus = exports.TaxableAddressType = exports.AdditionalFeeTrigger = exports.DurationUnit = exports.CollectionMethodEnumCollectionMethod = exports.SubscriptionStatusEnumSubscriptionStatus = void 0;
|
|
27
|
+
exports.listSubscriptionHistory = exports.initiatePaymentMethodSetup = exports.previewSubscriptionsCharges = exports.previewSubscriptionCharges = exports.listUpcomingCharges = exports.allowedActions = exports.extendSubscription = exports.getSubscriptionsStats = exports.markBillingCycleAsPaid = exports.markInvoiceAsPaid = exports.markLatestInvoiceAsPaid = exports.turnOffSubscriptionAutoRenewal = exports.turnOnSubscriptionAutoRenewal = exports.countSubscriptions = exports.searchSubscriptions = exports.querySubscriptions = exports.resumeSubscription = exports.pauseSubscription = exports.cancelSubscription = void 0;
|
|
28
28
|
const transform_error_1 = require("@wix/sdk-runtime/transform-error");
|
|
29
29
|
const rename_all_nested_keys_1 = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
30
30
|
const ambassadorWixBillingV1Subscription = __importStar(require("./billing-v1-subscription-subscriptions.http.js"));
|
|
@@ -142,52 +142,6 @@ var ItemCategory;
|
|
|
142
142
|
ItemCategory["PHYSICAL"] = "PHYSICAL";
|
|
143
143
|
ItemCategory["DIGITAL"] = "DIGITAL";
|
|
144
144
|
})(ItemCategory || (exports.ItemCategory = ItemCategory = {}));
|
|
145
|
-
var HistoryViewMode;
|
|
146
|
-
(function (HistoryViewMode) {
|
|
147
|
-
HistoryViewMode["UNKNOWN"] = "UNKNOWN";
|
|
148
|
-
/** Comprehensive view including all history events. */
|
|
149
|
-
HistoryViewMode["BACKOFFICE"] = "BACKOFFICE";
|
|
150
|
-
/** User-centric view of the history. */
|
|
151
|
-
HistoryViewMode["USER"] = "USER";
|
|
152
|
-
})(HistoryViewMode || (exports.HistoryViewMode = HistoryViewMode = {}));
|
|
153
|
-
var UpdateAction;
|
|
154
|
-
(function (UpdateAction) {
|
|
155
|
-
UpdateAction["NONE"] = "NONE";
|
|
156
|
-
/** Update subscription immediately, please note proration for updates changing price are not yet supported */
|
|
157
|
-
UpdateAction["IMMEDIATELY"] = "IMMEDIATELY";
|
|
158
|
-
/** Request updates that will take affect only at the start of the next billing cycle. */
|
|
159
|
-
UpdateAction["NEXT_BILLING_CYCLE"] = "NEXT_BILLING_CYCLE";
|
|
160
|
-
/** Reset all pending updates */
|
|
161
|
-
UpdateAction["RESET_PENDING_UPDATES"] = "RESET_PENDING_UPDATES";
|
|
162
|
-
/** Request updates that will take affect only at a specific date. */
|
|
163
|
-
UpdateAction["SPECIFIC_DATE"] = "SPECIFIC_DATE";
|
|
164
|
-
})(UpdateAction || (exports.UpdateAction = UpdateAction = {}));
|
|
165
|
-
var PaymentSettlementMethod;
|
|
166
|
-
(function (PaymentSettlementMethod) {
|
|
167
|
-
PaymentSettlementMethod["UNKNOWN"] = "UNKNOWN";
|
|
168
|
-
/** System-defined payment settlement. */
|
|
169
|
-
PaymentSettlementMethod["SYSTEM"] = "SYSTEM";
|
|
170
|
-
/** Manually mark the payment as paid. */
|
|
171
|
-
PaymentSettlementMethod["MARK_AS_PAID"] = "MARK_AS_PAID";
|
|
172
|
-
/** Require the customer to pay immediately, by insert a new payment method. */
|
|
173
|
-
PaymentSettlementMethod["CUSTOMER_PAY_NOW"] = "CUSTOMER_PAY_NOW";
|
|
174
|
-
})(PaymentSettlementMethod || (exports.PaymentSettlementMethod = PaymentSettlementMethod = {}));
|
|
175
|
-
var PaymentMode;
|
|
176
|
-
(function (PaymentMode) {
|
|
177
|
-
PaymentMode["NONE"] = "NONE";
|
|
178
|
-
/** The latest invoice of the subscription will be charged. */
|
|
179
|
-
PaymentMode["CHARGE"] = "CHARGE";
|
|
180
|
-
/** An authorization invoice with zero amount will be created. */
|
|
181
|
-
PaymentMode["AUTHORIZATION"] = "AUTHORIZATION";
|
|
182
|
-
})(PaymentMode || (exports.PaymentMode = PaymentMode = {}));
|
|
183
|
-
var WebhookIdentityType;
|
|
184
|
-
(function (WebhookIdentityType) {
|
|
185
|
-
WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
|
|
186
|
-
WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
187
|
-
WebhookIdentityType["MEMBER"] = "MEMBER";
|
|
188
|
-
WebhookIdentityType["WIX_USER"] = "WIX_USER";
|
|
189
|
-
WebhookIdentityType["APP"] = "APP";
|
|
190
|
-
})(WebhookIdentityType || (exports.WebhookIdentityType = WebhookIdentityType = {}));
|
|
191
145
|
var SortOrder;
|
|
192
146
|
(function (SortOrder) {
|
|
193
147
|
SortOrder["ASC"] = "ASC";
|
|
@@ -221,12 +175,40 @@ var ExtendPolicyType;
|
|
|
221
175
|
ExtendPolicyType["PERIOD"] = "PERIOD";
|
|
222
176
|
ExtendPolicyType["BILLING_CYCLE"] = "BILLING_CYCLE";
|
|
223
177
|
})(ExtendPolicyType || (exports.ExtendPolicyType = ExtendPolicyType = {}));
|
|
178
|
+
var PaymentMode;
|
|
179
|
+
(function (PaymentMode) {
|
|
180
|
+
PaymentMode["NONE"] = "NONE";
|
|
181
|
+
/** The latest invoice of the subscription will be charged. */
|
|
182
|
+
PaymentMode["CHARGE"] = "CHARGE";
|
|
183
|
+
/** An authorization invoice with zero amount will be created. */
|
|
184
|
+
PaymentMode["AUTHORIZATION"] = "AUTHORIZATION";
|
|
185
|
+
})(PaymentMode || (exports.PaymentMode = PaymentMode = {}));
|
|
224
186
|
var OrderMethod;
|
|
225
187
|
(function (OrderMethod) {
|
|
226
188
|
OrderMethod["UNKNOWN"] = "UNKNOWN";
|
|
227
189
|
OrderMethod["MOTO"] = "MOTO";
|
|
228
190
|
OrderMethod["NOT_MOTO"] = "NOT_MOTO";
|
|
229
191
|
})(OrderMethod || (exports.OrderMethod = OrderMethod = {}));
|
|
192
|
+
var WebhookIdentityType;
|
|
193
|
+
(function (WebhookIdentityType) {
|
|
194
|
+
WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
|
|
195
|
+
WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
196
|
+
WebhookIdentityType["MEMBER"] = "MEMBER";
|
|
197
|
+
WebhookIdentityType["WIX_USER"] = "WIX_USER";
|
|
198
|
+
WebhookIdentityType["APP"] = "APP";
|
|
199
|
+
})(WebhookIdentityType || (exports.WebhookIdentityType = WebhookIdentityType = {}));
|
|
200
|
+
var PaymentTestMode;
|
|
201
|
+
(function (PaymentTestMode) {
|
|
202
|
+
PaymentTestMode["REGULAR"] = "REGULAR";
|
|
203
|
+
PaymentTestMode["FAIL_TECHNICAL"] = "FAIL_TECHNICAL";
|
|
204
|
+
PaymentTestMode["FAIL_DECLINE"] = "FAIL_DECLINE";
|
|
205
|
+
PaymentTestMode["FAIL_RETRYABLE_DECLINE"] = "FAIL_RETRYABLE_DECLINE";
|
|
206
|
+
})(PaymentTestMode || (exports.PaymentTestMode = PaymentTestMode = {}));
|
|
207
|
+
var RevivePolicy;
|
|
208
|
+
(function (RevivePolicy) {
|
|
209
|
+
RevivePolicy["SIMPLE"] = "SIMPLE";
|
|
210
|
+
RevivePolicy["RESUME"] = "RESUME";
|
|
211
|
+
})(RevivePolicy || (exports.RevivePolicy = RevivePolicy = {}));
|
|
230
212
|
var ActionInitiator;
|
|
231
213
|
(function (ActionInitiator) {
|
|
232
214
|
ActionInitiator["UNDEFINED"] = "UNDEFINED";
|
|
@@ -234,6 +216,18 @@ var ActionInitiator;
|
|
|
234
216
|
ActionInitiator["CUSTOMER"] = "CUSTOMER";
|
|
235
217
|
ActionInitiator["SYSTEM"] = "SYSTEM";
|
|
236
218
|
})(ActionInitiator || (exports.ActionInitiator = ActionInitiator = {}));
|
|
219
|
+
var UpdateAction;
|
|
220
|
+
(function (UpdateAction) {
|
|
221
|
+
UpdateAction["NONE"] = "NONE";
|
|
222
|
+
/** Update subscription immediately, please note proration for updates changing price are not yet supported */
|
|
223
|
+
UpdateAction["IMMEDIATELY"] = "IMMEDIATELY";
|
|
224
|
+
/** Request updates that will take affect only at the start of the next billing cycle. */
|
|
225
|
+
UpdateAction["NEXT_BILLING_CYCLE"] = "NEXT_BILLING_CYCLE";
|
|
226
|
+
/** Reset all pending updates */
|
|
227
|
+
UpdateAction["RESET_PENDING_UPDATES"] = "RESET_PENDING_UPDATES";
|
|
228
|
+
/** Request updates that will take affect only at a specific date. */
|
|
229
|
+
UpdateAction["SPECIFIC_DATE"] = "SPECIFIC_DATE";
|
|
230
|
+
})(UpdateAction || (exports.UpdateAction = UpdateAction = {}));
|
|
237
231
|
var RequestedFields;
|
|
238
232
|
(function (RequestedFields) {
|
|
239
233
|
RequestedFields["UNKNOWN_REQUESTED_FIELD"] = "UNKNOWN_REQUESTED_FIELD";
|
|
@@ -352,261 +346,24 @@ var Status;
|
|
|
352
346
|
Status["ACTIVE"] = "ACTIVE";
|
|
353
347
|
Status["ENDED"] = "ENDED";
|
|
354
348
|
})(Status || (exports.Status = Status = {}));
|
|
355
|
-
var
|
|
356
|
-
(function (
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
* @applicableIdentity APP
|
|
374
|
-
* @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionHistoryService.ListSubscriptionHistory
|
|
375
|
-
*/
|
|
376
|
-
async function listSubscriptionHistory(subscriptionId, options) {
|
|
377
|
-
// @ts-ignore
|
|
378
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
379
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
380
|
-
subscriptionId: subscriptionId,
|
|
381
|
-
mode: options?.mode,
|
|
382
|
-
cursor: options?.cursor,
|
|
383
|
-
});
|
|
384
|
-
const reqOpts = ambassadorWixBillingV1Subscription.listSubscriptionHistory(payload);
|
|
385
|
-
sideEffects?.onSiteCall?.();
|
|
386
|
-
try {
|
|
387
|
-
const result = await httpClient.request(reqOpts);
|
|
388
|
-
sideEffects?.onSuccess?.(result);
|
|
389
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
390
|
-
{
|
|
391
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
392
|
-
paths: [
|
|
393
|
-
{
|
|
394
|
-
path: 'historyEntries.event.created.subscription.billingSettings.billingAddress.address',
|
|
395
|
-
},
|
|
396
|
-
{
|
|
397
|
-
path: 'historyEntries.event.created.subscription.shippingAddress.address',
|
|
398
|
-
},
|
|
399
|
-
{
|
|
400
|
-
path: 'historyEntries.event.updated.current.billingSettings.billingAddress.address',
|
|
401
|
-
},
|
|
402
|
-
{
|
|
403
|
-
path: 'historyEntries.event.updated.current.shippingAddress.address',
|
|
404
|
-
},
|
|
405
|
-
{
|
|
406
|
-
path: 'historyEntries.event.updated.previous.billingSettings.billingAddress.address',
|
|
407
|
-
},
|
|
408
|
-
{
|
|
409
|
-
path: 'historyEntries.event.updated.previous.shippingAddress.address',
|
|
410
|
-
},
|
|
411
|
-
{
|
|
412
|
-
path: 'historyEntries.event.activated.subscription.billingSettings.billingAddress.address',
|
|
413
|
-
},
|
|
414
|
-
{
|
|
415
|
-
path: 'historyEntries.event.activated.subscription.shippingAddress.address',
|
|
416
|
-
},
|
|
417
|
-
{
|
|
418
|
-
path: 'historyEntries.event.ended.subscription.billingSettings.billingAddress.address',
|
|
419
|
-
},
|
|
420
|
-
{
|
|
421
|
-
path: 'historyEntries.event.ended.subscription.shippingAddress.address',
|
|
422
|
-
},
|
|
423
|
-
{
|
|
424
|
-
path: 'historyEntries.event.canceled.subscription.billingSettings.billingAddress.address',
|
|
425
|
-
},
|
|
426
|
-
{
|
|
427
|
-
path: 'historyEntries.event.canceled.subscription.shippingAddress.address',
|
|
428
|
-
},
|
|
429
|
-
{
|
|
430
|
-
path: 'historyEntries.event.paused.subscription.billingSettings.billingAddress.address',
|
|
431
|
-
},
|
|
432
|
-
{
|
|
433
|
-
path: 'historyEntries.event.paused.subscription.shippingAddress.address',
|
|
434
|
-
},
|
|
435
|
-
{
|
|
436
|
-
path: 'historyEntries.event.resumed.subscription.billingSettings.billingAddress.address',
|
|
437
|
-
},
|
|
438
|
-
{
|
|
439
|
-
path: 'historyEntries.event.resumed.subscription.shippingAddress.address',
|
|
440
|
-
},
|
|
441
|
-
{
|
|
442
|
-
path: 'historyEntries.event.pauseRequested.subscription.billingSettings.billingAddress.address',
|
|
443
|
-
},
|
|
444
|
-
{
|
|
445
|
-
path: 'historyEntries.event.pauseRequested.subscription.shippingAddress.address',
|
|
446
|
-
},
|
|
447
|
-
{
|
|
448
|
-
path: 'historyEntries.event.resumeRequested.subscription.billingSettings.billingAddress.address',
|
|
449
|
-
},
|
|
450
|
-
{
|
|
451
|
-
path: 'historyEntries.event.resumeRequested.subscription.shippingAddress.address',
|
|
452
|
-
},
|
|
453
|
-
{
|
|
454
|
-
path: 'historyEntries.event.scheduledPauseCanceled.subscription.billingSettings.billingAddress.address',
|
|
455
|
-
},
|
|
456
|
-
{
|
|
457
|
-
path: 'historyEntries.event.scheduledPauseCanceled.subscription.shippingAddress.address',
|
|
458
|
-
},
|
|
459
|
-
{
|
|
460
|
-
path: 'historyEntries.event.scheduledResumeCanceled.subscription.billingSettings.billingAddress.address',
|
|
461
|
-
},
|
|
462
|
-
{
|
|
463
|
-
path: 'historyEntries.event.scheduledResumeCanceled.subscription.shippingAddress.address',
|
|
464
|
-
},
|
|
465
|
-
{
|
|
466
|
-
path: 'historyEntries.event.billingCycleStarted.subscription.billingSettings.billingAddress.address',
|
|
467
|
-
},
|
|
468
|
-
{
|
|
469
|
-
path: 'historyEntries.event.billingCycleStarted.subscription.shippingAddress.address',
|
|
470
|
-
},
|
|
471
|
-
{
|
|
472
|
-
path: 'historyEntries.event.autoRenewalTurnedOn.subscription.billingSettings.billingAddress.address',
|
|
473
|
-
},
|
|
474
|
-
{
|
|
475
|
-
path: 'historyEntries.event.autoRenewalTurnedOn.subscription.shippingAddress.address',
|
|
476
|
-
},
|
|
477
|
-
{
|
|
478
|
-
path: 'historyEntries.event.autoRenewalTurnedOff.subscription.billingSettings.billingAddress.address',
|
|
479
|
-
},
|
|
480
|
-
{
|
|
481
|
-
path: 'historyEntries.event.autoRenewalTurnedOff.subscription.shippingAddress.address',
|
|
482
|
-
},
|
|
483
|
-
{
|
|
484
|
-
path: 'historyEntries.event.cycleReadyToPay.subscription.billingSettings.billingAddress.address',
|
|
485
|
-
},
|
|
486
|
-
{
|
|
487
|
-
path: 'historyEntries.event.cycleReadyToPay.subscription.shippingAddress.address',
|
|
488
|
-
},
|
|
489
|
-
{
|
|
490
|
-
path: 'historyEntries.event.extended.subscription.billingSettings.billingAddress.address',
|
|
491
|
-
},
|
|
492
|
-
{
|
|
493
|
-
path: 'historyEntries.event.extended.subscription.shippingAddress.address',
|
|
494
|
-
},
|
|
495
|
-
{
|
|
496
|
-
path: 'historyEntries.event.initialPurchaseCompleted.subscription.billingSettings.billingAddress.address',
|
|
497
|
-
},
|
|
498
|
-
{
|
|
499
|
-
path: 'historyEntries.event.initialPurchaseCompleted.subscription.shippingAddress.address',
|
|
500
|
-
},
|
|
501
|
-
{
|
|
502
|
-
path: 'historyEntries.event.latestInvoiceMarkedAsPaid.subscription.billingSettings.billingAddress.address',
|
|
503
|
-
},
|
|
504
|
-
{
|
|
505
|
-
path: 'historyEntries.event.latestInvoiceMarkedAsPaid.subscription.shippingAddress.address',
|
|
506
|
-
},
|
|
507
|
-
{
|
|
508
|
-
path: 'historyEntries.event.revived.subscription.billingSettings.billingAddress.address',
|
|
509
|
-
},
|
|
510
|
-
{
|
|
511
|
-
path: 'historyEntries.event.revived.subscription.shippingAddress.address',
|
|
512
|
-
},
|
|
513
|
-
{
|
|
514
|
-
path: 'historyEntries.event.billingDateUpdated.subscription.billingSettings.billingAddress.address',
|
|
515
|
-
},
|
|
516
|
-
{
|
|
517
|
-
path: 'historyEntries.event.billingDateUpdated.subscription.shippingAddress.address',
|
|
518
|
-
},
|
|
519
|
-
{
|
|
520
|
-
path: 'historyEntries.event.futureUpdatesRequested.subscription.billingSettings.billingAddress.address',
|
|
521
|
-
},
|
|
522
|
-
{
|
|
523
|
-
path: 'historyEntries.event.futureUpdatesRequested.subscription.shippingAddress.address',
|
|
524
|
-
},
|
|
525
|
-
{
|
|
526
|
-
path: 'historyEntries.event.updatesApplied.subscription.billingSettings.billingAddress.address',
|
|
527
|
-
},
|
|
528
|
-
{
|
|
529
|
-
path: 'historyEntries.event.updatesApplied.subscription.shippingAddress.address',
|
|
530
|
-
},
|
|
531
|
-
{
|
|
532
|
-
path: 'historyEntries.event.resetPendingUpdates.subscription.billingSettings.billingAddress.address',
|
|
533
|
-
},
|
|
534
|
-
{
|
|
535
|
-
path: 'historyEntries.event.resetPendingUpdates.subscription.shippingAddress.address',
|
|
536
|
-
},
|
|
537
|
-
{
|
|
538
|
-
path: 'historyEntries.event.gracePeriodStarted.subscription.billingSettings.billingAddress.address',
|
|
539
|
-
},
|
|
540
|
-
{
|
|
541
|
-
path: 'historyEntries.event.gracePeriodStarted.subscription.shippingAddress.address',
|
|
542
|
-
},
|
|
543
|
-
{
|
|
544
|
-
path: 'historyEntries.event.gracePeriodEnded.subscription.billingSettings.billingAddress.address',
|
|
545
|
-
},
|
|
546
|
-
{
|
|
547
|
-
path: 'historyEntries.event.gracePeriodEnded.subscription.shippingAddress.address',
|
|
548
|
-
},
|
|
549
|
-
{
|
|
550
|
-
path: 'historyEntries.event.paymentMethodUpdated.subscription.billingSettings.billingAddress.address',
|
|
551
|
-
},
|
|
552
|
-
{
|
|
553
|
-
path: 'historyEntries.event.paymentMethodUpdated.subscription.shippingAddress.address',
|
|
554
|
-
},
|
|
555
|
-
{
|
|
556
|
-
path: 'historyEntries.event.collectionMethodUpdated.subscription.billingSettings.billingAddress.address',
|
|
557
|
-
},
|
|
558
|
-
{
|
|
559
|
-
path: 'historyEntries.event.collectionMethodUpdated.subscription.shippingAddress.address',
|
|
560
|
-
},
|
|
561
|
-
{
|
|
562
|
-
path: 'historyEntries.event.freeTrailStarted.subscription.billingSettings.billingAddress.address',
|
|
563
|
-
},
|
|
564
|
-
{
|
|
565
|
-
path: 'historyEntries.event.freeTrailStarted.subscription.shippingAddress.address',
|
|
566
|
-
},
|
|
567
|
-
{
|
|
568
|
-
path: 'historyEntries.event.freeTrailEnded.subscription.billingSettings.billingAddress.address',
|
|
569
|
-
},
|
|
570
|
-
{
|
|
571
|
-
path: 'historyEntries.event.freeTrailEnded.subscription.shippingAddress.address',
|
|
572
|
-
},
|
|
573
|
-
{
|
|
574
|
-
path: 'historyEntries.event.invoiceMarkedAsPaid.subscription.billingSettings.billingAddress.address',
|
|
575
|
-
},
|
|
576
|
-
{
|
|
577
|
-
path: 'historyEntries.event.invoiceMarkedAsPaid.subscription.shippingAddress.address',
|
|
578
|
-
},
|
|
579
|
-
{
|
|
580
|
-
path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.billingSettings.billingAddress.address',
|
|
581
|
-
},
|
|
582
|
-
{
|
|
583
|
-
path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.shippingAddress.address',
|
|
584
|
-
},
|
|
585
|
-
{
|
|
586
|
-
path: 'historyEntries.event.subscriptionBoAction.subscription.billingSettings.billingAddress.address',
|
|
587
|
-
},
|
|
588
|
-
{
|
|
589
|
-
path: 'historyEntries.event.subscriptionBoAction.subscription.shippingAddress.address',
|
|
590
|
-
},
|
|
591
|
-
],
|
|
592
|
-
},
|
|
593
|
-
]));
|
|
594
|
-
}
|
|
595
|
-
catch (err) {
|
|
596
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
597
|
-
spreadPathsToArguments: {},
|
|
598
|
-
explicitPathsToArguments: {
|
|
599
|
-
subscriptionId: '$[0]',
|
|
600
|
-
mode: '$[1].mode',
|
|
601
|
-
cursor: '$[1].cursor',
|
|
602
|
-
},
|
|
603
|
-
singleArgumentUnchanged: false,
|
|
604
|
-
}, ['subscriptionId', 'options']);
|
|
605
|
-
sideEffects?.onError?.(err);
|
|
606
|
-
throw transformedError;
|
|
607
|
-
}
|
|
608
|
-
}
|
|
609
|
-
exports.listSubscriptionHistory = listSubscriptionHistory;
|
|
349
|
+
var HistoryViewMode;
|
|
350
|
+
(function (HistoryViewMode) {
|
|
351
|
+
HistoryViewMode["UNKNOWN"] = "UNKNOWN";
|
|
352
|
+
/** Comprehensive view including all history events. */
|
|
353
|
+
HistoryViewMode["BACKOFFICE"] = "BACKOFFICE";
|
|
354
|
+
/** User-centric view of the history. */
|
|
355
|
+
HistoryViewMode["USER"] = "USER";
|
|
356
|
+
})(HistoryViewMode || (exports.HistoryViewMode = HistoryViewMode = {}));
|
|
357
|
+
var PaymentSettlementMethod;
|
|
358
|
+
(function (PaymentSettlementMethod) {
|
|
359
|
+
PaymentSettlementMethod["UNKNOWN"] = "UNKNOWN";
|
|
360
|
+
/** System-defined payment settlement. */
|
|
361
|
+
PaymentSettlementMethod["SYSTEM"] = "SYSTEM";
|
|
362
|
+
/** Manually mark the payment as paid. */
|
|
363
|
+
PaymentSettlementMethod["MARK_AS_PAID"] = "MARK_AS_PAID";
|
|
364
|
+
/** Require the customer to pay immediately, by insert a new payment method. */
|
|
365
|
+
PaymentSettlementMethod["CUSTOMER_PAY_NOW"] = "CUSTOMER_PAY_NOW";
|
|
366
|
+
})(PaymentSettlementMethod || (exports.PaymentSettlementMethod = PaymentSettlementMethod = {}));
|
|
610
367
|
/**
|
|
611
368
|
* Identity must be a site member and customer subscription belongs to
|
|
612
369
|
* @public
|
|
@@ -984,6 +741,52 @@ async function customerInitiatePaymentMethodSetup(_id, options) {
|
|
|
984
741
|
}
|
|
985
742
|
}
|
|
986
743
|
exports.customerInitiatePaymentMethodSetup = customerInitiatePaymentMethodSetup;
|
|
744
|
+
/**
|
|
745
|
+
* This used only for automation and permitted tenants (QA & testing)
|
|
746
|
+
* @public
|
|
747
|
+
* @documentationMaturity preview
|
|
748
|
+
* @requiredField options.tenantId
|
|
749
|
+
* @requiredField subscriptionId
|
|
750
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsBackOfficeService.PayCycle
|
|
751
|
+
*/
|
|
752
|
+
async function payCycle(subscriptionId, options) {
|
|
753
|
+
// @ts-ignore
|
|
754
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
755
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
756
|
+
subscriptionId: subscriptionId,
|
|
757
|
+
paymentTestMode: options?.paymentTestMode,
|
|
758
|
+
tenantId: options?.tenantId,
|
|
759
|
+
});
|
|
760
|
+
const reqOpts = ambassadorWixBillingV1Subscription.payCycle(payload);
|
|
761
|
+
sideEffects?.onSiteCall?.();
|
|
762
|
+
try {
|
|
763
|
+
const result = await httpClient.request(reqOpts);
|
|
764
|
+
sideEffects?.onSuccess?.(result);
|
|
765
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
766
|
+
{
|
|
767
|
+
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
768
|
+
paths: [
|
|
769
|
+
{ path: 'subscription.billingSettings.billingAddress.address' },
|
|
770
|
+
{ path: 'subscription.shippingAddress.address' },
|
|
771
|
+
],
|
|
772
|
+
},
|
|
773
|
+
]));
|
|
774
|
+
}
|
|
775
|
+
catch (err) {
|
|
776
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
777
|
+
spreadPathsToArguments: {},
|
|
778
|
+
explicitPathsToArguments: {
|
|
779
|
+
subscriptionId: '$[0]',
|
|
780
|
+
paymentTestMode: '$[1].paymentTestMode',
|
|
781
|
+
tenantId: '$[1].tenantId',
|
|
782
|
+
},
|
|
783
|
+
singleArgumentUnchanged: false,
|
|
784
|
+
}, ['subscriptionId', 'options']);
|
|
785
|
+
sideEffects?.onError?.(err);
|
|
786
|
+
throw transformedError;
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
exports.payCycle = payCycle;
|
|
987
790
|
/**
|
|
988
791
|
* Returns a single subscription by its id
|
|
989
792
|
* @public
|
|
@@ -1533,18 +1336,76 @@ exports.turnOffSubscriptionAutoRenewal = turnOffSubscriptionAutoRenewal;
|
|
|
1533
1336
|
* @permissionScope Manage Orders
|
|
1534
1337
|
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
1535
1338
|
* @applicableIdentity APP
|
|
1536
|
-
* @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.MarkLatestInvoiceAsPaid
|
|
1537
|
-
* @deprecated
|
|
1538
|
-
* @replacedBy com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.MarkInvoiceAsPaid
|
|
1539
|
-
* @targetRemovalDate 2025-09-30
|
|
1339
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.MarkLatestInvoiceAsPaid
|
|
1340
|
+
* @deprecated
|
|
1341
|
+
* @replacedBy com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.MarkInvoiceAsPaid
|
|
1342
|
+
* @targetRemovalDate 2025-09-30
|
|
1343
|
+
*/
|
|
1344
|
+
async function markLatestInvoiceAsPaid(subscriptionId) {
|
|
1345
|
+
// @ts-ignore
|
|
1346
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
1347
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
1348
|
+
subscriptionId: subscriptionId,
|
|
1349
|
+
});
|
|
1350
|
+
const reqOpts = ambassadorWixBillingV1Subscription.markLatestInvoiceAsPaid(payload);
|
|
1351
|
+
sideEffects?.onSiteCall?.();
|
|
1352
|
+
try {
|
|
1353
|
+
const result = await httpClient.request(reqOpts);
|
|
1354
|
+
sideEffects?.onSuccess?.(result);
|
|
1355
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
1356
|
+
{
|
|
1357
|
+
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
1358
|
+
paths: [
|
|
1359
|
+
{ path: 'subscription.billingSettings.billingAddress.address' },
|
|
1360
|
+
{ path: 'subscription.shippingAddress.address' },
|
|
1361
|
+
],
|
|
1362
|
+
},
|
|
1363
|
+
]));
|
|
1364
|
+
}
|
|
1365
|
+
catch (err) {
|
|
1366
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1367
|
+
spreadPathsToArguments: {},
|
|
1368
|
+
explicitPathsToArguments: { subscriptionId: '$[0]' },
|
|
1369
|
+
singleArgumentUnchanged: false,
|
|
1370
|
+
}, ['subscriptionId']);
|
|
1371
|
+
sideEffects?.onError?.(err);
|
|
1372
|
+
throw transformedError;
|
|
1373
|
+
}
|
|
1374
|
+
}
|
|
1375
|
+
exports.markLatestInvoiceAsPaid = markLatestInvoiceAsPaid;
|
|
1376
|
+
/**
|
|
1377
|
+
* Marks the invoice associated with the subscription in the specified cycle as paid.
|
|
1378
|
+
* If `paid_cycle` is left empty, the most recent invoice will be marked as paid.
|
|
1379
|
+
* If the invoice contains items other than subscription items, an error will be thrown.
|
|
1380
|
+
*
|
|
1381
|
+
* Marks the invoice as paid for the following scenarios:
|
|
1382
|
+
* 1. Offline subscriptions.
|
|
1383
|
+
* 2. Online subscriptions during the grace period.
|
|
1384
|
+
* This operation will convert the invoice to offline, remove the grace period,
|
|
1385
|
+
* and send a BillingCycleStarted event after the invoice is closed.
|
|
1386
|
+
* 3. Online one-time payment subscriptions with a total price of zero during the purchase flow.
|
|
1387
|
+
* An Activated event will be sent after the invoice is closed, and the subscription will be activated.
|
|
1388
|
+
* 4. For external subscriptions, where the payment occurs outside of BASS, an invoice is created and marked as paid
|
|
1389
|
+
* TODO: to delete after ECOM adjustments
|
|
1390
|
+
* @param subscriptionId - The ID of the subscription to mark as paid its invoice.
|
|
1391
|
+
* @internal
|
|
1392
|
+
* @documentationMaturity preview
|
|
1393
|
+
* @requiredField subscriptionId
|
|
1394
|
+
* @permissionId subscriptions.manage
|
|
1395
|
+
* @permissionScope Manage Orders
|
|
1396
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
1397
|
+
* @applicableIdentity APP
|
|
1398
|
+
* @returns TODO: to delete after ECOM adjustments
|
|
1399
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.MarkInvoiceAsPaid
|
|
1540
1400
|
*/
|
|
1541
|
-
async function
|
|
1401
|
+
async function markInvoiceAsPaid(subscriptionId, options) {
|
|
1542
1402
|
// @ts-ignore
|
|
1543
|
-
const { httpClient, sideEffects } = arguments[
|
|
1403
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1544
1404
|
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
1545
1405
|
subscriptionId: subscriptionId,
|
|
1406
|
+
paidCycle: options?.paidCycle,
|
|
1546
1407
|
});
|
|
1547
|
-
const reqOpts = ambassadorWixBillingV1Subscription.
|
|
1408
|
+
const reqOpts = ambassadorWixBillingV1Subscription.markInvoiceAsPaid(payload);
|
|
1548
1409
|
sideEffects?.onSiteCall?.();
|
|
1549
1410
|
try {
|
|
1550
1411
|
const result = await httpClient.request(reqOpts);
|
|
@@ -1562,16 +1423,19 @@ async function markLatestInvoiceAsPaid(subscriptionId) {
|
|
|
1562
1423
|
catch (err) {
|
|
1563
1424
|
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1564
1425
|
spreadPathsToArguments: {},
|
|
1565
|
-
explicitPathsToArguments: {
|
|
1426
|
+
explicitPathsToArguments: {
|
|
1427
|
+
subscriptionId: '$[0]',
|
|
1428
|
+
paidCycle: '$[1].paidCycle',
|
|
1429
|
+
},
|
|
1566
1430
|
singleArgumentUnchanged: false,
|
|
1567
|
-
}, ['subscriptionId']);
|
|
1431
|
+
}, ['subscriptionId', 'options']);
|
|
1568
1432
|
sideEffects?.onError?.(err);
|
|
1569
1433
|
throw transformedError;
|
|
1570
1434
|
}
|
|
1571
1435
|
}
|
|
1572
|
-
exports.
|
|
1436
|
+
exports.markInvoiceAsPaid = markInvoiceAsPaid;
|
|
1573
1437
|
/**
|
|
1574
|
-
* Marks the invoice associated with
|
|
1438
|
+
* Marks the invoice associated with given subscription cycle as paid for the following scenarios:
|
|
1575
1439
|
* If `paid_cycle` is left empty, the most recent invoice will be marked as paid.
|
|
1576
1440
|
* If the invoice contains items other than subscription items, an error will be thrown.
|
|
1577
1441
|
*
|
|
@@ -1591,16 +1455,16 @@ exports.markLatestInvoiceAsPaid = markLatestInvoiceAsPaid;
|
|
|
1591
1455
|
* @permissionScope Manage Orders
|
|
1592
1456
|
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
1593
1457
|
* @applicableIdentity APP
|
|
1594
|
-
* @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.
|
|
1458
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.MarkBillingCycleAsPaid
|
|
1595
1459
|
*/
|
|
1596
|
-
async function
|
|
1460
|
+
async function markBillingCycleAsPaid(subscriptionId, options) {
|
|
1597
1461
|
// @ts-ignore
|
|
1598
1462
|
const { httpClient, sideEffects } = arguments[2];
|
|
1599
1463
|
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
1600
1464
|
subscriptionId: subscriptionId,
|
|
1601
1465
|
paidCycle: options?.paidCycle,
|
|
1602
1466
|
});
|
|
1603
|
-
const reqOpts = ambassadorWixBillingV1Subscription.
|
|
1467
|
+
const reqOpts = ambassadorWixBillingV1Subscription.markBillingCycleAsPaid(payload);
|
|
1604
1468
|
sideEffects?.onSiteCall?.();
|
|
1605
1469
|
try {
|
|
1606
1470
|
const result = await httpClient.request(reqOpts);
|
|
@@ -1628,7 +1492,7 @@ async function markInvoiceAsPaid(subscriptionId, options) {
|
|
|
1628
1492
|
throw transformedError;
|
|
1629
1493
|
}
|
|
1630
1494
|
}
|
|
1631
|
-
exports.
|
|
1495
|
+
exports.markBillingCycleAsPaid = markBillingCycleAsPaid;
|
|
1632
1496
|
/**
|
|
1633
1497
|
* Returns number of subscriptions in each state.
|
|
1634
1498
|
* @public
|
|
@@ -1668,6 +1532,7 @@ exports.getSubscriptionsStats = getSubscriptionsStats;
|
|
|
1668
1532
|
* @documentationMaturity preview
|
|
1669
1533
|
* @requiredField _id
|
|
1670
1534
|
* @requiredField actionContext
|
|
1535
|
+
* @requiredField extendPolicy
|
|
1671
1536
|
* @permissionId subscriptions.manage
|
|
1672
1537
|
* @permissionScope Manage Orders
|
|
1673
1538
|
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
@@ -1795,11 +1660,10 @@ exports.listUpcomingCharges = listUpcomingCharges;
|
|
|
1795
1660
|
* Returns all the charges applicable to a subscription based on the provided subscription information.
|
|
1796
1661
|
* @public
|
|
1797
1662
|
* @documentationMaturity preview
|
|
1798
|
-
* @requiredField
|
|
1799
|
-
* @requiredField
|
|
1800
|
-
* @requiredField
|
|
1801
|
-
* @requiredField
|
|
1802
|
-
* @requiredField options.subscriptionInfo.items.pricingModel
|
|
1663
|
+
* @requiredField subscription.subscriptionInfo
|
|
1664
|
+
* @requiredField subscription.subscriptionInfo.billingSettings
|
|
1665
|
+
* @requiredField subscription.subscriptionInfo.items
|
|
1666
|
+
* @requiredField subscription.subscriptionInfo.items.pricingModel
|
|
1803
1667
|
* @permissionId subscriptions.view
|
|
1804
1668
|
* @permissionScope Manage Events
|
|
1805
1669
|
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
@@ -1846,11 +1710,12 @@ exports.previewSubscriptionCharges = previewSubscriptionCharges;
|
|
|
1846
1710
|
* @public
|
|
1847
1711
|
* @documentationMaturity preview
|
|
1848
1712
|
* @requiredField options.subscriptionsBillingDetails.billingSettings
|
|
1849
|
-
* @requiredField options.subscriptionsBillingDetails.billingSettings.shippingCharges.tax
|
|
1713
|
+
* @requiredField options.subscriptionsBillingDetails.billingSettings.shippingCharges.tax.value
|
|
1850
1714
|
* @requiredField options.subscriptionsBillingDetails.externalId
|
|
1851
1715
|
* @requiredField options.subscriptionsBillingDetails.items
|
|
1852
1716
|
* @requiredField options.subscriptionsBillingDetails.items.pricingModel
|
|
1853
|
-
* @requiredField options.subscriptionsBillingDetails.items.
|
|
1717
|
+
* @requiredField options.subscriptionsBillingDetails.items.pricingModel.model
|
|
1718
|
+
* @requiredField options.subscriptionsBillingDetails.items.tax.value
|
|
1854
1719
|
* @permissionId subscriptions.view
|
|
1855
1720
|
* @permissionScope Manage Events
|
|
1856
1721
|
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
@@ -1936,23 +1801,24 @@ async function initiatePaymentMethodSetup(_id, options) {
|
|
|
1936
1801
|
}
|
|
1937
1802
|
}
|
|
1938
1803
|
exports.initiatePaymentMethodSetup = initiatePaymentMethodSetup;
|
|
1939
|
-
/**
|
|
1940
|
-
* This used only for automation and permitted tenants (QA & testing)
|
|
1941
|
-
* @public
|
|
1804
|
+
/** @public
|
|
1942
1805
|
* @documentationMaturity preview
|
|
1943
|
-
* @requiredField options.tenantId
|
|
1944
1806
|
* @requiredField subscriptionId
|
|
1945
|
-
* @
|
|
1807
|
+
* @permissionId subscriptions.view
|
|
1808
|
+
* @permissionScope Manage Events
|
|
1809
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
1810
|
+
* @applicableIdentity APP
|
|
1811
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionHistoryService.ListSubscriptionHistory
|
|
1946
1812
|
*/
|
|
1947
|
-
async function
|
|
1813
|
+
async function listSubscriptionHistory(subscriptionId, options) {
|
|
1948
1814
|
// @ts-ignore
|
|
1949
1815
|
const { httpClient, sideEffects } = arguments[2];
|
|
1950
1816
|
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
1951
1817
|
subscriptionId: subscriptionId,
|
|
1952
|
-
|
|
1953
|
-
|
|
1818
|
+
mode: options?.mode,
|
|
1819
|
+
cursor: options?.cursor,
|
|
1954
1820
|
});
|
|
1955
|
-
const reqOpts = ambassadorWixBillingV1Subscription.
|
|
1821
|
+
const reqOpts = ambassadorWixBillingV1Subscription.listSubscriptionHistory(payload);
|
|
1956
1822
|
sideEffects?.onSiteCall?.();
|
|
1957
1823
|
try {
|
|
1958
1824
|
const result = await httpClient.request(reqOpts);
|
|
@@ -1961,8 +1827,204 @@ async function payCycle(subscriptionId, options) {
|
|
|
1961
1827
|
{
|
|
1962
1828
|
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
1963
1829
|
paths: [
|
|
1964
|
-
{
|
|
1965
|
-
|
|
1830
|
+
{
|
|
1831
|
+
path: 'historyEntries.event.created.subscription.billingSettings.billingAddress.address',
|
|
1832
|
+
},
|
|
1833
|
+
{
|
|
1834
|
+
path: 'historyEntries.event.created.subscription.shippingAddress.address',
|
|
1835
|
+
},
|
|
1836
|
+
{
|
|
1837
|
+
path: 'historyEntries.event.updated.current.billingSettings.billingAddress.address',
|
|
1838
|
+
},
|
|
1839
|
+
{
|
|
1840
|
+
path: 'historyEntries.event.updated.current.shippingAddress.address',
|
|
1841
|
+
},
|
|
1842
|
+
{
|
|
1843
|
+
path: 'historyEntries.event.updated.previous.billingSettings.billingAddress.address',
|
|
1844
|
+
},
|
|
1845
|
+
{
|
|
1846
|
+
path: 'historyEntries.event.updated.previous.shippingAddress.address',
|
|
1847
|
+
},
|
|
1848
|
+
{
|
|
1849
|
+
path: 'historyEntries.event.activated.subscription.billingSettings.billingAddress.address',
|
|
1850
|
+
},
|
|
1851
|
+
{
|
|
1852
|
+
path: 'historyEntries.event.activated.subscription.shippingAddress.address',
|
|
1853
|
+
},
|
|
1854
|
+
{
|
|
1855
|
+
path: 'historyEntries.event.ended.subscription.billingSettings.billingAddress.address',
|
|
1856
|
+
},
|
|
1857
|
+
{
|
|
1858
|
+
path: 'historyEntries.event.ended.subscription.shippingAddress.address',
|
|
1859
|
+
},
|
|
1860
|
+
{
|
|
1861
|
+
path: 'historyEntries.event.canceled.subscription.billingSettings.billingAddress.address',
|
|
1862
|
+
},
|
|
1863
|
+
{
|
|
1864
|
+
path: 'historyEntries.event.canceled.subscription.shippingAddress.address',
|
|
1865
|
+
},
|
|
1866
|
+
{
|
|
1867
|
+
path: 'historyEntries.event.paused.subscription.billingSettings.billingAddress.address',
|
|
1868
|
+
},
|
|
1869
|
+
{
|
|
1870
|
+
path: 'historyEntries.event.paused.subscription.shippingAddress.address',
|
|
1871
|
+
},
|
|
1872
|
+
{
|
|
1873
|
+
path: 'historyEntries.event.resumed.subscription.billingSettings.billingAddress.address',
|
|
1874
|
+
},
|
|
1875
|
+
{
|
|
1876
|
+
path: 'historyEntries.event.resumed.subscription.shippingAddress.address',
|
|
1877
|
+
},
|
|
1878
|
+
{
|
|
1879
|
+
path: 'historyEntries.event.pauseRequested.subscription.billingSettings.billingAddress.address',
|
|
1880
|
+
},
|
|
1881
|
+
{
|
|
1882
|
+
path: 'historyEntries.event.pauseRequested.subscription.shippingAddress.address',
|
|
1883
|
+
},
|
|
1884
|
+
{
|
|
1885
|
+
path: 'historyEntries.event.resumeRequested.subscription.billingSettings.billingAddress.address',
|
|
1886
|
+
},
|
|
1887
|
+
{
|
|
1888
|
+
path: 'historyEntries.event.resumeRequested.subscription.shippingAddress.address',
|
|
1889
|
+
},
|
|
1890
|
+
{
|
|
1891
|
+
path: 'historyEntries.event.scheduledPauseCanceled.subscription.billingSettings.billingAddress.address',
|
|
1892
|
+
},
|
|
1893
|
+
{
|
|
1894
|
+
path: 'historyEntries.event.scheduledPauseCanceled.subscription.shippingAddress.address',
|
|
1895
|
+
},
|
|
1896
|
+
{
|
|
1897
|
+
path: 'historyEntries.event.scheduledResumeCanceled.subscription.billingSettings.billingAddress.address',
|
|
1898
|
+
},
|
|
1899
|
+
{
|
|
1900
|
+
path: 'historyEntries.event.scheduledResumeCanceled.subscription.shippingAddress.address',
|
|
1901
|
+
},
|
|
1902
|
+
{
|
|
1903
|
+
path: 'historyEntries.event.billingCycleStarted.subscription.billingSettings.billingAddress.address',
|
|
1904
|
+
},
|
|
1905
|
+
{
|
|
1906
|
+
path: 'historyEntries.event.billingCycleStarted.subscription.shippingAddress.address',
|
|
1907
|
+
},
|
|
1908
|
+
{
|
|
1909
|
+
path: 'historyEntries.event.autoRenewalTurnedOn.subscription.billingSettings.billingAddress.address',
|
|
1910
|
+
},
|
|
1911
|
+
{
|
|
1912
|
+
path: 'historyEntries.event.autoRenewalTurnedOn.subscription.shippingAddress.address',
|
|
1913
|
+
},
|
|
1914
|
+
{
|
|
1915
|
+
path: 'historyEntries.event.autoRenewalTurnedOff.subscription.billingSettings.billingAddress.address',
|
|
1916
|
+
},
|
|
1917
|
+
{
|
|
1918
|
+
path: 'historyEntries.event.autoRenewalTurnedOff.subscription.shippingAddress.address',
|
|
1919
|
+
},
|
|
1920
|
+
{
|
|
1921
|
+
path: 'historyEntries.event.cycleReadyToPay.subscription.billingSettings.billingAddress.address',
|
|
1922
|
+
},
|
|
1923
|
+
{
|
|
1924
|
+
path: 'historyEntries.event.cycleReadyToPay.subscription.shippingAddress.address',
|
|
1925
|
+
},
|
|
1926
|
+
{
|
|
1927
|
+
path: 'historyEntries.event.extended.subscription.billingSettings.billingAddress.address',
|
|
1928
|
+
},
|
|
1929
|
+
{
|
|
1930
|
+
path: 'historyEntries.event.extended.subscription.shippingAddress.address',
|
|
1931
|
+
},
|
|
1932
|
+
{
|
|
1933
|
+
path: 'historyEntries.event.initialPurchaseCompleted.subscription.billingSettings.billingAddress.address',
|
|
1934
|
+
},
|
|
1935
|
+
{
|
|
1936
|
+
path: 'historyEntries.event.initialPurchaseCompleted.subscription.shippingAddress.address',
|
|
1937
|
+
},
|
|
1938
|
+
{
|
|
1939
|
+
path: 'historyEntries.event.latestInvoiceMarkedAsPaid.subscription.billingSettings.billingAddress.address',
|
|
1940
|
+
},
|
|
1941
|
+
{
|
|
1942
|
+
path: 'historyEntries.event.latestInvoiceMarkedAsPaid.subscription.shippingAddress.address',
|
|
1943
|
+
},
|
|
1944
|
+
{
|
|
1945
|
+
path: 'historyEntries.event.revived.subscription.billingSettings.billingAddress.address',
|
|
1946
|
+
},
|
|
1947
|
+
{
|
|
1948
|
+
path: 'historyEntries.event.revived.subscription.shippingAddress.address',
|
|
1949
|
+
},
|
|
1950
|
+
{
|
|
1951
|
+
path: 'historyEntries.event.billingDateUpdated.subscription.billingSettings.billingAddress.address',
|
|
1952
|
+
},
|
|
1953
|
+
{
|
|
1954
|
+
path: 'historyEntries.event.billingDateUpdated.subscription.shippingAddress.address',
|
|
1955
|
+
},
|
|
1956
|
+
{
|
|
1957
|
+
path: 'historyEntries.event.futureUpdatesRequested.subscription.billingSettings.billingAddress.address',
|
|
1958
|
+
},
|
|
1959
|
+
{
|
|
1960
|
+
path: 'historyEntries.event.futureUpdatesRequested.subscription.shippingAddress.address',
|
|
1961
|
+
},
|
|
1962
|
+
{
|
|
1963
|
+
path: 'historyEntries.event.updatesApplied.subscription.billingSettings.billingAddress.address',
|
|
1964
|
+
},
|
|
1965
|
+
{
|
|
1966
|
+
path: 'historyEntries.event.updatesApplied.subscription.shippingAddress.address',
|
|
1967
|
+
},
|
|
1968
|
+
{
|
|
1969
|
+
path: 'historyEntries.event.resetPendingUpdates.subscription.billingSettings.billingAddress.address',
|
|
1970
|
+
},
|
|
1971
|
+
{
|
|
1972
|
+
path: 'historyEntries.event.resetPendingUpdates.subscription.shippingAddress.address',
|
|
1973
|
+
},
|
|
1974
|
+
{
|
|
1975
|
+
path: 'historyEntries.event.gracePeriodStarted.subscription.billingSettings.billingAddress.address',
|
|
1976
|
+
},
|
|
1977
|
+
{
|
|
1978
|
+
path: 'historyEntries.event.gracePeriodStarted.subscription.shippingAddress.address',
|
|
1979
|
+
},
|
|
1980
|
+
{
|
|
1981
|
+
path: 'historyEntries.event.gracePeriodEnded.subscription.billingSettings.billingAddress.address',
|
|
1982
|
+
},
|
|
1983
|
+
{
|
|
1984
|
+
path: 'historyEntries.event.gracePeriodEnded.subscription.shippingAddress.address',
|
|
1985
|
+
},
|
|
1986
|
+
{
|
|
1987
|
+
path: 'historyEntries.event.paymentMethodUpdated.subscription.billingSettings.billingAddress.address',
|
|
1988
|
+
},
|
|
1989
|
+
{
|
|
1990
|
+
path: 'historyEntries.event.paymentMethodUpdated.subscription.shippingAddress.address',
|
|
1991
|
+
},
|
|
1992
|
+
{
|
|
1993
|
+
path: 'historyEntries.event.collectionMethodUpdated.subscription.billingSettings.billingAddress.address',
|
|
1994
|
+
},
|
|
1995
|
+
{
|
|
1996
|
+
path: 'historyEntries.event.collectionMethodUpdated.subscription.shippingAddress.address',
|
|
1997
|
+
},
|
|
1998
|
+
{
|
|
1999
|
+
path: 'historyEntries.event.freeTrailStarted.subscription.billingSettings.billingAddress.address',
|
|
2000
|
+
},
|
|
2001
|
+
{
|
|
2002
|
+
path: 'historyEntries.event.freeTrailStarted.subscription.shippingAddress.address',
|
|
2003
|
+
},
|
|
2004
|
+
{
|
|
2005
|
+
path: 'historyEntries.event.freeTrailEnded.subscription.billingSettings.billingAddress.address',
|
|
2006
|
+
},
|
|
2007
|
+
{
|
|
2008
|
+
path: 'historyEntries.event.freeTrailEnded.subscription.shippingAddress.address',
|
|
2009
|
+
},
|
|
2010
|
+
{
|
|
2011
|
+
path: 'historyEntries.event.billingCyclePaid.subscription.billingSettings.billingAddress.address',
|
|
2012
|
+
},
|
|
2013
|
+
{
|
|
2014
|
+
path: 'historyEntries.event.billingCyclePaid.subscription.shippingAddress.address',
|
|
2015
|
+
},
|
|
2016
|
+
{
|
|
2017
|
+
path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.billingSettings.billingAddress.address',
|
|
2018
|
+
},
|
|
2019
|
+
{
|
|
2020
|
+
path: 'historyEntries.event.initiatePaymentMethodSetup.subscription.shippingAddress.address',
|
|
2021
|
+
},
|
|
2022
|
+
{
|
|
2023
|
+
path: 'historyEntries.event.subscriptionBoAction.subscription.billingSettings.billingAddress.address',
|
|
2024
|
+
},
|
|
2025
|
+
{
|
|
2026
|
+
path: 'historyEntries.event.subscriptionBoAction.subscription.shippingAddress.address',
|
|
2027
|
+
},
|
|
1966
2028
|
],
|
|
1967
2029
|
},
|
|
1968
2030
|
]));
|
|
@@ -1972,8 +2034,8 @@ async function payCycle(subscriptionId, options) {
|
|
|
1972
2034
|
spreadPathsToArguments: {},
|
|
1973
2035
|
explicitPathsToArguments: {
|
|
1974
2036
|
subscriptionId: '$[0]',
|
|
1975
|
-
|
|
1976
|
-
|
|
2037
|
+
mode: '$[1].mode',
|
|
2038
|
+
cursor: '$[1].cursor',
|
|
1977
2039
|
},
|
|
1978
2040
|
singleArgumentUnchanged: false,
|
|
1979
2041
|
}, ['subscriptionId', 'options']);
|
|
@@ -1981,5 +2043,5 @@ async function payCycle(subscriptionId, options) {
|
|
|
1981
2043
|
throw transformedError;
|
|
1982
2044
|
}
|
|
1983
2045
|
}
|
|
1984
|
-
exports.
|
|
2046
|
+
exports.listSubscriptionHistory = listSubscriptionHistory;
|
|
1985
2047
|
//# sourceMappingURL=billing-v1-subscription-subscriptions.universal.js.map
|