@delopay/sdk 0.31.0 → 0.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2527,11 +2527,16 @@ var Subscriptions = class {
2527
2527
  constructor(request) {
2528
2528
  this.request = request;
2529
2529
  }
2530
- /** Create and immediately confirm a subscription. `POST /subscriptions` */
2530
+ /**
2531
+ * Create and immediately confirm a subscription. `POST /subscriptions`
2532
+ *
2533
+ * For billing processors that require buyer approval (e.g. PayPal), the
2534
+ * response carries a `redirect_url` the customer must be sent to.
2535
+ */
2531
2536
  async createAndConfirm(params) {
2532
2537
  return this.request("POST", "/subscriptions", { body: params });
2533
2538
  }
2534
- /** Create a subscription (without confirming). `POST /subscriptions/create` */
2539
+ /** Create a subscription without confirming it. `POST /subscriptions/create` */
2535
2540
  async create(params) {
2536
2541
  return this.request("POST", "/subscriptions/create", { body: params });
2537
2542
  }
@@ -2539,43 +2544,58 @@ var Subscriptions = class {
2539
2544
  async retrieve(subscriptionId) {
2540
2545
  return this.request("GET", `/subscriptions/${encodeURIComponent(subscriptionId)}`);
2541
2546
  }
2542
- /** Confirm a subscription. `POST /subscriptions/{subscriptionId}/confirm` */
2547
+ /**
2548
+ * Confirm a previously created subscription. `POST /subscriptions/{subscriptionId}/confirm`
2549
+ *
2550
+ * Like {@link createAndConfirm}, the response may carry a `redirect_url` for
2551
+ * processors that require buyer approval.
2552
+ */
2543
2553
  async confirm(subscriptionId, params) {
2544
2554
  return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/confirm`, {
2545
2555
  body: params
2546
2556
  });
2547
2557
  }
2548
- /** Update a subscription. `PUT /subscriptions/{subscriptionId}/update` */
2558
+ /** Update a subscription's plan/price. `PUT /subscriptions/{subscriptionId}/update` */
2549
2559
  async update(subscriptionId, params) {
2550
2560
  return this.request("PUT", `/subscriptions/${encodeURIComponent(subscriptionId)}/update`, {
2551
2561
  body: params
2552
2562
  });
2553
2563
  }
2554
- /** List subscriptions. `GET /subscriptions/list` */
2564
+ /** List subscriptions for the profile. `GET /subscriptions/list` */
2555
2565
  async list(params) {
2556
2566
  return this.request("GET", "/subscriptions/list", {
2557
2567
  query: params
2558
2568
  });
2559
2569
  }
2560
- /** Get subscription estimate. `GET /subscriptions/estimate` */
2570
+ /** Estimate the cost of a subscription before creating it. `GET /subscriptions/estimate` */
2561
2571
  async getEstimate(params) {
2562
- return this.request("GET", "/subscriptions/estimate", { query: params });
2572
+ return this.request("GET", "/subscriptions/estimate", {
2573
+ query: params
2574
+ });
2563
2575
  }
2564
- /** Get subscription items. `GET /subscriptions/items` */
2576
+ /** List purchasable subscription items (plans/addons). `GET /subscriptions/items` */
2565
2577
  async getItems(params) {
2566
- return this.request("GET", "/subscriptions/items", { query: params });
2578
+ return this.request("GET", "/subscriptions/items", {
2579
+ query: params
2580
+ });
2567
2581
  }
2568
2582
  /** Pause a subscription. `POST /subscriptions/{subscriptionId}/pause` */
2569
- async pause(subscriptionId) {
2570
- return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/pause`);
2583
+ async pause(subscriptionId, params) {
2584
+ return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/pause`, {
2585
+ body: params
2586
+ });
2571
2587
  }
2572
- /** Resume a subscription. `POST /subscriptions/{subscriptionId}/resume` */
2573
- async resume(subscriptionId) {
2574
- return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/resume`);
2588
+ /** Resume a paused subscription. `POST /subscriptions/{subscriptionId}/resume` */
2589
+ async resume(subscriptionId, params) {
2590
+ return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/resume`, {
2591
+ body: params
2592
+ });
2575
2593
  }
2576
2594
  /** Cancel a subscription. `POST /subscriptions/{subscriptionId}/cancel` */
2577
- async cancel(subscriptionId) {
2578
- return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/cancel`);
2595
+ async cancel(subscriptionId, params) {
2596
+ return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/cancel`, {
2597
+ body: params
2598
+ });
2579
2599
  }
2580
2600
  };
2581
2601
 
@@ -3656,4 +3676,4 @@ export {
3656
3676
  applyBrandingVariables,
3657
3677
  shadowFor
3658
3678
  };
3659
- //# sourceMappingURL=chunk-5C42YTV2.js.map
3679
+ //# sourceMappingURL=chunk-ML3Z6JBP.js.map