@delopay/sdk 0.337.0 → 0.342.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.
@@ -2679,6 +2679,21 @@ var Payments = class {
2679
2679
  if (Object.keys(query).length === 0) return this.request("GET", path);
2680
2680
  return this.request("GET", path, { query });
2681
2681
  }
2682
+ /**
2683
+ * The payment's buyer risk evaluations, newest first (at most 50): each
2684
+ * one's score from 0 to 100, its band, the action the merchant's model asks
2685
+ * for that band and the action that was taken, the signals that fired with
2686
+ * the points each added, and the model version it was scored with.
2687
+ *
2688
+ * A payment is scored at every confirm that is about to reach a processor;
2689
+ * a payment never scored answers an empty list. A caller scoped to one shop
2690
+ * reads only that shop's payments.
2691
+ *
2692
+ * `GET /payments/{paymentId}/buyer-risk`
2693
+ */
2694
+ async buyerRisk(paymentId, options) {
2695
+ return this.request("GET", `/payments/${encodeURIComponent(paymentId)}/buyer-risk`, options);
2696
+ }
2682
2697
  /** Product names and prices as frozen when the payment was created. */
2683
2698
  async productLines(paymentId) {
2684
2699
  return this.request("GET", `/payments/${encodeURIComponent(paymentId)}/lines`);
@@ -2842,6 +2857,12 @@ var Payments = class {
2842
2857
  * @param paymentId - The payment intent ID to confirm.
2843
2858
  * @param params - Confirmation parameters (payment method data, return URL, etc.).
2844
2859
  * @returns The updated payment intent.
2860
+ *
2861
+ * A buyer the merchant's buyer risk model refuses fails before any processor
2862
+ * is called, with a `DelopayError` of code `DE_23` (`buyer_risk_refused`,
2863
+ * HTTP 422). The error does not say which signal fired; read the evaluation
2864
+ * with {@link Payments.buyerRisk}. A shop whose payments are switched off is
2865
+ * refused with `DE_21`.
2845
2866
  */
2846
2867
  async confirm(paymentId, params) {
2847
2868
  return this.request("POST", `/payments/${encodeURIComponent(paymentId)}/confirm`, {
@@ -3373,6 +3394,31 @@ var Profiles = class {
3373
3394
  { body: { is_archived: false } }
3374
3395
  );
3375
3396
  }
3397
+ /**
3398
+ * Switch a shop's payments off. While they are off the shop takes no new
3399
+ * payment: creating one, and confirming one no provider holds yet, is
3400
+ * refused with `DE_21`, and its hosted checkout does not render. A payment a
3401
+ * provider already holds is finished; refunds and disputes are unaffected.
3402
+ * Needs the `ShopPaymentsSwitch` area's `Write` and a signed-in user.
3403
+ * Repeating the same state is safe.
3404
+ *
3405
+ * `PUT /account/{accountId}/business-profile/{profileId}/payments-switch`
3406
+ */
3407
+ async disablePayments(accountId, profileId) {
3408
+ return this.request(
3409
+ "PUT",
3410
+ `/account/${encodeURIComponent(accountId)}/business-profile/${encodeURIComponent(profileId)}/payments-switch`,
3411
+ { body: { payments_disabled: true } }
3412
+ );
3413
+ }
3414
+ /** Switch a shop's payments on again after {@link Profiles.disablePayments}. */
3415
+ async enablePayments(accountId, profileId) {
3416
+ return this.request(
3417
+ "PUT",
3418
+ `/account/${encodeURIComponent(accountId)}/business-profile/${encodeURIComponent(profileId)}/payments-switch`,
3419
+ { body: { payments_disabled: false } }
3420
+ );
3421
+ }
3376
3422
  /** Archived shop identities in the caller's merchant and shop-read scope. */
3377
3423
  async listArchived(accountId) {
3378
3424
  return this.request(
@@ -4033,6 +4079,20 @@ var Routing = class {
4033
4079
  body: params
4034
4080
  });
4035
4081
  }
4082
+ /**
4083
+ * Reset one limit's usage for the window open now: what settled payments
4084
+ * spent stops counting, so the account takes payments again. Payments still
4085
+ * in flight keep their hold and count once they complete. The account's
4086
+ * other limit is untouched. Offered by a router that lists `usage_reset` in
4087
+ * `features`; refused (422) for an account with no limit in that unit.
4088
+ *
4089
+ * `POST /routing/connector-caps/{profileId}/reset`
4090
+ */
4091
+ async resetConnectorCapUsage(profileId, params) {
4092
+ return this.request("POST", `/routing/connector-caps/${encodeURIComponent(profileId)}/reset`, {
4093
+ body: params
4094
+ });
4095
+ }
4036
4096
  /**
4037
4097
  * List all routing algorithms for the current merchant.
4038
4098
  *
@@ -6571,12 +6631,44 @@ var BuyerBlocklist = class {
6571
6631
  /**
6572
6632
  * Block the buyer of a payment by the identifiers the payment carries:
6573
6633
  * its card (the Stripe fingerprint), email, IP, device or customer, in the
6574
- * payment's shop or in every shop.
6634
+ * payment's shop or in every shop. With `all_ips`, also every address the
6635
+ * buyer was seen paying from, one entry each, grouped under one
6636
+ * `group_id`; the answer then carries `ip_snapshot`.
6575
6637
  * `POST /buyer-blocklist/from-payment`
6576
6638
  */
6577
6639
  async createFromPayment(params) {
6578
6640
  return this.request("POST", "/buyer-blocklist/from-payment", { body: params });
6579
6641
  }
6642
+ /**
6643
+ * The addresses an "all IPs" block of a payment's buyer would take: the
6644
+ * payment's own, then those its device, email or card were seen at in the
6645
+ * last 90 days, newest first, at most 20. An address shared with two or
6646
+ * more other buyers is offered but not preselected. Writes nothing; needs
6647
+ * the same permissions as the block.
6648
+ * `POST /buyer-blocklist/from-payment/preview`
6649
+ */
6650
+ async previewFromPayment(params) {
6651
+ return this.request("POST", "/buyer-blocklist/from-payment/preview", { body: params });
6652
+ }
6653
+ /**
6654
+ * An entry's recorded refusals, newest first, with where each happened and
6655
+ * which identifier matched. A caller scoped to one shop reaches only its own
6656
+ * shop's entries.
6657
+ * `GET /buyer-blocklist/{entry_id}/events`
6658
+ */
6659
+ async listEvents(entryId, params) {
6660
+ return this.request("GET", `/buyer-blocklist/${encodeURIComponent(entryId)}/events`, {
6661
+ query: params
6662
+ });
6663
+ }
6664
+ /**
6665
+ * Which classes of network an `ip_class` entry can be judged by on this
6666
+ * deployment now, and by which sources.
6667
+ * `GET /buyer-blocklist/capabilities`
6668
+ */
6669
+ async capabilities() {
6670
+ return this.request("GET", "/buyer-blocklist/capabilities");
6671
+ }
6580
6672
  /**
6581
6673
  * Retry now every failed or pending Radar sync of an entry.
6582
6674
  * `POST /buyer-blocklist/{entry_id}/sync/retry`
@@ -14664,7 +14756,9 @@ var CheckoutSession = class {
14664
14756
  * The methods the buyer may pick for a subscription that waits for the
14665
14757
  * choice (`method_choice_pending`), judged for the buyer. Call it from the
14666
14758
  * buyer's browser: the sell-to country is read from this request's own
14667
- * connection. Authenticated with the subscription's client secret.
14759
+ * connection. A cancelled subscription answers 400, and one that already
14760
+ * bills on an account answers 409 (`DE_20`). Authenticated with the
14761
+ * subscription's client secret.
14668
14762
  *
14669
14763
  * `GET /subscriptions/method-options/{merchantId}/{subscriptionId}`
14670
14764
  */
@@ -14684,8 +14778,11 @@ var CheckoutSession = class {
14684
14778
  * again from this request; afterwards
14685
14779
  * {@link CheckoutSession.fetchSubscriptionData} describes the bound
14686
14780
  * subscription (Stripe's Payment Element for `card`, `confirmSubscription`
14687
- * for the others). A subscription that no longer waits answers 409
14688
- * (`DE_20`). Authenticated with the subscription's client secret.
14781
+ * for the others). Picking the same method again answers the bound
14782
+ * subscription. A subscription bound to another method already, or whose
14783
+ * billing account changed meanwhile, answers 409 (`DE_20`); a method not
14784
+ * offered to this buyer, or a cancelled subscription, answers 400.
14785
+ * Authenticated with the subscription's client secret.
14689
14786
  *
14690
14787
  * `POST /subscriptions/select-method/{merchantId}/{subscriptionId}`
14691
14788
  */
@@ -14975,7 +15072,8 @@ var CheckoutSession = class {
14975
15072
  * competing flow receives `false` and must reload; an unresolved provider
14976
15073
  * outcome stays reserved, regardless of elapsed time. A buyer-blocklist
14977
15074
  * refusal throws a `DelopayError` with code `DE_14`; a shop whose payments
14978
- * DeloPay stopped is refused with `DE_22`.
15075
+ * DeloPay stopped is refused with `DE_22`, and a shop whose payments the
15076
+ * merchant switched off with `DE_21`.
14979
15077
  *
14980
15078
  * `POST /payment-link/{merchantId}/{paymentId}/browser-card-claim`
14981
15079
  */
@@ -15001,8 +15099,11 @@ var CheckoutSession = class {
15001
15099
  * against the shop's sell-to restrictions before Stripe authorises, and a
15002
15100
  * refusal throws a `DelopayError` with code `DE_10`. A buyer on the
15003
15101
  * merchant's buyer blocklist is refused before any Stripe call with code
15004
- * `DE_14` (`buyer_blocked`, 422), which names no entry, and a shop whose
15005
- * payments DeloPay stopped with `DE_22`. When the answer's
15102
+ * `DE_14` (`buyer_blocked`, 422), which names no entry, a shop whose
15103
+ * payments DeloPay stopped with `DE_22`, and a shop whose payments the
15104
+ * merchant switched off with `DE_21`. A buyer the merchant's buyer risk
15105
+ * model refuses fails with `DE_23` (`buyer_risk_refused`, 422), which says
15106
+ * nothing about the signals. When the answer's
15006
15107
  * `status` is `requires_action`, run `stripe.handleNextAction` with its
15007
15108
  * `client_secret` — safe, because the intent is `confirmation_method=manual`
15008
15109
  * and that secret confirms nothing without the secret key — then call this
@@ -16149,4 +16250,4 @@ export {
16149
16250
  decodeNativePanes,
16150
16251
  encodeNativePanes
16151
16252
  };
16152
- //# sourceMappingURL=chunk-EPN4ZOGA.js.map
16253
+ //# sourceMappingURL=chunk-FAIETNTW.js.map