@delopay/sdk 0.31.0 → 0.33.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,55 +2527,85 @@ var Subscriptions = class {
2527
2527
  constructor(request) {
2528
2528
  this.request = request;
2529
2529
  }
2530
- /** Create and immediately confirm a subscription. `POST /subscriptions` */
2531
- async createAndConfirm(params) {
2532
- return this.request("POST", "/subscriptions", { body: params });
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
+ */
2536
+ async createAndConfirm(params, options) {
2537
+ return this.request("POST", "/subscriptions", { body: params, ...options });
2533
2538
  }
2534
- /** Create a subscription (without confirming). `POST /subscriptions/create` */
2535
- async create(params) {
2536
- return this.request("POST", "/subscriptions/create", { body: params });
2539
+ /** Create a subscription without confirming it. `POST /subscriptions/create` */
2540
+ async create(params, options) {
2541
+ return this.request("POST", "/subscriptions/create", { body: params, ...options });
2537
2542
  }
2538
2543
  /** Retrieve a subscription by ID. `GET /subscriptions/{subscriptionId}` */
2539
- async retrieve(subscriptionId) {
2540
- return this.request("GET", `/subscriptions/${encodeURIComponent(subscriptionId)}`);
2544
+ async retrieve(subscriptionId, options) {
2545
+ return this.request("GET", `/subscriptions/${encodeURIComponent(subscriptionId)}`, {
2546
+ ...options
2547
+ });
2541
2548
  }
2542
- /** Confirm a subscription. `POST /subscriptions/{subscriptionId}/confirm` */
2543
- async confirm(subscriptionId, params) {
2549
+ /**
2550
+ * Confirm a previously created subscription. `POST /subscriptions/{subscriptionId}/confirm`
2551
+ *
2552
+ * Like {@link createAndConfirm}, the response may carry a `redirect_url` for
2553
+ * processors that require buyer approval.
2554
+ */
2555
+ async confirm(subscriptionId, params, options) {
2544
2556
  return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/confirm`, {
2545
- body: params
2557
+ body: params,
2558
+ ...options
2546
2559
  });
2547
2560
  }
2548
- /** Update a subscription. `PUT /subscriptions/{subscriptionId}/update` */
2549
- async update(subscriptionId, params) {
2561
+ /** Update a subscription's plan/price. `PUT /subscriptions/{subscriptionId}/update` */
2562
+ async update(subscriptionId, params, options) {
2550
2563
  return this.request("PUT", `/subscriptions/${encodeURIComponent(subscriptionId)}/update`, {
2551
- body: params
2564
+ body: params,
2565
+ ...options
2552
2566
  });
2553
2567
  }
2554
- /** List subscriptions. `GET /subscriptions/list` */
2555
- async list(params) {
2568
+ /** List subscriptions for the profile. `GET /subscriptions/list` */
2569
+ async list(params, options) {
2556
2570
  return this.request("GET", "/subscriptions/list", {
2557
- query: params
2571
+ query: params,
2572
+ ...options
2558
2573
  });
2559
2574
  }
2560
- /** Get subscription estimate. `GET /subscriptions/estimate` */
2561
- async getEstimate(params) {
2562
- return this.request("GET", "/subscriptions/estimate", { query: params });
2575
+ /** Estimate the cost of a subscription before creating it. `GET /subscriptions/estimate` */
2576
+ async getEstimate(params, options) {
2577
+ return this.request("GET", "/subscriptions/estimate", {
2578
+ query: params,
2579
+ ...options
2580
+ });
2563
2581
  }
2564
- /** Get subscription items. `GET /subscriptions/items` */
2565
- async getItems(params) {
2566
- return this.request("GET", "/subscriptions/items", { query: params });
2582
+ /** List purchasable subscription items (plans/addons). `GET /subscriptions/items` */
2583
+ async getItems(params, options) {
2584
+ return this.request("GET", "/subscriptions/items", {
2585
+ query: params,
2586
+ ...options
2587
+ });
2567
2588
  }
2568
2589
  /** Pause a subscription. `POST /subscriptions/{subscriptionId}/pause` */
2569
- async pause(subscriptionId) {
2570
- return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/pause`);
2590
+ async pause(subscriptionId, params, options) {
2591
+ return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/pause`, {
2592
+ body: params,
2593
+ ...options
2594
+ });
2571
2595
  }
2572
- /** Resume a subscription. `POST /subscriptions/{subscriptionId}/resume` */
2573
- async resume(subscriptionId) {
2574
- return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/resume`);
2596
+ /** Resume a paused subscription. `POST /subscriptions/{subscriptionId}/resume` */
2597
+ async resume(subscriptionId, params, options) {
2598
+ return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/resume`, {
2599
+ body: params,
2600
+ ...options
2601
+ });
2575
2602
  }
2576
2603
  /** Cancel a subscription. `POST /subscriptions/{subscriptionId}/cancel` */
2577
- async cancel(subscriptionId) {
2578
- return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/cancel`);
2604
+ async cancel(subscriptionId, params, options) {
2605
+ return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/cancel`, {
2606
+ body: params,
2607
+ ...options
2608
+ });
2579
2609
  }
2580
2610
  };
2581
2611
 
@@ -3656,4 +3686,4 @@ export {
3656
3686
  applyBrandingVariables,
3657
3687
  shadowFor
3658
3688
  };
3659
- //# sourceMappingURL=chunk-5C42YTV2.js.map
3689
+ //# sourceMappingURL=chunk-33ZLHH3I.js.map