@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.
package/dist/index.cjs CHANGED
@@ -2594,11 +2594,16 @@ var Subscriptions = class {
2594
2594
  constructor(request) {
2595
2595
  this.request = request;
2596
2596
  }
2597
- /** Create and immediately confirm a subscription. `POST /subscriptions` */
2597
+ /**
2598
+ * Create and immediately confirm a subscription. `POST /subscriptions`
2599
+ *
2600
+ * For billing processors that require buyer approval (e.g. PayPal), the
2601
+ * response carries a `redirect_url` the customer must be sent to.
2602
+ */
2598
2603
  async createAndConfirm(params) {
2599
2604
  return this.request("POST", "/subscriptions", { body: params });
2600
2605
  }
2601
- /** Create a subscription (without confirming). `POST /subscriptions/create` */
2606
+ /** Create a subscription without confirming it. `POST /subscriptions/create` */
2602
2607
  async create(params) {
2603
2608
  return this.request("POST", "/subscriptions/create", { body: params });
2604
2609
  }
@@ -2606,43 +2611,58 @@ var Subscriptions = class {
2606
2611
  async retrieve(subscriptionId) {
2607
2612
  return this.request("GET", `/subscriptions/${encodeURIComponent(subscriptionId)}`);
2608
2613
  }
2609
- /** Confirm a subscription. `POST /subscriptions/{subscriptionId}/confirm` */
2614
+ /**
2615
+ * Confirm a previously created subscription. `POST /subscriptions/{subscriptionId}/confirm`
2616
+ *
2617
+ * Like {@link createAndConfirm}, the response may carry a `redirect_url` for
2618
+ * processors that require buyer approval.
2619
+ */
2610
2620
  async confirm(subscriptionId, params) {
2611
2621
  return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/confirm`, {
2612
2622
  body: params
2613
2623
  });
2614
2624
  }
2615
- /** Update a subscription. `PUT /subscriptions/{subscriptionId}/update` */
2625
+ /** Update a subscription's plan/price. `PUT /subscriptions/{subscriptionId}/update` */
2616
2626
  async update(subscriptionId, params) {
2617
2627
  return this.request("PUT", `/subscriptions/${encodeURIComponent(subscriptionId)}/update`, {
2618
2628
  body: params
2619
2629
  });
2620
2630
  }
2621
- /** List subscriptions. `GET /subscriptions/list` */
2631
+ /** List subscriptions for the profile. `GET /subscriptions/list` */
2622
2632
  async list(params) {
2623
2633
  return this.request("GET", "/subscriptions/list", {
2624
2634
  query: params
2625
2635
  });
2626
2636
  }
2627
- /** Get subscription estimate. `GET /subscriptions/estimate` */
2637
+ /** Estimate the cost of a subscription before creating it. `GET /subscriptions/estimate` */
2628
2638
  async getEstimate(params) {
2629
- return this.request("GET", "/subscriptions/estimate", { query: params });
2639
+ return this.request("GET", "/subscriptions/estimate", {
2640
+ query: params
2641
+ });
2630
2642
  }
2631
- /** Get subscription items. `GET /subscriptions/items` */
2643
+ /** List purchasable subscription items (plans/addons). `GET /subscriptions/items` */
2632
2644
  async getItems(params) {
2633
- return this.request("GET", "/subscriptions/items", { query: params });
2645
+ return this.request("GET", "/subscriptions/items", {
2646
+ query: params
2647
+ });
2634
2648
  }
2635
2649
  /** Pause a subscription. `POST /subscriptions/{subscriptionId}/pause` */
2636
- async pause(subscriptionId) {
2637
- return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/pause`);
2650
+ async pause(subscriptionId, params) {
2651
+ return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/pause`, {
2652
+ body: params
2653
+ });
2638
2654
  }
2639
- /** Resume a subscription. `POST /subscriptions/{subscriptionId}/resume` */
2640
- async resume(subscriptionId) {
2641
- return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/resume`);
2655
+ /** Resume a paused subscription. `POST /subscriptions/{subscriptionId}/resume` */
2656
+ async resume(subscriptionId, params) {
2657
+ return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/resume`, {
2658
+ body: params
2659
+ });
2642
2660
  }
2643
2661
  /** Cancel a subscription. `POST /subscriptions/{subscriptionId}/cancel` */
2644
- async cancel(subscriptionId) {
2645
- return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/cancel`);
2662
+ async cancel(subscriptionId, params) {
2663
+ return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/cancel`, {
2664
+ body: params
2665
+ });
2646
2666
  }
2647
2667
  };
2648
2668