@delopay/sdk 0.285.0 → 0.290.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-CEYQMVOJ.js → chunk-7QXWTMSG.js} +455 -4
- package/dist/chunk-7QXWTMSG.js.map +1 -0
- package/dist/{index-CkqlDJ_s.d.cts → index-CCxMFvNk.d.cts} +1129 -6
- package/dist/{index-CkqlDJ_s.d.ts → index-CCxMFvNk.d.ts} +1129 -6
- package/dist/index.cjs +459 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +11 -1
- package/dist/internal.cjs +515 -3
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +120 -4
- package/dist/internal.d.ts +120 -4
- package/dist/internal.js +66 -1
- package/dist/internal.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-CEYQMVOJ.js.map +0 -1
package/dist/internal.cjs
CHANGED
|
@@ -36,6 +36,7 @@ __export(internal_exports, {
|
|
|
36
36
|
APPLE_PAY_BUTTON_STYLES: () => APPLE_PAY_BUTTON_STYLES,
|
|
37
37
|
APPLE_PAY_BUTTON_TYPES: () => APPLE_PAY_BUTTON_TYPES,
|
|
38
38
|
Admin: () => Admin,
|
|
39
|
+
AdminBranding: () => AdminBranding,
|
|
39
40
|
AdminLive: () => AdminLive,
|
|
40
41
|
AdminPortal: () => AdminPortal,
|
|
41
42
|
Analytics: () => Analytics,
|
|
@@ -46,6 +47,7 @@ __export(internal_exports, {
|
|
|
46
47
|
BRANDING_EXPORT_FORMAT: () => BRANDING_EXPORT_FORMAT,
|
|
47
48
|
BRANDING_EXPORT_VERSION: () => BRANDING_EXPORT_VERSION,
|
|
48
49
|
BUILTIN_PAYMENT_ICON_KEYS: () => BUILTIN_PAYMENT_ICON_KEYS,
|
|
50
|
+
Branding: () => Branding,
|
|
49
51
|
BuyerBlocklist: () => BuyerBlocklist,
|
|
50
52
|
BuyerConversations: () => BuyerConversations,
|
|
51
53
|
BuyerEvidenceReviews: () => BuyerEvidenceReviews,
|
|
@@ -69,6 +71,7 @@ __export(internal_exports, {
|
|
|
69
71
|
CheckoutMethods: () => CheckoutMethods,
|
|
70
72
|
CheckoutRecovery: () => CheckoutRecovery,
|
|
71
73
|
CheckoutSession: () => CheckoutSession,
|
|
74
|
+
CheckoutTemplates: () => CheckoutTemplates,
|
|
72
75
|
Configs: () => Configs,
|
|
73
76
|
ConnectorRestrictionRules: () => ConnectorRestrictionRules,
|
|
74
77
|
ConnectorRestrictions: () => ConnectorRestrictions,
|
|
@@ -129,7 +132,9 @@ __export(internal_exports, {
|
|
|
129
132
|
PlatformSettings: () => PlatformSettings,
|
|
130
133
|
PresentationCache: () => PresentationCache,
|
|
131
134
|
ProcessorCosts: () => ProcessorCosts,
|
|
135
|
+
ProcessorImports: () => ProcessorImports,
|
|
132
136
|
Products: () => Products,
|
|
137
|
+
PspImportEventStream: () => PspImportEventStream,
|
|
133
138
|
RTL_CHECKOUT_LOCALES: () => RTL_CHECKOUT_LOCALES,
|
|
134
139
|
Regions: () => Regions,
|
|
135
140
|
Risk: () => Risk,
|
|
@@ -181,6 +186,7 @@ __export(internal_exports, {
|
|
|
181
186
|
anyOf: () => anyOf,
|
|
182
187
|
applyBrandingVariables: () => applyBrandingVariables,
|
|
183
188
|
asAirwallexCardPreset: () => asAirwallexCardPreset,
|
|
189
|
+
brandingAssetPath: () => brandingAssetPath,
|
|
184
190
|
buildBrandingExport: () => buildBrandingExport,
|
|
185
191
|
builtinPaymentIconDataUri: () => builtinPaymentIconDataUri,
|
|
186
192
|
builtinPaymentIconSvg: () => builtinPaymentIconSvg,
|
|
@@ -2016,6 +2022,44 @@ var Disputes = class {
|
|
|
2016
2022
|
options
|
|
2017
2023
|
);
|
|
2018
2024
|
}
|
|
2025
|
+
/**
|
|
2026
|
+
* What a bulk action would do to the selected cases, changing nothing:
|
|
2027
|
+
* each case as eligible or skipped with a reason, and what the eligible ones
|
|
2028
|
+
* add up to per currency. Name the cases by `ids` or by the list's
|
|
2029
|
+
* `filters`, exactly one of the two; at most `max_cases` are read.
|
|
2030
|
+
*
|
|
2031
|
+
* `POST /disputes/workspace/bulk/preview`. Needs a dashboard JWT.
|
|
2032
|
+
*/
|
|
2033
|
+
async bulkPreview(request) {
|
|
2034
|
+
const { filters, ...rest } = request;
|
|
2035
|
+
return this.request("POST", "/disputes/workspace/bulk/preview", {
|
|
2036
|
+
body: filters ? { ...rest, filters: workspaceQuery(filters) } : rest
|
|
2037
|
+
});
|
|
2038
|
+
}
|
|
2039
|
+
/**
|
|
2040
|
+
* Accept the listed cases at their processors, at most the preview's
|
|
2041
|
+
* `max_run_cases` per call; send a larger set in parts under one
|
|
2042
|
+
* `request_id`. Eligibility is decided again at run time, and every case
|
|
2043
|
+
* gets its own result. An `unknown` result means the processor may have
|
|
2044
|
+
* acted: read the case before acting on it again.
|
|
2045
|
+
*
|
|
2046
|
+
* `POST /disputes/workspace/bulk/accept`. Needs a dashboard JWT.
|
|
2047
|
+
*/
|
|
2048
|
+
async bulkAccept(request) {
|
|
2049
|
+
return this.request("POST", "/disputes/workspace/bulk/accept", { body: request });
|
|
2050
|
+
}
|
|
2051
|
+
/**
|
|
2052
|
+
* Add the buyer of each listed case's payment to the buyer blocklist: the
|
|
2053
|
+
* payment's email and customer id, and the device ids and IP address of the
|
|
2054
|
+
* browser that paid, when DeloPay can tie them to it. Identifiers already
|
|
2055
|
+
* blocked are not added again, and `unattributed` names those it could not
|
|
2056
|
+
* tie to the buyer.
|
|
2057
|
+
*
|
|
2058
|
+
* `POST /disputes/workspace/bulk/block-buyer`. Needs a dashboard JWT.
|
|
2059
|
+
*/
|
|
2060
|
+
async bulkBlockBuyer(request) {
|
|
2061
|
+
return this.request("POST", "/disputes/workspace/bulk/block-buyer", { body: request });
|
|
2062
|
+
}
|
|
2019
2063
|
/**
|
|
2020
2064
|
* Retrieve a dispute by its ID.
|
|
2021
2065
|
*
|
|
@@ -5268,6 +5312,49 @@ var Users = class {
|
|
|
5268
5312
|
body: params
|
|
5269
5313
|
});
|
|
5270
5314
|
}
|
|
5315
|
+
/**
|
|
5316
|
+
* A member's permission overrides in your merchant: every area that can be
|
|
5317
|
+
* overridden at their level, with what their roles give, the level set for
|
|
5318
|
+
* them, and what they have. `GET /user/employees/{user_id}/permission-overrides`
|
|
5319
|
+
*
|
|
5320
|
+
* Needs the *Users* read permission, and answers only for a member
|
|
5321
|
+
* `listUsersInLineage` shows you (any other id is a 404 `UR_68`).
|
|
5322
|
+
* `can_edit`, `can_raise` and each area's `grantable_level` say what you
|
|
5323
|
+
* may change.
|
|
5324
|
+
*/
|
|
5325
|
+
async getMemberPermissionOverrides(userId) {
|
|
5326
|
+
return this.request(
|
|
5327
|
+
"GET",
|
|
5328
|
+
`/user/employees/${encodeURIComponent(userId)}/permission-overrides`
|
|
5329
|
+
);
|
|
5330
|
+
}
|
|
5331
|
+
/**
|
|
5332
|
+
* Replace a member's permission overrides. An area left out goes back to
|
|
5333
|
+
* what their roles give. `PUT /user/employees/{user_id}/permission-overrides`
|
|
5334
|
+
*
|
|
5335
|
+
* Needs the *Users* write permission and a member within your reach, other
|
|
5336
|
+
* than yourself. Keeping or lowering is always allowed; a gain must stay
|
|
5337
|
+
* within what you hold in that area, and a gain above the member's roles
|
|
5338
|
+
* needs `can_raise`. The change is audited and applies to the member's next
|
|
5339
|
+
* request. A refusal is a `UR_68` whose `data` is
|
|
5340
|
+
* `{ reason: 'permission_overrides', refusal }` (see
|
|
5341
|
+
* {@link PermissionOverrideRefusal}).
|
|
5342
|
+
*/
|
|
5343
|
+
async updateMemberPermissionOverrides(userId, params) {
|
|
5344
|
+
return this.request(
|
|
5345
|
+
"PUT",
|
|
5346
|
+
`/user/employees/${encodeURIComponent(userId)}/permission-overrides`,
|
|
5347
|
+
{ body: params }
|
|
5348
|
+
);
|
|
5349
|
+
}
|
|
5350
|
+
/**
|
|
5351
|
+
* The permission overrides your own session acts under, sorted by area.
|
|
5352
|
+
* An area named here has exactly that level, whatever a broader legacy area
|
|
5353
|
+
* of the role would suggest. `GET /user/role/permission-overrides`
|
|
5354
|
+
*/
|
|
5355
|
+
async getOwnPermissionOverrides() {
|
|
5356
|
+
return this.request("GET", "/user/role/permission-overrides");
|
|
5357
|
+
}
|
|
5271
5358
|
/** Sign in via OIDC. `POST /user/oidc` */
|
|
5272
5359
|
async signInOidc(params) {
|
|
5273
5360
|
return this.request("POST", "/user/oidc", { body: params });
|
|
@@ -5492,7 +5579,8 @@ var IdentityVerifications = class {
|
|
|
5492
5579
|
}
|
|
5493
5580
|
/**
|
|
5494
5581
|
* One verification. With `force_sync: true`, a verification the provider
|
|
5495
|
-
* can still change (pending or in review
|
|
5582
|
+
* can still change (pending or in review, or a subject under ongoing AML
|
|
5583
|
+
* monitoring) is read from the provider first.
|
|
5496
5584
|
*
|
|
5497
5585
|
* `GET /identity-verifications/{verification_id}`
|
|
5498
5586
|
*/
|
|
@@ -5504,8 +5592,9 @@ var IdentityVerifications = class {
|
|
|
5504
5592
|
}
|
|
5505
5593
|
/**
|
|
5506
5594
|
* A subject's latest verification in one environment (live unless
|
|
5507
|
-
* `test_mode: true`), with its checks
|
|
5508
|
-
*
|
|
5595
|
+
* `test_mode: true`), with its checks, and the subject's verification under
|
|
5596
|
+
* ongoing AML monitoring. This is what risk rules read. `verification` and
|
|
5597
|
+
* `aml_monitoring` are `null` when the subject has none.
|
|
5509
5598
|
*
|
|
5510
5599
|
* `GET /identity-verifications/subjects/{subject_reference}`
|
|
5511
5600
|
*/
|
|
@@ -5530,6 +5619,78 @@ var IdentityVerifications = class {
|
|
|
5530
5619
|
{ query, ...options }
|
|
5531
5620
|
);
|
|
5532
5621
|
}
|
|
5622
|
+
/**
|
|
5623
|
+
* Switch ongoing AML monitoring of a verification's subject. The provider
|
|
5624
|
+
* then keeps re-screening the subject against sanctions, PEP and
|
|
5625
|
+
* adverse-media lists, and every change it reports is recorded. Only a
|
|
5626
|
+
* verified person or business can be enrolled; monitoring can be switched
|
|
5627
|
+
* off at any time. Needs permission to edit customers.
|
|
5628
|
+
*
|
|
5629
|
+
* `POST /identity-verifications/{verification_id}/aml-monitoring`
|
|
5630
|
+
*/
|
|
5631
|
+
async setAmlMonitoring(verificationId, params, options) {
|
|
5632
|
+
return this.request(
|
|
5633
|
+
"POST",
|
|
5634
|
+
`/identity-verifications/${encodeURIComponent(verificationId)}/aml-monitoring`,
|
|
5635
|
+
{ body: params, ...options }
|
|
5636
|
+
);
|
|
5637
|
+
}
|
|
5638
|
+
/**
|
|
5639
|
+
* Every change of the subject's AML result the provider reported while the
|
|
5640
|
+
* subject was monitored, newest first, at most 100.
|
|
5641
|
+
*
|
|
5642
|
+
* `GET /identity-verifications/{verification_id}/aml-events`
|
|
5643
|
+
*/
|
|
5644
|
+
async amlEvents(verificationId, options) {
|
|
5645
|
+
return this.request(
|
|
5646
|
+
"GET",
|
|
5647
|
+
`/identity-verifications/${encodeURIComponent(verificationId)}/aml-events`,
|
|
5648
|
+
options
|
|
5649
|
+
);
|
|
5650
|
+
}
|
|
5651
|
+
/**
|
|
5652
|
+
* A payment's screening by the transaction monitoring of the shop's
|
|
5653
|
+
* screening account. Recorded only: it never holds or refuses the payment.
|
|
5654
|
+
* Answers 404 when the payment has no screening. Needs permission to read
|
|
5655
|
+
* payments.
|
|
5656
|
+
*
|
|
5657
|
+
* `GET /identity-verifications/payment-screenings/{payment_id}`
|
|
5658
|
+
*/
|
|
5659
|
+
async paymentScreening(paymentId, options) {
|
|
5660
|
+
return this.request(
|
|
5661
|
+
"GET",
|
|
5662
|
+
`/identity-verifications/payment-screenings/${encodeURIComponent(paymentId)}`,
|
|
5663
|
+
options
|
|
5664
|
+
);
|
|
5665
|
+
}
|
|
5666
|
+
/**
|
|
5667
|
+
* Whether an account screens its shop's payments. Needs permission to read
|
|
5668
|
+
* connectors.
|
|
5669
|
+
*
|
|
5670
|
+
* `GET /identity-verifications/accounts/{merchant_connector_id}/payment-screening`
|
|
5671
|
+
*/
|
|
5672
|
+
async paymentScreeningSetting(merchantConnectorId, options) {
|
|
5673
|
+
return this.request(
|
|
5674
|
+
"GET",
|
|
5675
|
+
`/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/payment-screening`,
|
|
5676
|
+
options
|
|
5677
|
+
);
|
|
5678
|
+
}
|
|
5679
|
+
/**
|
|
5680
|
+
* Switch screening of the account's shop's payments. Switched on, every
|
|
5681
|
+
* payment of the shop that succeeds from then on is screened shortly after,
|
|
5682
|
+
* in the payment's own environment. A shop has at most one screening
|
|
5683
|
+
* account. Needs permission to edit connectors.
|
|
5684
|
+
*
|
|
5685
|
+
* `PUT /identity-verifications/accounts/{merchant_connector_id}/payment-screening`
|
|
5686
|
+
*/
|
|
5687
|
+
async updatePaymentScreeningSetting(merchantConnectorId, params, options) {
|
|
5688
|
+
return this.request(
|
|
5689
|
+
"PUT",
|
|
5690
|
+
`/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/payment-screening`,
|
|
5691
|
+
{ body: params, ...options }
|
|
5692
|
+
);
|
|
5693
|
+
}
|
|
5533
5694
|
};
|
|
5534
5695
|
|
|
5535
5696
|
// src/resources/webhooks.ts
|
|
@@ -6268,6 +6429,110 @@ var ShopLabels = class {
|
|
|
6268
6429
|
}
|
|
6269
6430
|
};
|
|
6270
6431
|
|
|
6432
|
+
// src/resources/checkoutTemplates.ts
|
|
6433
|
+
var CheckoutTemplates = class {
|
|
6434
|
+
constructor(request) {
|
|
6435
|
+
this.request = request;
|
|
6436
|
+
}
|
|
6437
|
+
/**
|
|
6438
|
+
* The merchant's templates, each with the shops on it and whether each
|
|
6439
|
+
* runs the template's current settings.
|
|
6440
|
+
* `GET /checkout-templates/{merchantId}`
|
|
6441
|
+
*/
|
|
6442
|
+
async list(merchantId) {
|
|
6443
|
+
return this.request("GET", `/checkout-templates/${encodeURIComponent(merchantId)}`);
|
|
6444
|
+
}
|
|
6445
|
+
/**
|
|
6446
|
+
* Create a template, empty or copied from a shop's current settings. The
|
|
6447
|
+
* shop copied from is not changed.
|
|
6448
|
+
* `POST /checkout-templates/{merchantId}`
|
|
6449
|
+
*/
|
|
6450
|
+
async create(merchantId, params) {
|
|
6451
|
+
return this.request("POST", `/checkout-templates/${encodeURIComponent(merchantId)}`, {
|
|
6452
|
+
body: params
|
|
6453
|
+
});
|
|
6454
|
+
}
|
|
6455
|
+
/** `GET /checkout-templates/{merchantId}/{templateId}` */
|
|
6456
|
+
async retrieve(merchantId, templateId) {
|
|
6457
|
+
return this.request(
|
|
6458
|
+
"GET",
|
|
6459
|
+
`/checkout-templates/${encodeURIComponent(merchantId)}/${encodeURIComponent(templateId)}`
|
|
6460
|
+
);
|
|
6461
|
+
}
|
|
6462
|
+
/**
|
|
6463
|
+
* Rename a template. A name another template of the merchant holds is
|
|
6464
|
+
* refused.
|
|
6465
|
+
* `POST /checkout-templates/{merchantId}/{templateId}`
|
|
6466
|
+
*/
|
|
6467
|
+
async rename(merchantId, templateId, params) {
|
|
6468
|
+
return this.request(
|
|
6469
|
+
"POST",
|
|
6470
|
+
`/checkout-templates/${encodeURIComponent(merchantId)}/${encodeURIComponent(templateId)}`,
|
|
6471
|
+
{ body: params }
|
|
6472
|
+
);
|
|
6473
|
+
}
|
|
6474
|
+
/**
|
|
6475
|
+
* Delete a template. Refused while a shop is on it.
|
|
6476
|
+
* `DELETE /checkout-templates/{merchantId}/{templateId}`
|
|
6477
|
+
*/
|
|
6478
|
+
async delete(merchantId, templateId) {
|
|
6479
|
+
return this.request(
|
|
6480
|
+
"DELETE",
|
|
6481
|
+
`/checkout-templates/${encodeURIComponent(merchantId)}/${encodeURIComponent(templateId)}`
|
|
6482
|
+
);
|
|
6483
|
+
}
|
|
6484
|
+
/**
|
|
6485
|
+
* Put shops on the template and copy its settings into them; a shop on
|
|
6486
|
+
* another template moves. Each shop is reported on its own: one with
|
|
6487
|
+
* `blockers` is left unchanged. `dry_run` changes nothing and reports what
|
|
6488
|
+
* would change.
|
|
6489
|
+
* `POST /checkout-templates/{merchantId}/{templateId}/shops`
|
|
6490
|
+
*/
|
|
6491
|
+
async assign(merchantId, templateId, params) {
|
|
6492
|
+
return this.request(
|
|
6493
|
+
"POST",
|
|
6494
|
+
`/checkout-templates/${encodeURIComponent(merchantId)}/${encodeURIComponent(templateId)}/shops`,
|
|
6495
|
+
{
|
|
6496
|
+
body: params
|
|
6497
|
+
}
|
|
6498
|
+
);
|
|
6499
|
+
}
|
|
6500
|
+
/**
|
|
6501
|
+
* Take a shop off the template. It keeps every setting it has, as its own.
|
|
6502
|
+
* `DELETE /checkout-templates/{merchantId}/{templateId}/shops/{profileId}`
|
|
6503
|
+
*/
|
|
6504
|
+
async unassign(merchantId, templateId, profileId) {
|
|
6505
|
+
return this.request(
|
|
6506
|
+
"DELETE",
|
|
6507
|
+
`/checkout-templates/${encodeURIComponent(merchantId)}/${encodeURIComponent(templateId)}/shops/${encodeURIComponent(profileId)}`
|
|
6508
|
+
);
|
|
6509
|
+
}
|
|
6510
|
+
/**
|
|
6511
|
+
* Copy the template's current settings into its shops, all or the ones
|
|
6512
|
+
* named.
|
|
6513
|
+
* `POST /checkout-templates/{merchantId}/{templateId}/apply`
|
|
6514
|
+
*/
|
|
6515
|
+
async apply(merchantId, templateId, params = {}) {
|
|
6516
|
+
return this.request(
|
|
6517
|
+
"POST",
|
|
6518
|
+
`/checkout-templates/${encodeURIComponent(merchantId)}/${encodeURIComponent(templateId)}/apply`,
|
|
6519
|
+
{
|
|
6520
|
+
body: params
|
|
6521
|
+
}
|
|
6522
|
+
);
|
|
6523
|
+
}
|
|
6524
|
+
/**
|
|
6525
|
+
* The template a shop is on, if any. Readable by the shop's own members.
|
|
6526
|
+
* `GET /checkout-templates/{merchantId}/shops/{profileId}`
|
|
6527
|
+
*/
|
|
6528
|
+
async ofShop(merchantId, profileId) {
|
|
6529
|
+
return this.request(
|
|
6530
|
+
"GET",
|
|
6531
|
+
`/checkout-templates/${encodeURIComponent(merchantId)}/shops/${encodeURIComponent(profileId)}`
|
|
6532
|
+
);
|
|
6533
|
+
}
|
|
6534
|
+
};
|
|
6535
|
+
|
|
6271
6536
|
// src/resources/buyerConversations.ts
|
|
6272
6537
|
var BuyerConversations = class {
|
|
6273
6538
|
constructor(request) {
|
|
@@ -9519,6 +9784,167 @@ var Live = class {
|
|
|
9519
9784
|
}
|
|
9520
9785
|
};
|
|
9521
9786
|
|
|
9787
|
+
// src/resources/processorImports.ts
|
|
9788
|
+
function toPspImportStreamEvent(event) {
|
|
9789
|
+
switch (event.type) {
|
|
9790
|
+
case "progress": {
|
|
9791
|
+
let run;
|
|
9792
|
+
try {
|
|
9793
|
+
run = JSON.parse(event.data);
|
|
9794
|
+
} catch {
|
|
9795
|
+
return null;
|
|
9796
|
+
}
|
|
9797
|
+
if (run === null || typeof run !== "object" || Array.isArray(run)) return null;
|
|
9798
|
+
return { type: "progress", run };
|
|
9799
|
+
}
|
|
9800
|
+
case "done":
|
|
9801
|
+
return { type: "done" };
|
|
9802
|
+
default:
|
|
9803
|
+
return null;
|
|
9804
|
+
}
|
|
9805
|
+
}
|
|
9806
|
+
var PspImportEventStream = class {
|
|
9807
|
+
constructor(connection) {
|
|
9808
|
+
this.connection = connection;
|
|
9809
|
+
}
|
|
9810
|
+
/** Close the stream; the iteration ends without an error. */
|
|
9811
|
+
close() {
|
|
9812
|
+
this.connection.close();
|
|
9813
|
+
}
|
|
9814
|
+
[Symbol.asyncIterator]() {
|
|
9815
|
+
this.iterator ?? (this.iterator = this.events());
|
|
9816
|
+
return this.iterator;
|
|
9817
|
+
}
|
|
9818
|
+
async *events() {
|
|
9819
|
+
for await (const dispatch of this.connection.dispatches) {
|
|
9820
|
+
if (!dispatch.event) continue;
|
|
9821
|
+
const event = toPspImportStreamEvent(dispatch.event);
|
|
9822
|
+
if (event) yield event;
|
|
9823
|
+
}
|
|
9824
|
+
}
|
|
9825
|
+
};
|
|
9826
|
+
var ProcessorImports = class {
|
|
9827
|
+
constructor(request, openStream) {
|
|
9828
|
+
this.request = request;
|
|
9829
|
+
this.openStream = openStream;
|
|
9830
|
+
}
|
|
9831
|
+
/**
|
|
9832
|
+
* Every connected processor account the caller may see, with what each can
|
|
9833
|
+
* provide in the environment: listed, read payment by payment, or
|
|
9834
|
+
* unavailable with a reason.
|
|
9835
|
+
*
|
|
9836
|
+
* `GET /refunds-disputes/imports/sources`
|
|
9837
|
+
*/
|
|
9838
|
+
async sources(params) {
|
|
9839
|
+
return this.request("GET", "/refunds-disputes/imports/sources", {
|
|
9840
|
+
query: { test_mode: params.test_mode }
|
|
9841
|
+
});
|
|
9842
|
+
}
|
|
9843
|
+
/**
|
|
9844
|
+
* Start an import. A source a processor cannot provide is stored as
|
|
9845
|
+
* `unavailable` with its reason. Refused while another import of the
|
|
9846
|
+
* merchant runs in the same environment.
|
|
9847
|
+
*
|
|
9848
|
+
* `POST /refunds-disputes/imports`
|
|
9849
|
+
*/
|
|
9850
|
+
async create(request) {
|
|
9851
|
+
return this.request("POST", "/refunds-disputes/imports", { body: request });
|
|
9852
|
+
}
|
|
9853
|
+
/**
|
|
9854
|
+
* The newest import in the environment, running or finished.
|
|
9855
|
+
*
|
|
9856
|
+
* `GET /refunds-disputes/imports/latest`
|
|
9857
|
+
*/
|
|
9858
|
+
async latest(params) {
|
|
9859
|
+
return this.request("GET", "/refunds-disputes/imports/latest", {
|
|
9860
|
+
query: { test_mode: params.test_mode }
|
|
9861
|
+
});
|
|
9862
|
+
}
|
|
9863
|
+
/** `GET /refunds-disputes/imports/{id}` */
|
|
9864
|
+
async retrieve(id) {
|
|
9865
|
+
return this.request("GET", `/refunds-disputes/imports/${encodeURIComponent(id)}`);
|
|
9866
|
+
}
|
|
9867
|
+
/**
|
|
9868
|
+
* The records an import left out or could not record, each with its reason.
|
|
9869
|
+
*
|
|
9870
|
+
* `GET /refunds-disputes/imports/{id}/issues`
|
|
9871
|
+
*/
|
|
9872
|
+
async issues(id, params) {
|
|
9873
|
+
return this.request("GET", `/refunds-disputes/imports/${encodeURIComponent(id)}/issues`, {
|
|
9874
|
+
query: { limit: params?.limit, offset: params?.offset }
|
|
9875
|
+
});
|
|
9876
|
+
}
|
|
9877
|
+
/**
|
|
9878
|
+
* Ask a running import to stop. It stops after the page it is reading;
|
|
9879
|
+
* what it recorded stays recorded.
|
|
9880
|
+
*
|
|
9881
|
+
* `POST /refunds-disputes/imports/{id}/cancel`
|
|
9882
|
+
*/
|
|
9883
|
+
async cancel(id) {
|
|
9884
|
+
return this.request("POST", `/refunds-disputes/imports/${encodeURIComponent(id)}/cancel`);
|
|
9885
|
+
}
|
|
9886
|
+
/**
|
|
9887
|
+
* Open the progress stream of an import. Resolves once the server answered;
|
|
9888
|
+
* a `401` rejects with `DelopayAuthenticationError`.
|
|
9889
|
+
*
|
|
9890
|
+
* `GET /refunds-disputes/imports/{id}/stream`
|
|
9891
|
+
*
|
|
9892
|
+
* @example
|
|
9893
|
+
* ```typescript
|
|
9894
|
+
* const stream = await delopay.processorImports.stream(run.id, { signal });
|
|
9895
|
+
* for await (const event of stream) {
|
|
9896
|
+
* if (event.type === 'progress') render(event.run);
|
|
9897
|
+
* }
|
|
9898
|
+
* ```
|
|
9899
|
+
*/
|
|
9900
|
+
async stream(id, options = {}) {
|
|
9901
|
+
const connection = await this.openStream(
|
|
9902
|
+
`/refunds-disputes/imports/${encodeURIComponent(id)}/stream`,
|
|
9903
|
+
{
|
|
9904
|
+
...options.signal ? { signal: options.signal } : {},
|
|
9905
|
+
...options.idleTimeoutMs !== void 0 ? { idleTimeoutMs: options.idleTimeoutMs } : {},
|
|
9906
|
+
...options.headers ? { headers: options.headers } : {}
|
|
9907
|
+
}
|
|
9908
|
+
);
|
|
9909
|
+
return new PspImportEventStream(connection);
|
|
9910
|
+
}
|
|
9911
|
+
};
|
|
9912
|
+
|
|
9913
|
+
// src/resources/deploymentBranding.ts
|
|
9914
|
+
function brandingAssetPath(asset, version) {
|
|
9915
|
+
const path = `/branding/assets/${encodeURIComponent(asset)}`;
|
|
9916
|
+
return version ? `${path}?v=${encodeURIComponent(version)}` : path;
|
|
9917
|
+
}
|
|
9918
|
+
var Branding = class {
|
|
9919
|
+
constructor(request, baseUrl) {
|
|
9920
|
+
this.request = request;
|
|
9921
|
+
this.baseUrl = baseUrl;
|
|
9922
|
+
}
|
|
9923
|
+
/**
|
|
9924
|
+
* The saved branding. A `null` field means "keep your own default".
|
|
9925
|
+
*
|
|
9926
|
+
* Branding is cosmetic, so treat any failure as "nothing saved": routers
|
|
9927
|
+
* from before this route answer 404, and a page must never wait long for
|
|
9928
|
+
* it. Pass a `signal` (e.g. `AbortSignal.timeout(2500)`) to bound the call
|
|
9929
|
+
* including its retries; a `timeout` alone applies to each attempt.
|
|
9930
|
+
*
|
|
9931
|
+
* `GET /branding`
|
|
9932
|
+
*/
|
|
9933
|
+
async retrieve(options) {
|
|
9934
|
+
return this.request("GET", "/branding", { ...options });
|
|
9935
|
+
}
|
|
9936
|
+
/**
|
|
9937
|
+
* The address of one branding image or font file on this client's base
|
|
9938
|
+
* URL, for an `<img src>` or a `@font-face` `src`. See
|
|
9939
|
+
* {@link brandingAssetPath}.
|
|
9940
|
+
*
|
|
9941
|
+
* `GET /branding/assets/{asset}`
|
|
9942
|
+
*/
|
|
9943
|
+
assetUrl(asset, version) {
|
|
9944
|
+
return `${this.baseUrl}${brandingAssetPath(asset, version)}`;
|
|
9945
|
+
}
|
|
9946
|
+
};
|
|
9947
|
+
|
|
9522
9948
|
// src/client.ts
|
|
9523
9949
|
var PRODUCTION_URL = "https://api.delopay.net";
|
|
9524
9950
|
var SANDBOX_URL = "https://sandbox.delopay.net";
|
|
@@ -9798,6 +10224,8 @@ var Delopay = class {
|
|
|
9798
10224
|
this.messageTemplates = new MessageTemplates(request);
|
|
9799
10225
|
this.risk = new Risk(request);
|
|
9800
10226
|
this.live = new Live(request, openStream);
|
|
10227
|
+
this.processorImports = new ProcessorImports(request, openStream);
|
|
10228
|
+
this.branding = new Branding(request, this.baseUrl);
|
|
9801
10229
|
this.subscriptions = new Subscriptions(request);
|
|
9802
10230
|
this.buyerPortal = new BuyerPortal(request);
|
|
9803
10231
|
this.buyerAccount = new BuyerAccount(request);
|
|
@@ -9809,6 +10237,7 @@ var Delopay = class {
|
|
|
9809
10237
|
this.sellToRestrictions = new SellToRestrictions(request);
|
|
9810
10238
|
this.buyerBlocklist = new BuyerBlocklist(request);
|
|
9811
10239
|
this.shopLabels = new ShopLabels(request);
|
|
10240
|
+
this.checkoutTemplates = new CheckoutTemplates(request);
|
|
9812
10241
|
this.buyerConversations = new BuyerConversations(request);
|
|
9813
10242
|
this.buyerEvidence = new BuyerEvidenceReviews(request);
|
|
9814
10243
|
this.checkoutRecovery = new CheckoutRecovery(request);
|
|
@@ -14080,6 +14509,25 @@ var CheckoutSession = class {
|
|
|
14080
14509
|
headers: this.bearerHeaders(options?.headers)
|
|
14081
14510
|
});
|
|
14082
14511
|
}
|
|
14512
|
+
/**
|
|
14513
|
+
* Reserve this payment attempt before a hosted card form contacts Stripe,
|
|
14514
|
+
* Airwallex, or NomuPay. Send the provider object rendered to this checkout
|
|
14515
|
+
* and retain the same `flow_id` across retries and any 3-D Secure step.
|
|
14516
|
+
*
|
|
14517
|
+
* Only `authorized: true` permits the form to contact its processor. A
|
|
14518
|
+
* competing flow receives `false` and must reload; an unresolved provider
|
|
14519
|
+
* outcome stays reserved, regardless of elapsed time. A buyer-blocklist
|
|
14520
|
+
* refusal throws a `DelopayError` with code `DE_14`.
|
|
14521
|
+
*
|
|
14522
|
+
* `POST /payment-link/{merchantId}/{paymentId}/browser-card-claim`
|
|
14523
|
+
*/
|
|
14524
|
+
async claimBrowserCard(params, options) {
|
|
14525
|
+
return this.client.request("POST", `${this.linkBase}/browser-card-claim`, {
|
|
14526
|
+
body: params,
|
|
14527
|
+
...options,
|
|
14528
|
+
headers: this.bearerHeaders(options?.headers)
|
|
14529
|
+
});
|
|
14530
|
+
}
|
|
14083
14531
|
/**
|
|
14084
14532
|
* Confirm the Stripe card form's PaymentIntent through the router, for a
|
|
14085
14533
|
* checkout payload with `card_connector_server_confirm: true`. Stripe refuses
|
|
@@ -14101,6 +14549,10 @@ var CheckoutSession = class {
|
|
|
14101
14549
|
* and that secret confirms nothing without the secret key — then call this
|
|
14102
14550
|
* again without a payment method to finalize.
|
|
14103
14551
|
*
|
|
14552
|
+
* Reserve the attempt with {@link claimBrowserCard} first. Send its granted
|
|
14553
|
+
* `flow_id` as `browser_flow_id` on both the initial and post-action confirm;
|
|
14554
|
+
* an omitted, null or nonholder flow is refused with `400` and code `IR_16`.
|
|
14555
|
+
*
|
|
14104
14556
|
* A PaymentMethod rules out what `stripe.createPaymentMethod` cannot
|
|
14105
14557
|
* produce: Stripe names Amazon Pay and Klarna in the Express Checkout
|
|
14106
14558
|
* Element, which need `stripe.createConfirmationToken` instead. Neither can
|
|
@@ -14981,6 +15433,33 @@ var Admin = class {
|
|
|
14981
15433
|
}
|
|
14982
15434
|
};
|
|
14983
15435
|
|
|
15436
|
+
// src/internal/resources/adminBranding.ts
|
|
15437
|
+
var AdminBranding = class {
|
|
15438
|
+
constructor(request) {
|
|
15439
|
+
this.request = request;
|
|
15440
|
+
}
|
|
15441
|
+
/**
|
|
15442
|
+
* What is saved, the value in force for each unset field, and the revision
|
|
15443
|
+
* to send back on the next update.
|
|
15444
|
+
*
|
|
15445
|
+
* `GET /admin-portal/branding`
|
|
15446
|
+
*/
|
|
15447
|
+
async retrieve(options) {
|
|
15448
|
+
return this.request("GET", "/admin-portal/branding", { ...options });
|
|
15449
|
+
}
|
|
15450
|
+
/**
|
|
15451
|
+
* Replace the whole branding; all fields `null` clears it. A changed image
|
|
15452
|
+
* or font address is fetched first and refused unless it answers with the
|
|
15453
|
+
* right kind of file. A stale `expected_revision` is refused and changes
|
|
15454
|
+
* nothing.
|
|
15455
|
+
*
|
|
15456
|
+
* `PUT /admin-portal/branding`
|
|
15457
|
+
*/
|
|
15458
|
+
async update(params, options) {
|
|
15459
|
+
return this.request("PUT", "/admin-portal/branding", { body: params, ...options });
|
|
15460
|
+
}
|
|
15461
|
+
};
|
|
15462
|
+
|
|
14984
15463
|
// src/internal/resources/adminLive.ts
|
|
14985
15464
|
var AdminLive = class {
|
|
14986
15465
|
constructor(request, openStream) {
|
|
@@ -15595,6 +16074,32 @@ var AdminPortal = class {
|
|
|
15595
16074
|
{ body }
|
|
15596
16075
|
);
|
|
15597
16076
|
}
|
|
16077
|
+
/**
|
|
16078
|
+
* A member of `merchantId`'s permission overrides.
|
|
16079
|
+
* `GET /admin-portal/accounts/{merchant_id}/members/{user_id}/permission-overrides`
|
|
16080
|
+
*
|
|
16081
|
+
* Any internal role may read them; `can_edit` is `false` for one without
|
|
16082
|
+
* `UsersManage`. A user holding no role in the merchant is a 404 `UR_68`.
|
|
16083
|
+
*/
|
|
16084
|
+
async getMemberPermissionOverrides(merchantId, userId) {
|
|
16085
|
+
return this.request(
|
|
16086
|
+
"GET",
|
|
16087
|
+
`/admin-portal/accounts/${encodeURIComponent(merchantId)}/members/${encodeURIComponent(userId)}/permission-overrides`
|
|
16088
|
+
);
|
|
16089
|
+
}
|
|
16090
|
+
/**
|
|
16091
|
+
* Replace a member of `merchantId`'s permission overrides. Needs
|
|
16092
|
+
* `UsersManage`; an operator is not limited by their own access. Recorded
|
|
16093
|
+
* in the merchant's audit log and applied to the member's next request.
|
|
16094
|
+
* `PUT /admin-portal/accounts/{merchant_id}/members/{user_id}/permission-overrides`
|
|
16095
|
+
*/
|
|
16096
|
+
async updateMemberPermissionOverrides(merchantId, userId, body) {
|
|
16097
|
+
return this.request(
|
|
16098
|
+
"PUT",
|
|
16099
|
+
`/admin-portal/accounts/${encodeURIComponent(merchantId)}/members/${encodeURIComponent(userId)}/permission-overrides`,
|
|
16100
|
+
{ body }
|
|
16101
|
+
);
|
|
16102
|
+
}
|
|
15598
16103
|
/**
|
|
15599
16104
|
* Soft-delete a user globally: deactivates the row, blacklists existing
|
|
15600
16105
|
* JWTs, and wipes credentials. Distinct from `deleteUserRole`, which
|
|
@@ -16721,6 +17226,7 @@ var DelopayInternal = class extends Delopay {
|
|
|
16721
17226
|
this.adminPortal = new AdminPortal(request);
|
|
16722
17227
|
const openStream = this.openEventStream.bind(this);
|
|
16723
17228
|
this.adminLive = new AdminLive(request, openStream);
|
|
17229
|
+
this.adminBranding = new AdminBranding(request);
|
|
16724
17230
|
this.auditLogs = new AuditLogs(request);
|
|
16725
17231
|
this.cache = new Cache(request);
|
|
16726
17232
|
this.cardIssuers = new CardIssuers(request);
|
|
@@ -16754,6 +17260,7 @@ var DelopayInternal = class extends Delopay {
|
|
|
16754
17260
|
APPLE_PAY_BUTTON_STYLES,
|
|
16755
17261
|
APPLE_PAY_BUTTON_TYPES,
|
|
16756
17262
|
Admin,
|
|
17263
|
+
AdminBranding,
|
|
16757
17264
|
AdminLive,
|
|
16758
17265
|
AdminPortal,
|
|
16759
17266
|
Analytics,
|
|
@@ -16764,6 +17271,7 @@ var DelopayInternal = class extends Delopay {
|
|
|
16764
17271
|
BRANDING_EXPORT_FORMAT,
|
|
16765
17272
|
BRANDING_EXPORT_VERSION,
|
|
16766
17273
|
BUILTIN_PAYMENT_ICON_KEYS,
|
|
17274
|
+
Branding,
|
|
16767
17275
|
BuyerBlocklist,
|
|
16768
17276
|
BuyerConversations,
|
|
16769
17277
|
BuyerEvidenceReviews,
|
|
@@ -16787,6 +17295,7 @@ var DelopayInternal = class extends Delopay {
|
|
|
16787
17295
|
CheckoutMethods,
|
|
16788
17296
|
CheckoutRecovery,
|
|
16789
17297
|
CheckoutSession,
|
|
17298
|
+
CheckoutTemplates,
|
|
16790
17299
|
Configs,
|
|
16791
17300
|
ConnectorRestrictionRules,
|
|
16792
17301
|
ConnectorRestrictions,
|
|
@@ -16847,7 +17356,9 @@ var DelopayInternal = class extends Delopay {
|
|
|
16847
17356
|
PlatformSettings,
|
|
16848
17357
|
PresentationCache,
|
|
16849
17358
|
ProcessorCosts,
|
|
17359
|
+
ProcessorImports,
|
|
16850
17360
|
Products,
|
|
17361
|
+
PspImportEventStream,
|
|
16851
17362
|
RTL_CHECKOUT_LOCALES,
|
|
16852
17363
|
Regions,
|
|
16853
17364
|
Risk,
|
|
@@ -16899,6 +17410,7 @@ var DelopayInternal = class extends Delopay {
|
|
|
16899
17410
|
anyOf,
|
|
16900
17411
|
applyBrandingVariables,
|
|
16901
17412
|
asAirwallexCardPreset,
|
|
17413
|
+
brandingAssetPath,
|
|
16902
17414
|
buildBrandingExport,
|
|
16903
17415
|
builtinPaymentIconDataUri,
|
|
16904
17416
|
builtinPaymentIconSvg,
|