@delopay/sdk 0.156.0 → 0.158.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.cjs CHANGED
@@ -111,6 +111,7 @@ __export(index_exports, {
111
111
  SURCHARGE_STYLES: () => SURCHARGE_STYLES,
112
112
  SURCHARGE_WEIGHTS: () => SURCHARGE_WEIGHTS,
113
113
  Search: () => Search,
114
+ SellToRestrictions: () => SellToRestrictions,
114
115
  Settlement: () => Settlement,
115
116
  Subscriptions: () => Subscriptions,
116
117
  UNKNOWN_SECTION_ORDER: () => UNKNOWN_SECTION_ORDER,
@@ -4546,6 +4547,66 @@ var AvailabilityOverrides = class {
4546
4547
  }
4547
4548
  };
4548
4549
 
4550
+ // src/resources/sellToRestrictions.ts
4551
+ var SellToRestrictions = class {
4552
+ constructor(request) {
4553
+ this.request = request;
4554
+ }
4555
+ /**
4556
+ * The merchant-wide policy and every shop's effective policy. A caller
4557
+ * scoped to one shop receives that shop alone, and no merchant-wide policy.
4558
+ * `GET /sell-to-restrictions`
4559
+ */
4560
+ async retrieve() {
4561
+ return this.request("GET", "/sell-to-restrictions");
4562
+ }
4563
+ /**
4564
+ * Replace the merchant-wide policy every shop without an override inherits.
4565
+ * The change is recorded in the audit log before it is made.
4566
+ * `PUT /sell-to-restrictions/merchant`
4567
+ */
4568
+ async updateMerchantPolicy(params) {
4569
+ return this.request("PUT", "/sell-to-restrictions/merchant", { body: params });
4570
+ }
4571
+ /**
4572
+ * Give one shop its own policy, replacing the merchant-wide policy for that
4573
+ * shop. An empty `blocked_countries` lifts every restriction for it.
4574
+ * `PUT /sell-to-restrictions/shops/{profile_id}`
4575
+ */
4576
+ async updateShopOverride(profileId, params) {
4577
+ return this.request("PUT", `/sell-to-restrictions/shops/${encodeURIComponent(profileId)}`, {
4578
+ body: params
4579
+ });
4580
+ }
4581
+ /**
4582
+ * Remove one shop's override, so it inherits the merchant-wide policy again.
4583
+ * Removing an override the shop does not have changes nothing.
4584
+ * `DELETE /sell-to-restrictions/shops/{profile_id}`
4585
+ */
4586
+ async deleteShopOverride(profileId) {
4587
+ return this.request("DELETE", `/sell-to-restrictions/shops/${encodeURIComponent(profileId)}`);
4588
+ }
4589
+ /**
4590
+ * Which checks each payment path performs, and how this deployment resolves
4591
+ * a buyer's country — read before relying on a restriction for a path.
4592
+ * `GET /sell-to-restrictions/capabilities`
4593
+ */
4594
+ async capabilities() {
4595
+ return this.request("GET", "/sell-to-restrictions/capabilities");
4596
+ }
4597
+ /**
4598
+ * Why a payment was refused: where, by which signal, for which country and
4599
+ * under which policy. A shop-scoped caller sees only refusals in its shop.
4600
+ * `GET /sell-to-restrictions/payments/{payment_id}/decisions`
4601
+ */
4602
+ async listDecisions(paymentId) {
4603
+ return this.request(
4604
+ "GET",
4605
+ `/sell-to-restrictions/payments/${encodeURIComponent(paymentId)}/decisions`
4606
+ );
4607
+ }
4608
+ };
4609
+
4549
4610
  // src/resources/checkoutMethods.ts
4550
4611
  var CheckoutMethods = class {
4551
4612
  constructor(request) {
@@ -5465,6 +5526,7 @@ var Delopay = class {
5465
5526
  this.forex = new Forex(request);
5466
5527
  this.regions = new Regions(request);
5467
5528
  this.availabilityOverrides = new AvailabilityOverrides(request);
5529
+ this.sellToRestrictions = new SellToRestrictions(request);
5468
5530
  this.checkoutMethods = new CheckoutMethods(request);
5469
5531
  this.analytics = new Analytics(request);
5470
5532
  this.analyticsDashboard = new AnalyticsDashboard(request);
@@ -8427,6 +8489,27 @@ var CheckoutSession = class {
8427
8489
  headers: this.bearerHeaders(options?.headers)
8428
8490
  });
8429
8491
  }
8492
+ /**
8493
+ * Confirm the Stripe card form's PaymentIntent through the router, for a
8494
+ * checkout payload with `card_connector_server_confirm: true`. Stripe refuses
8495
+ * a Stripe.js confirm of such an intent.
8496
+ *
8497
+ * Send the ConfirmationToken the Payment Element (or Express Checkout
8498
+ * Element) produced. The router judges the card's issuing country and the
8499
+ * buyer's IP country against the shop's sell-to restrictions before Stripe
8500
+ * authorises, and a refusal throws a `DelopayError` with code `DE_10`. When
8501
+ * the answer's `status` is `requires_action`, run `stripe.handleNextAction`
8502
+ * with its `client_secret`, then call this again without a token to finalize.
8503
+ *
8504
+ * `POST /payment-link/{merchantId}/{paymentId}/stripe-confirm`
8505
+ */
8506
+ async confirmStripeCardForm(params, options) {
8507
+ return this.client.request("POST", `${this.linkBase}/stripe-confirm`, {
8508
+ body: params,
8509
+ ...options,
8510
+ headers: this.bearerHeaders(options?.headers)
8511
+ });
8512
+ }
8430
8513
  /**
8431
8514
  * The payment's current state — status polling for redirect/popup rails.
8432
8515
  *
@@ -9031,6 +9114,7 @@ var encodeNativePanes = encodePanes;
9031
9114
  SURCHARGE_STYLES,
9032
9115
  SURCHARGE_WEIGHTS,
9033
9116
  Search,
9117
+ SellToRestrictions,
9034
9118
  Settlement,
9035
9119
  Subscriptions,
9036
9120
  UNKNOWN_SECTION_ORDER,