@commet/node 7.1.0 → 7.2.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.d.mts +110 -5
- package/dist/index.d.ts +110 -5
- package/dist/index.js +55 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +55 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -200,6 +200,35 @@ var InvoicesResource = class {
|
|
|
200
200
|
}
|
|
201
201
|
};
|
|
202
202
|
|
|
203
|
+
// src/resources/payments.ts
|
|
204
|
+
var PaymentsResource = class {
|
|
205
|
+
constructor(httpClient) {
|
|
206
|
+
this.httpClient = httpClient;
|
|
207
|
+
}
|
|
208
|
+
/** List payments with cursor-based pagination. Filter by customer. */
|
|
209
|
+
async list(params, options) {
|
|
210
|
+
return this.httpClient.get("/payments", params, options);
|
|
211
|
+
}
|
|
212
|
+
/** Create a hosted payment link. Returns a url the customer opens to pay with any card. Calculates tax, generates an invoice, and vaults the payment method on confirmation. No subscription or plan required. */
|
|
213
|
+
async create(params, options) {
|
|
214
|
+
return this.httpClient.post("/payments", params, options);
|
|
215
|
+
}
|
|
216
|
+
/** Charge a customer's vaulted payment method off-session. Calculates tax, generates an invoice, and sends a receipt. No subscription or plan required. */
|
|
217
|
+
async charge(params, options) {
|
|
218
|
+
return this.httpClient.post("/payments/charge", params, options);
|
|
219
|
+
}
|
|
220
|
+
/** Retrieve a payment by its public ID. */
|
|
221
|
+
async get(params, options) {
|
|
222
|
+
const { id } = params;
|
|
223
|
+
return this.httpClient.get(`/payments/${id}`, void 0, options);
|
|
224
|
+
}
|
|
225
|
+
/** Cancel a pending payment link so it can no longer be paid. Only a link that has not been paid or started processing can be canceled; canceling an already canceled link is a no-op. Charges cannot be canceled. */
|
|
226
|
+
async cancel(params, options) {
|
|
227
|
+
const { id } = params;
|
|
228
|
+
return this.httpClient.post(`/payments/${id}/cancel`, {}, options);
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
|
|
203
232
|
// src/resources/payouts.ts
|
|
204
233
|
var PayoutsResource = class {
|
|
205
234
|
constructor(httpClient) {
|
|
@@ -507,6 +536,29 @@ var SubscriptionsResource = class {
|
|
|
507
536
|
const { id } = params;
|
|
508
537
|
return this.httpClient.post(`/subscriptions/${id}/uncancel`, {}, options);
|
|
509
538
|
}
|
|
539
|
+
/** Retries the outstanding renewal charge for a past_due subscription. On a successful charge the subscription recovers to active and a payment.recovered webhook is delivered; a declined charge returns an error and the subscription stays past_due. */
|
|
540
|
+
async reactivate(params, options) {
|
|
541
|
+
const { id } = params;
|
|
542
|
+
return this.httpClient.post(`/subscriptions/${id}/reactivate`, {}, options);
|
|
543
|
+
}
|
|
544
|
+
/** Generates a hosted, signed recovery link that lets the customer pay the outstanding renewal charge for a past_due subscription. Unlike reactivate, which charges server-to-server, this returns a link the merchant can deliver through their own email, SMS, or dashboard. The link carries a self-contained signed token and stays valid until the charge is paid or the subscription is no longer past due. */
|
|
545
|
+
async createRecoveryLink(params, options) {
|
|
546
|
+
const { id } = params;
|
|
547
|
+
return this.httpClient.post(
|
|
548
|
+
`/subscriptions/${id}/recovery-link`,
|
|
549
|
+
{},
|
|
550
|
+
options
|
|
551
|
+
);
|
|
552
|
+
}
|
|
553
|
+
/** Creates a hosted checkout session for the customer to update the subscription's default payment method. */
|
|
554
|
+
async updatePaymentMethod(params, options) {
|
|
555
|
+
const { id, ...rest } = params;
|
|
556
|
+
return this.httpClient.post(
|
|
557
|
+
`/subscriptions/${id}/payment-method/update`,
|
|
558
|
+
rest,
|
|
559
|
+
options
|
|
560
|
+
);
|
|
561
|
+
}
|
|
510
562
|
/** Upgrade, downgrade, or change billing interval. */
|
|
511
563
|
async changePlan(params, options) {
|
|
512
564
|
const { id, ...rest } = params;
|
|
@@ -602,7 +654,7 @@ var TransactionsResource = class {
|
|
|
602
654
|
const { id } = params;
|
|
603
655
|
return this.httpClient.post(`/transactions/${id}/refund`, {}, options);
|
|
604
656
|
}
|
|
605
|
-
/** Retry a failed
|
|
657
|
+
/** Retry a failed subscription renewal. Re-charges the outstanding renewal invoice through the recovery engine. */
|
|
606
658
|
async retry(params, options) {
|
|
607
659
|
const { id } = params;
|
|
608
660
|
return this.httpClient.post(`/transactions/${id}/retry`, {}, options);
|
|
@@ -619,6 +671,7 @@ var GeneratedResources = class {
|
|
|
619
671
|
this.featureAccess = new FeatureAccessResource(http);
|
|
620
672
|
this.features = new FeaturesResource(http);
|
|
621
673
|
this.invoices = new InvoicesResource(http);
|
|
674
|
+
this.payments = new PaymentsResource(http);
|
|
622
675
|
this.payouts = new PayoutsResource(http);
|
|
623
676
|
this.planGroups = new PlanGroupsResource(http);
|
|
624
677
|
this.plans = new PlansResource(http);
|
|
@@ -764,7 +817,7 @@ var CommetValidationError = class extends CommetError {
|
|
|
764
817
|
|
|
765
818
|
// src/version.ts
|
|
766
819
|
var API_VERSION = "2026-06-10";
|
|
767
|
-
var SDK_VERSION = "7.
|
|
820
|
+
var SDK_VERSION = "7.2.0";
|
|
768
821
|
|
|
769
822
|
// src/utils/telemetry.ts
|
|
770
823
|
var registeredIntegrations = /* @__PURE__ */ new Set();
|