@delopay/sdk 0.100.2 → 0.102.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.
@@ -2185,6 +2185,22 @@ var Routing = class {
2185
2185
  async deactivate(params = {}) {
2186
2186
  return this.request("POST", "/routing/deactivate", { body: params });
2187
2187
  }
2188
+ /**
2189
+ * Edit a static routing configuration.
2190
+ *
2191
+ * Partial: send only the fields to change. `name`/`description` are
2192
+ * metadata-only; `algorithm` is a wholesale rule replacement, validated
2193
+ * against the shop exactly as at create. `modified_at` is bumped either way.
2194
+ *
2195
+ * `PUT /routing/{algorithmId}`
2196
+ *
2197
+ * @param algorithmId - The routing algorithm ID to edit.
2198
+ * @param params - The fields to change (at least one required).
2199
+ * @returns The updated routing configuration including the algorithm body.
2200
+ */
2201
+ async update(algorithmId, params) {
2202
+ return this.request("PUT", `/routing/${encodeURIComponent(algorithmId)}`, { body: params });
2203
+ }
2188
2204
  /**
2189
2205
  * List all routing algorithms for the current merchant.
2190
2206
  *
@@ -3703,6 +3719,53 @@ var Subscriptions = class {
3703
3719
  async lookupPayments(params, options) {
3704
3720
  return this.request("POST", "/subscriptions/payments/lookup", { body: params, ...options });
3705
3721
  }
3722
+ /**
3723
+ * One subscription's billing history, newest cycle first.
3724
+ * `GET /subscriptions/{subscriptionId}/invoices`
3725
+ *
3726
+ * {@link retrieve} carries only the *latest* invoice, which is the current
3727
+ * cycle — a subscription that has renewed monthly for a year has one of those
3728
+ * and twelve of these. Use this wherever a merchant needs to see what a
3729
+ * subscription has actually billed, in particular on self-charging processors
3730
+ * (Creem, PayPal) where each renewal is charged by the processor and mirrored
3731
+ * here rather than raised as a DeloPay payment.
3732
+ *
3733
+ * Two things to render honestly, both decided rather than incidental:
3734
+ *
3735
+ * - `amount` is **gross** and `refunded_amount` sits beside it. Do not net
3736
+ * them: the difference between the two is not a smaller charge.
3737
+ * - A `refunded_amount` of `null` is "not reported" and must not render as
3738
+ * `0`. Likewise a processor-hosted origination records a bootstrap invoice
3739
+ * at `0` before the buyer has paid anything, so a zero amount on such a
3740
+ * subscription is a placeholder rather than a free cycle.
3741
+ *
3742
+ * Profile-scoped like every other subscription route.
3743
+ */
3744
+ async listInvoices(subscriptionId, params, options) {
3745
+ return this.request("GET", `/subscriptions/${encodeURIComponent(subscriptionId)}/invoices`, {
3746
+ query: params,
3747
+ ...options
3748
+ });
3749
+ }
3750
+ /**
3751
+ * Which billing processor this shop's subscriptions run on.
3752
+ * `GET /subscriptions/billing_processor`
3753
+ *
3754
+ * The same mapping is derivable from the connector inventory
3755
+ * (`GET /account/{merchant_id}/connectors`), but that route is gated by a
3756
+ * connector-read permission granted independently of subscriptions — so a
3757
+ * role authorised to create subscriptions could be unable to learn which
3758
+ * processor it was creating them on. This answers under the same
3759
+ * authorization as the rest of the subscription API.
3760
+ *
3761
+ * Reach for it when the client must branch on the processor *before* calling
3762
+ * — origination differs by processor, and guessing is destructive. Resolve
3763
+ * the shop's `billing_processor_id` first: a shop that runs no subscriptions
3764
+ * has none assigned, and this route has no identity to report for it.
3765
+ */
3766
+ async getBillingProcessor(options) {
3767
+ return this.request("GET", "/subscriptions/billing_processor", { ...options });
3768
+ }
3706
3769
  };
3707
3770
 
3708
3771
  // src/resources/settlement.ts
@@ -6174,4 +6237,4 @@ export {
6174
6237
  focusedCheckoutUrl,
6175
6238
  CHECKOUT_EVENT_KINDS
6176
6239
  };
6177
- //# sourceMappingURL=chunk-6ULG3SLG.js.map
6240
+ //# sourceMappingURL=chunk-43FRIBNT.js.map