@delopay/sdk 0.222.0 → 0.226.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/{chunk-YI6NOPLG.js → chunk-ILCBRQSO.js} +116 -2
- package/dist/chunk-ILCBRQSO.js.map +1 -0
- package/dist/index.cjs +116 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +256 -9
- package/dist/index.d.ts +256 -9
- package/dist/index.js +3 -1
- package/dist/internal.cjs +193 -1
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +296 -3
- package/dist/internal.d.ts +296 -3
- package/dist/internal.js +80 -1
- package/dist/internal.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-YI6NOPLG.js.map +0 -1
package/dist/internal.cjs
CHANGED
|
@@ -44,6 +44,7 @@ __export(internal_exports, {
|
|
|
44
44
|
AvailabilityOverrides: () => AvailabilityOverrides,
|
|
45
45
|
BRANDING_EXPORT_FORMAT: () => BRANDING_EXPORT_FORMAT,
|
|
46
46
|
BRANDING_EXPORT_VERSION: () => BRANDING_EXPORT_VERSION,
|
|
47
|
+
BuyerBlocklist: () => BuyerBlocklist,
|
|
47
48
|
CARD_FIELD_CHROMES: () => CARD_FIELD_CHROMES,
|
|
48
49
|
CARD_FIELD_FONT_SIZES: () => CARD_FIELD_FONT_SIZES,
|
|
49
50
|
CARD_FIELD_WEIGHTS: () => CARD_FIELD_WEIGHTS,
|
|
@@ -4439,6 +4440,11 @@ var Users = class {
|
|
|
4439
4440
|
* parent-groups shape: `[{role_id, role_name, entity_type, role_scope,
|
|
4440
4441
|
* parent_groups: [{name, description, scopes}]}]`; without it, the
|
|
4441
4442
|
* deprecated flat `groups` shape.
|
|
4443
|
+
*
|
|
4444
|
+
* Each role carries `managed_centrally: true` when it is a shared role the
|
|
4445
|
+
* platform offers this merchant: it can be assigned, but `updateRole`,
|
|
4446
|
+
* `deleteRole` and `updateRoleConnectors` refuse it with `UR_71`
|
|
4447
|
+
* (`data.reason: 'managed_centrally'`).
|
|
4442
4448
|
*/
|
|
4443
4449
|
async listRoles(params) {
|
|
4444
4450
|
if (params === void 0) {
|
|
@@ -5379,6 +5385,45 @@ var SellToRestrictions = class {
|
|
|
5379
5385
|
}
|
|
5380
5386
|
};
|
|
5381
5387
|
|
|
5388
|
+
// src/resources/buyerBlocklist.ts
|
|
5389
|
+
var BuyerBlocklist = class {
|
|
5390
|
+
constructor(request) {
|
|
5391
|
+
this.request = request;
|
|
5392
|
+
}
|
|
5393
|
+
/**
|
|
5394
|
+
* One page of blocked buyers, newest first, filtered by scope, kind and a
|
|
5395
|
+
* search over the value and the note. Expired entries are not listed.
|
|
5396
|
+
* `GET /buyer-blocklist`
|
|
5397
|
+
*/
|
|
5398
|
+
async list(params) {
|
|
5399
|
+
return this.request("GET", "/buyer-blocklist", {
|
|
5400
|
+
query: params
|
|
5401
|
+
});
|
|
5402
|
+
}
|
|
5403
|
+
/**
|
|
5404
|
+
* Block a buyer in one shop or, without `profile_id`, in every shop of the
|
|
5405
|
+
* merchant. The value is normalised as it is matched; a value already
|
|
5406
|
+
* blocked in that scope is refused. The change is recorded in the audit log
|
|
5407
|
+
* before it is made.
|
|
5408
|
+
* `POST /buyer-blocklist`
|
|
5409
|
+
*/
|
|
5410
|
+
async create(params) {
|
|
5411
|
+
return this.request("POST", "/buyer-blocklist", { body: params });
|
|
5412
|
+
}
|
|
5413
|
+
/**
|
|
5414
|
+
* Remove an entry, so the buyer can pay again. Payments the entry already
|
|
5415
|
+
* refused keep their status. The removal and the optional `reason` are
|
|
5416
|
+
* recorded in the audit log before it is made. The route requires a body,
|
|
5417
|
+
* so `{}` is sent when no reason is given.
|
|
5418
|
+
* `DELETE /buyer-blocklist/{entry_id}`
|
|
5419
|
+
*/
|
|
5420
|
+
async delete(entryId, params) {
|
|
5421
|
+
return this.request("DELETE", `/buyer-blocklist/${encodeURIComponent(entryId)}`, {
|
|
5422
|
+
body: params ?? {}
|
|
5423
|
+
});
|
|
5424
|
+
}
|
|
5425
|
+
};
|
|
5426
|
+
|
|
5382
5427
|
// src/resources/checkoutRecovery.ts
|
|
5383
5428
|
var CheckoutRecovery = class {
|
|
5384
5429
|
constructor(request) {
|
|
@@ -8026,6 +8071,7 @@ var Delopay = class {
|
|
|
8026
8071
|
this.regions = new Regions(request);
|
|
8027
8072
|
this.availabilityOverrides = new AvailabilityOverrides(request);
|
|
8028
8073
|
this.sellToRestrictions = new SellToRestrictions(request);
|
|
8074
|
+
this.buyerBlocklist = new BuyerBlocklist(request);
|
|
8029
8075
|
this.checkoutRecovery = new CheckoutRecovery(request);
|
|
8030
8076
|
this.costRules = new CostRules(request);
|
|
8031
8077
|
this.externalRecords = new ExternalRecords(request);
|
|
@@ -9485,6 +9531,10 @@ var DEFAULT_BRANDING_BASE = {
|
|
|
9485
9531
|
nomupayApplePayButtonType: "pay",
|
|
9486
9532
|
nomupayGooglePayButtonColor: "auto",
|
|
9487
9533
|
nomupayGooglePayButtonType: "pay",
|
|
9534
|
+
micropaymentFieldChrome: "outlined",
|
|
9535
|
+
micropaymentFieldFontSize: "md",
|
|
9536
|
+
micropaymentFieldWeight: "regular",
|
|
9537
|
+
micropaymentFocusRing: "strong",
|
|
9488
9538
|
customCss: ""
|
|
9489
9539
|
};
|
|
9490
9540
|
var DEFAULT_BRANDING = {
|
|
@@ -10407,6 +10457,26 @@ function decodeBranding(source) {
|
|
|
10407
10457
|
CARD_FOCUS_RINGS,
|
|
10408
10458
|
DEFAULT_BRANDING.mollieFocusRing
|
|
10409
10459
|
),
|
|
10460
|
+
micropaymentFieldChrome: pickEnum(
|
|
10461
|
+
extras["micropaymentFieldChrome"],
|
|
10462
|
+
CARD_FIELD_CHROMES,
|
|
10463
|
+
DEFAULT_BRANDING.micropaymentFieldChrome
|
|
10464
|
+
),
|
|
10465
|
+
micropaymentFieldFontSize: pickEnum(
|
|
10466
|
+
extras["micropaymentFieldFontSize"],
|
|
10467
|
+
CARD_FIELD_FONT_SIZES,
|
|
10468
|
+
DEFAULT_BRANDING.micropaymentFieldFontSize
|
|
10469
|
+
),
|
|
10470
|
+
micropaymentFieldWeight: pickEnum(
|
|
10471
|
+
extras["micropaymentFieldWeight"],
|
|
10472
|
+
CARD_FIELD_WEIGHTS,
|
|
10473
|
+
DEFAULT_BRANDING.micropaymentFieldWeight
|
|
10474
|
+
),
|
|
10475
|
+
micropaymentFocusRing: pickEnum(
|
|
10476
|
+
extras["micropaymentFocusRing"],
|
|
10477
|
+
CARD_FOCUS_RINGS,
|
|
10478
|
+
DEFAULT_BRANDING.micropaymentFocusRing
|
|
10479
|
+
),
|
|
10410
10480
|
paypalValidTint: parseBool(extras["paypalValidTint"], DEFAULT_BRANDING.paypalValidTint),
|
|
10411
10481
|
nomupayFormStyle: pickEnum(
|
|
10412
10482
|
extras["nomupayFormStyle"],
|
|
@@ -10550,6 +10620,10 @@ function encodeBranding(branding, base) {
|
|
|
10550
10620
|
mollieFieldWeight: branding.mollieFieldWeight,
|
|
10551
10621
|
paypalFocusRing: branding.paypalFocusRing,
|
|
10552
10622
|
mollieFocusRing: branding.mollieFocusRing,
|
|
10623
|
+
micropaymentFieldChrome: branding.micropaymentFieldChrome,
|
|
10624
|
+
micropaymentFieldFontSize: branding.micropaymentFieldFontSize,
|
|
10625
|
+
micropaymentFieldWeight: branding.micropaymentFieldWeight,
|
|
10626
|
+
micropaymentFocusRing: branding.micropaymentFocusRing,
|
|
10553
10627
|
paypalValidTint: String(branding.paypalValidTint),
|
|
10554
10628
|
nomupayFormStyle: branding.nomupayFormStyle,
|
|
10555
10629
|
nomupayShowLabels: String(branding.nomupayShowLabels),
|
|
@@ -10937,6 +11011,26 @@ function parseImportedBranding(raw) {
|
|
|
10937
11011
|
CARD_FOCUS_RINGS,
|
|
10938
11012
|
dflt.mollieFocusRing
|
|
10939
11013
|
),
|
|
11014
|
+
micropaymentFieldChrome: pickEnum(
|
|
11015
|
+
root["micropaymentFieldChrome"],
|
|
11016
|
+
CARD_FIELD_CHROMES,
|
|
11017
|
+
dflt.micropaymentFieldChrome
|
|
11018
|
+
),
|
|
11019
|
+
micropaymentFieldFontSize: pickEnum(
|
|
11020
|
+
root["micropaymentFieldFontSize"],
|
|
11021
|
+
CARD_FIELD_FONT_SIZES,
|
|
11022
|
+
dflt.micropaymentFieldFontSize
|
|
11023
|
+
),
|
|
11024
|
+
micropaymentFieldWeight: pickEnum(
|
|
11025
|
+
root["micropaymentFieldWeight"],
|
|
11026
|
+
CARD_FIELD_WEIGHTS,
|
|
11027
|
+
dflt.micropaymentFieldWeight
|
|
11028
|
+
),
|
|
11029
|
+
micropaymentFocusRing: pickEnum(
|
|
11030
|
+
root["micropaymentFocusRing"],
|
|
11031
|
+
CARD_FOCUS_RINGS,
|
|
11032
|
+
dflt.micropaymentFocusRing
|
|
11033
|
+
),
|
|
10940
11034
|
paypalValidTint: parseBool(root["paypalValidTint"], dflt.paypalValidTint),
|
|
10941
11035
|
nomupayFormStyle: pickEnum(
|
|
10942
11036
|
root["nomupayFormStyle"],
|
|
@@ -11484,6 +11578,24 @@ var CheckoutSession = class {
|
|
|
11484
11578
|
headers: this.bearerHeaders(options?.headers)
|
|
11485
11579
|
});
|
|
11486
11580
|
}
|
|
11581
|
+
/**
|
|
11582
|
+
* Mint the security-code form for a saved card, on a shop whose vault keeps
|
|
11583
|
+
* the code itself (Enigma Vault). The buyer re-enters the code into the
|
|
11584
|
+
* vault's own form, so it never reaches the checkout; confirm with the saved
|
|
11585
|
+
* card's `payment_token` once the form reports it stored.
|
|
11586
|
+
*
|
|
11587
|
+
* `paymentToken` is the saved card's token from the payment-method list. A
|
|
11588
|
+
* VGS shop answers `400`: VGS re-collects the code with Collect.
|
|
11589
|
+
*
|
|
11590
|
+
* `GET /payment-link/{merchantId}/{paymentId}/vault/security-code-session`
|
|
11591
|
+
*/
|
|
11592
|
+
async vaultSecurityCodeSession(paymentToken, options) {
|
|
11593
|
+
return this.client.request("GET", `${this.linkBase}/vault/security-code-session`, {
|
|
11594
|
+
...options,
|
|
11595
|
+
query: { payment_token: paymentToken },
|
|
11596
|
+
headers: this.bearerHeaders(options?.headers)
|
|
11597
|
+
});
|
|
11598
|
+
}
|
|
11487
11599
|
/**
|
|
11488
11600
|
* Register the aliased card as a payment method and mint the one-shot
|
|
11489
11601
|
* `payment_token` the confirm call spends.
|
|
@@ -11510,7 +11622,9 @@ var CheckoutSession = class {
|
|
|
11510
11622
|
*
|
|
11511
11623
|
* The router judges the card's issuing country and the buyer's IP country
|
|
11512
11624
|
* against the shop's sell-to restrictions before Stripe authorises, and a
|
|
11513
|
-
* refusal throws a `DelopayError` with code `DE_10`.
|
|
11625
|
+
* refusal throws a `DelopayError` with code `DE_10`. A buyer on the
|
|
11626
|
+
* merchant's buyer blocklist is refused before any Stripe call with code
|
|
11627
|
+
* `DE_14` (`buyer_blocked`, 422), which names no entry. When the answer's
|
|
11514
11628
|
* `status` is `requires_action`, run `stripe.handleNextAction` with its
|
|
11515
11629
|
* `client_secret` — safe, because the intent is `confirmation_method=manual`
|
|
11516
11630
|
* and that secret confirms nothing without the secret key — then call this
|
|
@@ -12156,6 +12270,83 @@ var AdminPortal = class {
|
|
|
12156
12270
|
}
|
|
12157
12271
|
);
|
|
12158
12272
|
}
|
|
12273
|
+
/**
|
|
12274
|
+
* The deployment's merchant roles: shared roles, the roles defined in code,
|
|
12275
|
+
* and every merchant's own custom roles. `GET /admin-portal/merchant-roles`
|
|
12276
|
+
*/
|
|
12277
|
+
async listSharedRoles() {
|
|
12278
|
+
return this.request("GET", "/admin-portal/merchant-roles");
|
|
12279
|
+
}
|
|
12280
|
+
/** `GET /admin-portal/merchant-roles/{roleId}` */
|
|
12281
|
+
async getSharedRole(roleId) {
|
|
12282
|
+
return this.request("GET", `/admin-portal/merchant-roles/${encodeURIComponent(roleId)}`);
|
|
12283
|
+
}
|
|
12284
|
+
/**
|
|
12285
|
+
* Define a role once and offer it to every merchant, or to the ones listed.
|
|
12286
|
+
* Offering never assigns it. `POST /admin-portal/merchant-roles`
|
|
12287
|
+
*/
|
|
12288
|
+
async createSharedRole(body) {
|
|
12289
|
+
return this.request("POST", "/admin-portal/merchant-roles", { body });
|
|
12290
|
+
}
|
|
12291
|
+
/**
|
|
12292
|
+
* What a change would do, without writing anything. Apply it with
|
|
12293
|
+
* `updateSharedRole` and the `version` this returns.
|
|
12294
|
+
* `POST /admin-portal/merchant-roles/{roleId}/preview`
|
|
12295
|
+
*/
|
|
12296
|
+
async previewSharedRole(roleId, change) {
|
|
12297
|
+
return this.request(
|
|
12298
|
+
"POST",
|
|
12299
|
+
`/admin-portal/merchant-roles/${encodeURIComponent(roleId)}/preview`,
|
|
12300
|
+
{ body: change }
|
|
12301
|
+
);
|
|
12302
|
+
}
|
|
12303
|
+
/**
|
|
12304
|
+
* Apply a reviewed change. A change that takes access away needs
|
|
12305
|
+
* `acknowledge_sign_out` and signs out every holder.
|
|
12306
|
+
* `PUT /admin-portal/merchant-roles/{roleId}`
|
|
12307
|
+
*/
|
|
12308
|
+
async updateSharedRole(roleId, body) {
|
|
12309
|
+
return this.request("PUT", `/admin-portal/merchant-roles/${encodeURIComponent(roleId)}`, {
|
|
12310
|
+
body
|
|
12311
|
+
});
|
|
12312
|
+
}
|
|
12313
|
+
/** `POST /admin-portal/merchant-roles/{roleId}/retire/preview` */
|
|
12314
|
+
async previewRetireSharedRole(roleId, body = {}) {
|
|
12315
|
+
return this.request(
|
|
12316
|
+
"POST",
|
|
12317
|
+
`/admin-portal/merchant-roles/${encodeURIComponent(roleId)}/retire/preview`,
|
|
12318
|
+
{ body }
|
|
12319
|
+
);
|
|
12320
|
+
}
|
|
12321
|
+
/**
|
|
12322
|
+
* Retire a shared role, moving its holders to the replacement.
|
|
12323
|
+
* `POST /admin-portal/merchant-roles/{roleId}/retire`
|
|
12324
|
+
*/
|
|
12325
|
+
async retireSharedRole(roleId, body) {
|
|
12326
|
+
return this.request(
|
|
12327
|
+
"POST",
|
|
12328
|
+
`/admin-portal/merchant-roles/${encodeURIComponent(roleId)}/retire`,
|
|
12329
|
+
{ body }
|
|
12330
|
+
);
|
|
12331
|
+
}
|
|
12332
|
+
/**
|
|
12333
|
+
* Merchant-specific roles whose holders could move to this shared role, and
|
|
12334
|
+
* what each move would change. `GET /admin-portal/merchant-roles/{roleId}/consolidation`
|
|
12335
|
+
*/
|
|
12336
|
+
async sharedRoleConsolidationCandidates(roleId) {
|
|
12337
|
+
return this.request(
|
|
12338
|
+
"GET",
|
|
12339
|
+
`/admin-portal/merchant-roles/${encodeURIComponent(roleId)}/consolidation`
|
|
12340
|
+
);
|
|
12341
|
+
}
|
|
12342
|
+
/** `POST /admin-portal/merchant-roles/{roleId}/consolidate` */
|
|
12343
|
+
async consolidateIntoSharedRole(roleId, body) {
|
|
12344
|
+
return this.request(
|
|
12345
|
+
"POST",
|
|
12346
|
+
`/admin-portal/merchant-roles/${encodeURIComponent(roleId)}/consolidate`,
|
|
12347
|
+
{ body }
|
|
12348
|
+
);
|
|
12349
|
+
}
|
|
12159
12350
|
async listCustomers(params) {
|
|
12160
12351
|
return this.request("GET", "/admin-portal/customers", {
|
|
12161
12352
|
query: params
|
|
@@ -13597,6 +13788,7 @@ var DelopayInternal = class extends Delopay {
|
|
|
13597
13788
|
AvailabilityOverrides,
|
|
13598
13789
|
BRANDING_EXPORT_FORMAT,
|
|
13599
13790
|
BRANDING_EXPORT_VERSION,
|
|
13791
|
+
BuyerBlocklist,
|
|
13600
13792
|
CARD_FIELD_CHROMES,
|
|
13601
13793
|
CARD_FIELD_FONT_SIZES,
|
|
13602
13794
|
CARD_FIELD_WEIGHTS,
|