@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.
@@ -4328,6 +4328,66 @@ var AvailabilityOverrides = class {
4328
4328
  }
4329
4329
  };
4330
4330
 
4331
+ // src/resources/sellToRestrictions.ts
4332
+ var SellToRestrictions = class {
4333
+ constructor(request) {
4334
+ this.request = request;
4335
+ }
4336
+ /**
4337
+ * The merchant-wide policy and every shop's effective policy. A caller
4338
+ * scoped to one shop receives that shop alone, and no merchant-wide policy.
4339
+ * `GET /sell-to-restrictions`
4340
+ */
4341
+ async retrieve() {
4342
+ return this.request("GET", "/sell-to-restrictions");
4343
+ }
4344
+ /**
4345
+ * Replace the merchant-wide policy every shop without an override inherits.
4346
+ * The change is recorded in the audit log before it is made.
4347
+ * `PUT /sell-to-restrictions/merchant`
4348
+ */
4349
+ async updateMerchantPolicy(params) {
4350
+ return this.request("PUT", "/sell-to-restrictions/merchant", { body: params });
4351
+ }
4352
+ /**
4353
+ * Give one shop its own policy, replacing the merchant-wide policy for that
4354
+ * shop. An empty `blocked_countries` lifts every restriction for it.
4355
+ * `PUT /sell-to-restrictions/shops/{profile_id}`
4356
+ */
4357
+ async updateShopOverride(profileId, params) {
4358
+ return this.request("PUT", `/sell-to-restrictions/shops/${encodeURIComponent(profileId)}`, {
4359
+ body: params
4360
+ });
4361
+ }
4362
+ /**
4363
+ * Remove one shop's override, so it inherits the merchant-wide policy again.
4364
+ * Removing an override the shop does not have changes nothing.
4365
+ * `DELETE /sell-to-restrictions/shops/{profile_id}`
4366
+ */
4367
+ async deleteShopOverride(profileId) {
4368
+ return this.request("DELETE", `/sell-to-restrictions/shops/${encodeURIComponent(profileId)}`);
4369
+ }
4370
+ /**
4371
+ * Which checks each payment path performs, and how this deployment resolves
4372
+ * a buyer's country — read before relying on a restriction for a path.
4373
+ * `GET /sell-to-restrictions/capabilities`
4374
+ */
4375
+ async capabilities() {
4376
+ return this.request("GET", "/sell-to-restrictions/capabilities");
4377
+ }
4378
+ /**
4379
+ * Why a payment was refused: where, by which signal, for which country and
4380
+ * under which policy. A shop-scoped caller sees only refusals in its shop.
4381
+ * `GET /sell-to-restrictions/payments/{payment_id}/decisions`
4382
+ */
4383
+ async listDecisions(paymentId) {
4384
+ return this.request(
4385
+ "GET",
4386
+ `/sell-to-restrictions/payments/${encodeURIComponent(paymentId)}/decisions`
4387
+ );
4388
+ }
4389
+ };
4390
+
4331
4391
  // src/resources/checkoutMethods.ts
4332
4392
  var CheckoutMethods = class {
4333
4393
  constructor(request) {
@@ -5247,6 +5307,7 @@ var Delopay = class {
5247
5307
  this.forex = new Forex(request);
5248
5308
  this.regions = new Regions(request);
5249
5309
  this.availabilityOverrides = new AvailabilityOverrides(request);
5310
+ this.sellToRestrictions = new SellToRestrictions(request);
5250
5311
  this.checkoutMethods = new CheckoutMethods(request);
5251
5312
  this.analytics = new Analytics(request);
5252
5313
  this.analyticsDashboard = new AnalyticsDashboard(request);
@@ -8209,6 +8270,27 @@ var CheckoutSession = class {
8209
8270
  headers: this.bearerHeaders(options?.headers)
8210
8271
  });
8211
8272
  }
8273
+ /**
8274
+ * Confirm the Stripe card form's PaymentIntent through the router, for a
8275
+ * checkout payload with `card_connector_server_confirm: true`. Stripe refuses
8276
+ * a Stripe.js confirm of such an intent.
8277
+ *
8278
+ * Send the ConfirmationToken the Payment Element (or Express Checkout
8279
+ * Element) produced. The router judges the card's issuing country and the
8280
+ * buyer's IP country against the shop's sell-to restrictions before Stripe
8281
+ * authorises, and a refusal throws a `DelopayError` with code `DE_10`. When
8282
+ * the answer's `status` is `requires_action`, run `stripe.handleNextAction`
8283
+ * with its `client_secret`, then call this again without a token to finalize.
8284
+ *
8285
+ * `POST /payment-link/{merchantId}/{paymentId}/stripe-confirm`
8286
+ */
8287
+ async confirmStripeCardForm(params, options) {
8288
+ return this.client.request("POST", `${this.linkBase}/stripe-confirm`, {
8289
+ body: params,
8290
+ ...options,
8291
+ headers: this.bearerHeaders(options?.headers)
8292
+ });
8293
+ }
8212
8294
  /**
8213
8295
  * The payment's current state — status polling for redirect/popup rails.
8214
8296
  *
@@ -8738,6 +8820,7 @@ export {
8738
8820
  Forex,
8739
8821
  Regions,
8740
8822
  AvailabilityOverrides,
8823
+ SellToRestrictions,
8741
8824
  CheckoutMethods,
8742
8825
  Subscriptions,
8743
8826
  Audit,
@@ -8916,4 +8999,4 @@ export {
8916
8999
  decodeNativePanes,
8917
9000
  encodeNativePanes
8918
9001
  };
8919
- //# sourceMappingURL=chunk-IJN66KOR.js.map
9002
+ //# sourceMappingURL=chunk-4YLUV3YJ.js.map