@delopay/sdk 0.32.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.
- package/dist/{chunk-ML3Z6JBP.js → chunk-33ZLHH3I.js} +33 -23
- package/dist/chunk-33ZLHH3I.js.map +1 -0
- package/dist/index.cjs +32 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -11
- package/dist/index.d.ts +23 -11
- package/dist/index.js +1 -1
- package/dist/internal.cjs +32 -22
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-ML3Z6JBP.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -2600,16 +2600,18 @@ var Subscriptions = class {
|
|
|
2600
2600
|
* For billing processors that require buyer approval (e.g. PayPal), the
|
|
2601
2601
|
* response carries a `redirect_url` the customer must be sent to.
|
|
2602
2602
|
*/
|
|
2603
|
-
async createAndConfirm(params) {
|
|
2604
|
-
return this.request("POST", "/subscriptions", { body: params });
|
|
2603
|
+
async createAndConfirm(params, options) {
|
|
2604
|
+
return this.request("POST", "/subscriptions", { body: params, ...options });
|
|
2605
2605
|
}
|
|
2606
2606
|
/** Create a subscription without confirming it. `POST /subscriptions/create` */
|
|
2607
|
-
async create(params) {
|
|
2608
|
-
return this.request("POST", "/subscriptions/create", { body: params });
|
|
2607
|
+
async create(params, options) {
|
|
2608
|
+
return this.request("POST", "/subscriptions/create", { body: params, ...options });
|
|
2609
2609
|
}
|
|
2610
2610
|
/** Retrieve a subscription by ID. `GET /subscriptions/{subscriptionId}` */
|
|
2611
|
-
async retrieve(subscriptionId) {
|
|
2612
|
-
return this.request("GET", `/subscriptions/${encodeURIComponent(subscriptionId)}
|
|
2611
|
+
async retrieve(subscriptionId, options) {
|
|
2612
|
+
return this.request("GET", `/subscriptions/${encodeURIComponent(subscriptionId)}`, {
|
|
2613
|
+
...options
|
|
2614
|
+
});
|
|
2613
2615
|
}
|
|
2614
2616
|
/**
|
|
2615
2617
|
* Confirm a previously created subscription. `POST /subscriptions/{subscriptionId}/confirm`
|
|
@@ -2617,51 +2619,59 @@ var Subscriptions = class {
|
|
|
2617
2619
|
* Like {@link createAndConfirm}, the response may carry a `redirect_url` for
|
|
2618
2620
|
* processors that require buyer approval.
|
|
2619
2621
|
*/
|
|
2620
|
-
async confirm(subscriptionId, params) {
|
|
2622
|
+
async confirm(subscriptionId, params, options) {
|
|
2621
2623
|
return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/confirm`, {
|
|
2622
|
-
body: params
|
|
2624
|
+
body: params,
|
|
2625
|
+
...options
|
|
2623
2626
|
});
|
|
2624
2627
|
}
|
|
2625
2628
|
/** Update a subscription's plan/price. `PUT /subscriptions/{subscriptionId}/update` */
|
|
2626
|
-
async update(subscriptionId, params) {
|
|
2629
|
+
async update(subscriptionId, params, options) {
|
|
2627
2630
|
return this.request("PUT", `/subscriptions/${encodeURIComponent(subscriptionId)}/update`, {
|
|
2628
|
-
body: params
|
|
2631
|
+
body: params,
|
|
2632
|
+
...options
|
|
2629
2633
|
});
|
|
2630
2634
|
}
|
|
2631
2635
|
/** List subscriptions for the profile. `GET /subscriptions/list` */
|
|
2632
|
-
async list(params) {
|
|
2636
|
+
async list(params, options) {
|
|
2633
2637
|
return this.request("GET", "/subscriptions/list", {
|
|
2634
|
-
query: params
|
|
2638
|
+
query: params,
|
|
2639
|
+
...options
|
|
2635
2640
|
});
|
|
2636
2641
|
}
|
|
2637
2642
|
/** Estimate the cost of a subscription before creating it. `GET /subscriptions/estimate` */
|
|
2638
|
-
async getEstimate(params) {
|
|
2643
|
+
async getEstimate(params, options) {
|
|
2639
2644
|
return this.request("GET", "/subscriptions/estimate", {
|
|
2640
|
-
query: params
|
|
2645
|
+
query: params,
|
|
2646
|
+
...options
|
|
2641
2647
|
});
|
|
2642
2648
|
}
|
|
2643
2649
|
/** List purchasable subscription items (plans/addons). `GET /subscriptions/items` */
|
|
2644
|
-
async getItems(params) {
|
|
2650
|
+
async getItems(params, options) {
|
|
2645
2651
|
return this.request("GET", "/subscriptions/items", {
|
|
2646
|
-
query: params
|
|
2652
|
+
query: params,
|
|
2653
|
+
...options
|
|
2647
2654
|
});
|
|
2648
2655
|
}
|
|
2649
2656
|
/** Pause a subscription. `POST /subscriptions/{subscriptionId}/pause` */
|
|
2650
|
-
async pause(subscriptionId, params) {
|
|
2657
|
+
async pause(subscriptionId, params, options) {
|
|
2651
2658
|
return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/pause`, {
|
|
2652
|
-
body: params
|
|
2659
|
+
body: params,
|
|
2660
|
+
...options
|
|
2653
2661
|
});
|
|
2654
2662
|
}
|
|
2655
2663
|
/** Resume a paused subscription. `POST /subscriptions/{subscriptionId}/resume` */
|
|
2656
|
-
async resume(subscriptionId, params) {
|
|
2664
|
+
async resume(subscriptionId, params, options) {
|
|
2657
2665
|
return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/resume`, {
|
|
2658
|
-
body: params
|
|
2666
|
+
body: params,
|
|
2667
|
+
...options
|
|
2659
2668
|
});
|
|
2660
2669
|
}
|
|
2661
2670
|
/** Cancel a subscription. `POST /subscriptions/{subscriptionId}/cancel` */
|
|
2662
|
-
async cancel(subscriptionId, params) {
|
|
2671
|
+
async cancel(subscriptionId, params, options) {
|
|
2663
2672
|
return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/cancel`, {
|
|
2664
|
-
body: params
|
|
2673
|
+
body: params,
|
|
2674
|
+
...options
|
|
2665
2675
|
});
|
|
2666
2676
|
}
|
|
2667
2677
|
};
|