@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/index.cjs
CHANGED
|
@@ -42,6 +42,7 @@ __export(index_exports, {
|
|
|
42
42
|
BRANDING_EXPORT_FORMAT: () => BRANDING_EXPORT_FORMAT,
|
|
43
43
|
BRANDING_EXPORT_VERSION: () => BRANDING_EXPORT_VERSION,
|
|
44
44
|
BUILTIN_PAYMENT_ICON_KEYS: () => BUILTIN_PAYMENT_ICON_KEYS,
|
|
45
|
+
Branding: () => Branding,
|
|
45
46
|
BuyerBlocklist: () => BuyerBlocklist,
|
|
46
47
|
BuyerConversations: () => BuyerConversations,
|
|
47
48
|
BuyerEvidenceReviews: () => BuyerEvidenceReviews,
|
|
@@ -63,6 +64,7 @@ __export(index_exports, {
|
|
|
63
64
|
CheckoutMethods: () => CheckoutMethods,
|
|
64
65
|
CheckoutRecovery: () => CheckoutRecovery,
|
|
65
66
|
CheckoutSession: () => CheckoutSession,
|
|
67
|
+
CheckoutTemplates: () => CheckoutTemplates,
|
|
66
68
|
CostRules: () => CostRules,
|
|
67
69
|
DEFAULT_BADGES: () => DEFAULT_BADGES,
|
|
68
70
|
DEFAULT_BADGES_DARK: () => DEFAULT_BADGES_DARK,
|
|
@@ -112,7 +114,9 @@ __export(index_exports, {
|
|
|
112
114
|
PaypalDisputes: () => PaypalDisputes,
|
|
113
115
|
PresentationCache: () => PresentationCache,
|
|
114
116
|
ProcessorCosts: () => ProcessorCosts,
|
|
117
|
+
ProcessorImports: () => ProcessorImports,
|
|
115
118
|
Products: () => Products,
|
|
119
|
+
PspImportEventStream: () => PspImportEventStream,
|
|
116
120
|
RTL_CHECKOUT_LOCALES: () => RTL_CHECKOUT_LOCALES,
|
|
117
121
|
Regions: () => Regions,
|
|
118
122
|
Risk: () => Risk,
|
|
@@ -164,6 +168,7 @@ __export(index_exports, {
|
|
|
164
168
|
anyOf: () => anyOf,
|
|
165
169
|
applyBrandingVariables: () => applyBrandingVariables,
|
|
166
170
|
asAirwallexCardPreset: () => asAirwallexCardPreset,
|
|
171
|
+
brandingAssetPath: () => brandingAssetPath,
|
|
167
172
|
buildBrandingExport: () => buildBrandingExport,
|
|
168
173
|
builtinPaymentIconDataUri: () => builtinPaymentIconDataUri,
|
|
169
174
|
builtinPaymentIconSvg: () => builtinPaymentIconSvg,
|
|
@@ -1999,6 +2004,44 @@ var Disputes = class {
|
|
|
1999
2004
|
options
|
|
2000
2005
|
);
|
|
2001
2006
|
}
|
|
2007
|
+
/**
|
|
2008
|
+
* What a bulk action would do to the selected cases, changing nothing:
|
|
2009
|
+
* each case as eligible or skipped with a reason, and what the eligible ones
|
|
2010
|
+
* add up to per currency. Name the cases by `ids` or by the list's
|
|
2011
|
+
* `filters`, exactly one of the two; at most `max_cases` are read.
|
|
2012
|
+
*
|
|
2013
|
+
* `POST /disputes/workspace/bulk/preview`. Needs a dashboard JWT.
|
|
2014
|
+
*/
|
|
2015
|
+
async bulkPreview(request) {
|
|
2016
|
+
const { filters, ...rest } = request;
|
|
2017
|
+
return this.request("POST", "/disputes/workspace/bulk/preview", {
|
|
2018
|
+
body: filters ? { ...rest, filters: workspaceQuery(filters) } : rest
|
|
2019
|
+
});
|
|
2020
|
+
}
|
|
2021
|
+
/**
|
|
2022
|
+
* Accept the listed cases at their processors, at most the preview's
|
|
2023
|
+
* `max_run_cases` per call; send a larger set in parts under one
|
|
2024
|
+
* `request_id`. Eligibility is decided again at run time, and every case
|
|
2025
|
+
* gets its own result. An `unknown` result means the processor may have
|
|
2026
|
+
* acted: read the case before acting on it again.
|
|
2027
|
+
*
|
|
2028
|
+
* `POST /disputes/workspace/bulk/accept`. Needs a dashboard JWT.
|
|
2029
|
+
*/
|
|
2030
|
+
async bulkAccept(request) {
|
|
2031
|
+
return this.request("POST", "/disputes/workspace/bulk/accept", { body: request });
|
|
2032
|
+
}
|
|
2033
|
+
/**
|
|
2034
|
+
* Add the buyer of each listed case's payment to the buyer blocklist: the
|
|
2035
|
+
* payment's email and customer id, and the device ids and IP address of the
|
|
2036
|
+
* browser that paid, when DeloPay can tie them to it. Identifiers already
|
|
2037
|
+
* blocked are not added again, and `unattributed` names those it could not
|
|
2038
|
+
* tie to the buyer.
|
|
2039
|
+
*
|
|
2040
|
+
* `POST /disputes/workspace/bulk/block-buyer`. Needs a dashboard JWT.
|
|
2041
|
+
*/
|
|
2042
|
+
async bulkBlockBuyer(request) {
|
|
2043
|
+
return this.request("POST", "/disputes/workspace/bulk/block-buyer", { body: request });
|
|
2044
|
+
}
|
|
2002
2045
|
/**
|
|
2003
2046
|
* Retrieve a dispute by its ID.
|
|
2004
2047
|
*
|
|
@@ -5251,6 +5294,49 @@ var Users = class {
|
|
|
5251
5294
|
body: params
|
|
5252
5295
|
});
|
|
5253
5296
|
}
|
|
5297
|
+
/**
|
|
5298
|
+
* A member's permission overrides in your merchant: every area that can be
|
|
5299
|
+
* overridden at their level, with what their roles give, the level set for
|
|
5300
|
+
* them, and what they have. `GET /user/employees/{user_id}/permission-overrides`
|
|
5301
|
+
*
|
|
5302
|
+
* Needs the *Users* read permission, and answers only for a member
|
|
5303
|
+
* `listUsersInLineage` shows you (any other id is a 404 `UR_68`).
|
|
5304
|
+
* `can_edit`, `can_raise` and each area's `grantable_level` say what you
|
|
5305
|
+
* may change.
|
|
5306
|
+
*/
|
|
5307
|
+
async getMemberPermissionOverrides(userId) {
|
|
5308
|
+
return this.request(
|
|
5309
|
+
"GET",
|
|
5310
|
+
`/user/employees/${encodeURIComponent(userId)}/permission-overrides`
|
|
5311
|
+
);
|
|
5312
|
+
}
|
|
5313
|
+
/**
|
|
5314
|
+
* Replace a member's permission overrides. An area left out goes back to
|
|
5315
|
+
* what their roles give. `PUT /user/employees/{user_id}/permission-overrides`
|
|
5316
|
+
*
|
|
5317
|
+
* Needs the *Users* write permission and a member within your reach, other
|
|
5318
|
+
* than yourself. Keeping or lowering is always allowed; a gain must stay
|
|
5319
|
+
* within what you hold in that area, and a gain above the member's roles
|
|
5320
|
+
* needs `can_raise`. The change is audited and applies to the member's next
|
|
5321
|
+
* request. A refusal is a `UR_68` whose `data` is
|
|
5322
|
+
* `{ reason: 'permission_overrides', refusal }` (see
|
|
5323
|
+
* {@link PermissionOverrideRefusal}).
|
|
5324
|
+
*/
|
|
5325
|
+
async updateMemberPermissionOverrides(userId, params) {
|
|
5326
|
+
return this.request(
|
|
5327
|
+
"PUT",
|
|
5328
|
+
`/user/employees/${encodeURIComponent(userId)}/permission-overrides`,
|
|
5329
|
+
{ body: params }
|
|
5330
|
+
);
|
|
5331
|
+
}
|
|
5332
|
+
/**
|
|
5333
|
+
* The permission overrides your own session acts under, sorted by area.
|
|
5334
|
+
* An area named here has exactly that level, whatever a broader legacy area
|
|
5335
|
+
* of the role would suggest. `GET /user/role/permission-overrides`
|
|
5336
|
+
*/
|
|
5337
|
+
async getOwnPermissionOverrides() {
|
|
5338
|
+
return this.request("GET", "/user/role/permission-overrides");
|
|
5339
|
+
}
|
|
5254
5340
|
/** Sign in via OIDC. `POST /user/oidc` */
|
|
5255
5341
|
async signInOidc(params) {
|
|
5256
5342
|
return this.request("POST", "/user/oidc", { body: params });
|
|
@@ -5475,7 +5561,8 @@ var IdentityVerifications = class {
|
|
|
5475
5561
|
}
|
|
5476
5562
|
/**
|
|
5477
5563
|
* One verification. With `force_sync: true`, a verification the provider
|
|
5478
|
-
* can still change (pending or in review
|
|
5564
|
+
* can still change (pending or in review, or a subject under ongoing AML
|
|
5565
|
+
* monitoring) is read from the provider first.
|
|
5479
5566
|
*
|
|
5480
5567
|
* `GET /identity-verifications/{verification_id}`
|
|
5481
5568
|
*/
|
|
@@ -5487,8 +5574,9 @@ var IdentityVerifications = class {
|
|
|
5487
5574
|
}
|
|
5488
5575
|
/**
|
|
5489
5576
|
* A subject's latest verification in one environment (live unless
|
|
5490
|
-
* `test_mode: true`), with its checks
|
|
5491
|
-
*
|
|
5577
|
+
* `test_mode: true`), with its checks, and the subject's verification under
|
|
5578
|
+
* ongoing AML monitoring. This is what risk rules read. `verification` and
|
|
5579
|
+
* `aml_monitoring` are `null` when the subject has none.
|
|
5492
5580
|
*
|
|
5493
5581
|
* `GET /identity-verifications/subjects/{subject_reference}`
|
|
5494
5582
|
*/
|
|
@@ -5513,6 +5601,78 @@ var IdentityVerifications = class {
|
|
|
5513
5601
|
{ query, ...options }
|
|
5514
5602
|
);
|
|
5515
5603
|
}
|
|
5604
|
+
/**
|
|
5605
|
+
* Switch ongoing AML monitoring of a verification's subject. The provider
|
|
5606
|
+
* then keeps re-screening the subject against sanctions, PEP and
|
|
5607
|
+
* adverse-media lists, and every change it reports is recorded. Only a
|
|
5608
|
+
* verified person or business can be enrolled; monitoring can be switched
|
|
5609
|
+
* off at any time. Needs permission to edit customers.
|
|
5610
|
+
*
|
|
5611
|
+
* `POST /identity-verifications/{verification_id}/aml-monitoring`
|
|
5612
|
+
*/
|
|
5613
|
+
async setAmlMonitoring(verificationId, params, options) {
|
|
5614
|
+
return this.request(
|
|
5615
|
+
"POST",
|
|
5616
|
+
`/identity-verifications/${encodeURIComponent(verificationId)}/aml-monitoring`,
|
|
5617
|
+
{ body: params, ...options }
|
|
5618
|
+
);
|
|
5619
|
+
}
|
|
5620
|
+
/**
|
|
5621
|
+
* Every change of the subject's AML result the provider reported while the
|
|
5622
|
+
* subject was monitored, newest first, at most 100.
|
|
5623
|
+
*
|
|
5624
|
+
* `GET /identity-verifications/{verification_id}/aml-events`
|
|
5625
|
+
*/
|
|
5626
|
+
async amlEvents(verificationId, options) {
|
|
5627
|
+
return this.request(
|
|
5628
|
+
"GET",
|
|
5629
|
+
`/identity-verifications/${encodeURIComponent(verificationId)}/aml-events`,
|
|
5630
|
+
options
|
|
5631
|
+
);
|
|
5632
|
+
}
|
|
5633
|
+
/**
|
|
5634
|
+
* A payment's screening by the transaction monitoring of the shop's
|
|
5635
|
+
* screening account. Recorded only: it never holds or refuses the payment.
|
|
5636
|
+
* Answers 404 when the payment has no screening. Needs permission to read
|
|
5637
|
+
* payments.
|
|
5638
|
+
*
|
|
5639
|
+
* `GET /identity-verifications/payment-screenings/{payment_id}`
|
|
5640
|
+
*/
|
|
5641
|
+
async paymentScreening(paymentId, options) {
|
|
5642
|
+
return this.request(
|
|
5643
|
+
"GET",
|
|
5644
|
+
`/identity-verifications/payment-screenings/${encodeURIComponent(paymentId)}`,
|
|
5645
|
+
options
|
|
5646
|
+
);
|
|
5647
|
+
}
|
|
5648
|
+
/**
|
|
5649
|
+
* Whether an account screens its shop's payments. Needs permission to read
|
|
5650
|
+
* connectors.
|
|
5651
|
+
*
|
|
5652
|
+
* `GET /identity-verifications/accounts/{merchant_connector_id}/payment-screening`
|
|
5653
|
+
*/
|
|
5654
|
+
async paymentScreeningSetting(merchantConnectorId, options) {
|
|
5655
|
+
return this.request(
|
|
5656
|
+
"GET",
|
|
5657
|
+
`/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/payment-screening`,
|
|
5658
|
+
options
|
|
5659
|
+
);
|
|
5660
|
+
}
|
|
5661
|
+
/**
|
|
5662
|
+
* Switch screening of the account's shop's payments. Switched on, every
|
|
5663
|
+
* payment of the shop that succeeds from then on is screened shortly after,
|
|
5664
|
+
* in the payment's own environment. A shop has at most one screening
|
|
5665
|
+
* account. Needs permission to edit connectors.
|
|
5666
|
+
*
|
|
5667
|
+
* `PUT /identity-verifications/accounts/{merchant_connector_id}/payment-screening`
|
|
5668
|
+
*/
|
|
5669
|
+
async updatePaymentScreeningSetting(merchantConnectorId, params, options) {
|
|
5670
|
+
return this.request(
|
|
5671
|
+
"PUT",
|
|
5672
|
+
`/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/payment-screening`,
|
|
5673
|
+
{ body: params, ...options }
|
|
5674
|
+
);
|
|
5675
|
+
}
|
|
5516
5676
|
};
|
|
5517
5677
|
|
|
5518
5678
|
// src/resources/webhooks.ts
|
|
@@ -6251,6 +6411,110 @@ var ShopLabels = class {
|
|
|
6251
6411
|
}
|
|
6252
6412
|
};
|
|
6253
6413
|
|
|
6414
|
+
// src/resources/checkoutTemplates.ts
|
|
6415
|
+
var CheckoutTemplates = class {
|
|
6416
|
+
constructor(request) {
|
|
6417
|
+
this.request = request;
|
|
6418
|
+
}
|
|
6419
|
+
/**
|
|
6420
|
+
* The merchant's templates, each with the shops on it and whether each
|
|
6421
|
+
* runs the template's current settings.
|
|
6422
|
+
* `GET /checkout-templates/{merchantId}`
|
|
6423
|
+
*/
|
|
6424
|
+
async list(merchantId) {
|
|
6425
|
+
return this.request("GET", `/checkout-templates/${encodeURIComponent(merchantId)}`);
|
|
6426
|
+
}
|
|
6427
|
+
/**
|
|
6428
|
+
* Create a template, empty or copied from a shop's current settings. The
|
|
6429
|
+
* shop copied from is not changed.
|
|
6430
|
+
* `POST /checkout-templates/{merchantId}`
|
|
6431
|
+
*/
|
|
6432
|
+
async create(merchantId, params) {
|
|
6433
|
+
return this.request("POST", `/checkout-templates/${encodeURIComponent(merchantId)}`, {
|
|
6434
|
+
body: params
|
|
6435
|
+
});
|
|
6436
|
+
}
|
|
6437
|
+
/** `GET /checkout-templates/{merchantId}/{templateId}` */
|
|
6438
|
+
async retrieve(merchantId, templateId) {
|
|
6439
|
+
return this.request(
|
|
6440
|
+
"GET",
|
|
6441
|
+
`/checkout-templates/${encodeURIComponent(merchantId)}/${encodeURIComponent(templateId)}`
|
|
6442
|
+
);
|
|
6443
|
+
}
|
|
6444
|
+
/**
|
|
6445
|
+
* Rename a template. A name another template of the merchant holds is
|
|
6446
|
+
* refused.
|
|
6447
|
+
* `POST /checkout-templates/{merchantId}/{templateId}`
|
|
6448
|
+
*/
|
|
6449
|
+
async rename(merchantId, templateId, params) {
|
|
6450
|
+
return this.request(
|
|
6451
|
+
"POST",
|
|
6452
|
+
`/checkout-templates/${encodeURIComponent(merchantId)}/${encodeURIComponent(templateId)}`,
|
|
6453
|
+
{ body: params }
|
|
6454
|
+
);
|
|
6455
|
+
}
|
|
6456
|
+
/**
|
|
6457
|
+
* Delete a template. Refused while a shop is on it.
|
|
6458
|
+
* `DELETE /checkout-templates/{merchantId}/{templateId}`
|
|
6459
|
+
*/
|
|
6460
|
+
async delete(merchantId, templateId) {
|
|
6461
|
+
return this.request(
|
|
6462
|
+
"DELETE",
|
|
6463
|
+
`/checkout-templates/${encodeURIComponent(merchantId)}/${encodeURIComponent(templateId)}`
|
|
6464
|
+
);
|
|
6465
|
+
}
|
|
6466
|
+
/**
|
|
6467
|
+
* Put shops on the template and copy its settings into them; a shop on
|
|
6468
|
+
* another template moves. Each shop is reported on its own: one with
|
|
6469
|
+
* `blockers` is left unchanged. `dry_run` changes nothing and reports what
|
|
6470
|
+
* would change.
|
|
6471
|
+
* `POST /checkout-templates/{merchantId}/{templateId}/shops`
|
|
6472
|
+
*/
|
|
6473
|
+
async assign(merchantId, templateId, params) {
|
|
6474
|
+
return this.request(
|
|
6475
|
+
"POST",
|
|
6476
|
+
`/checkout-templates/${encodeURIComponent(merchantId)}/${encodeURIComponent(templateId)}/shops`,
|
|
6477
|
+
{
|
|
6478
|
+
body: params
|
|
6479
|
+
}
|
|
6480
|
+
);
|
|
6481
|
+
}
|
|
6482
|
+
/**
|
|
6483
|
+
* Take a shop off the template. It keeps every setting it has, as its own.
|
|
6484
|
+
* `DELETE /checkout-templates/{merchantId}/{templateId}/shops/{profileId}`
|
|
6485
|
+
*/
|
|
6486
|
+
async unassign(merchantId, templateId, profileId) {
|
|
6487
|
+
return this.request(
|
|
6488
|
+
"DELETE",
|
|
6489
|
+
`/checkout-templates/${encodeURIComponent(merchantId)}/${encodeURIComponent(templateId)}/shops/${encodeURIComponent(profileId)}`
|
|
6490
|
+
);
|
|
6491
|
+
}
|
|
6492
|
+
/**
|
|
6493
|
+
* Copy the template's current settings into its shops, all or the ones
|
|
6494
|
+
* named.
|
|
6495
|
+
* `POST /checkout-templates/{merchantId}/{templateId}/apply`
|
|
6496
|
+
*/
|
|
6497
|
+
async apply(merchantId, templateId, params = {}) {
|
|
6498
|
+
return this.request(
|
|
6499
|
+
"POST",
|
|
6500
|
+
`/checkout-templates/${encodeURIComponent(merchantId)}/${encodeURIComponent(templateId)}/apply`,
|
|
6501
|
+
{
|
|
6502
|
+
body: params
|
|
6503
|
+
}
|
|
6504
|
+
);
|
|
6505
|
+
}
|
|
6506
|
+
/**
|
|
6507
|
+
* The template a shop is on, if any. Readable by the shop's own members.
|
|
6508
|
+
* `GET /checkout-templates/{merchantId}/shops/{profileId}`
|
|
6509
|
+
*/
|
|
6510
|
+
async ofShop(merchantId, profileId) {
|
|
6511
|
+
return this.request(
|
|
6512
|
+
"GET",
|
|
6513
|
+
`/checkout-templates/${encodeURIComponent(merchantId)}/shops/${encodeURIComponent(profileId)}`
|
|
6514
|
+
);
|
|
6515
|
+
}
|
|
6516
|
+
};
|
|
6517
|
+
|
|
6254
6518
|
// src/resources/buyerConversations.ts
|
|
6255
6519
|
var BuyerConversations = class {
|
|
6256
6520
|
constructor(request) {
|
|
@@ -9502,6 +9766,167 @@ var Live = class {
|
|
|
9502
9766
|
}
|
|
9503
9767
|
};
|
|
9504
9768
|
|
|
9769
|
+
// src/resources/processorImports.ts
|
|
9770
|
+
function toPspImportStreamEvent(event) {
|
|
9771
|
+
switch (event.type) {
|
|
9772
|
+
case "progress": {
|
|
9773
|
+
let run;
|
|
9774
|
+
try {
|
|
9775
|
+
run = JSON.parse(event.data);
|
|
9776
|
+
} catch {
|
|
9777
|
+
return null;
|
|
9778
|
+
}
|
|
9779
|
+
if (run === null || typeof run !== "object" || Array.isArray(run)) return null;
|
|
9780
|
+
return { type: "progress", run };
|
|
9781
|
+
}
|
|
9782
|
+
case "done":
|
|
9783
|
+
return { type: "done" };
|
|
9784
|
+
default:
|
|
9785
|
+
return null;
|
|
9786
|
+
}
|
|
9787
|
+
}
|
|
9788
|
+
var PspImportEventStream = class {
|
|
9789
|
+
constructor(connection) {
|
|
9790
|
+
this.connection = connection;
|
|
9791
|
+
}
|
|
9792
|
+
/** Close the stream; the iteration ends without an error. */
|
|
9793
|
+
close() {
|
|
9794
|
+
this.connection.close();
|
|
9795
|
+
}
|
|
9796
|
+
[Symbol.asyncIterator]() {
|
|
9797
|
+
this.iterator ?? (this.iterator = this.events());
|
|
9798
|
+
return this.iterator;
|
|
9799
|
+
}
|
|
9800
|
+
async *events() {
|
|
9801
|
+
for await (const dispatch of this.connection.dispatches) {
|
|
9802
|
+
if (!dispatch.event) continue;
|
|
9803
|
+
const event = toPspImportStreamEvent(dispatch.event);
|
|
9804
|
+
if (event) yield event;
|
|
9805
|
+
}
|
|
9806
|
+
}
|
|
9807
|
+
};
|
|
9808
|
+
var ProcessorImports = class {
|
|
9809
|
+
constructor(request, openStream) {
|
|
9810
|
+
this.request = request;
|
|
9811
|
+
this.openStream = openStream;
|
|
9812
|
+
}
|
|
9813
|
+
/**
|
|
9814
|
+
* Every connected processor account the caller may see, with what each can
|
|
9815
|
+
* provide in the environment: listed, read payment by payment, or
|
|
9816
|
+
* unavailable with a reason.
|
|
9817
|
+
*
|
|
9818
|
+
* `GET /refunds-disputes/imports/sources`
|
|
9819
|
+
*/
|
|
9820
|
+
async sources(params) {
|
|
9821
|
+
return this.request("GET", "/refunds-disputes/imports/sources", {
|
|
9822
|
+
query: { test_mode: params.test_mode }
|
|
9823
|
+
});
|
|
9824
|
+
}
|
|
9825
|
+
/**
|
|
9826
|
+
* Start an import. A source a processor cannot provide is stored as
|
|
9827
|
+
* `unavailable` with its reason. Refused while another import of the
|
|
9828
|
+
* merchant runs in the same environment.
|
|
9829
|
+
*
|
|
9830
|
+
* `POST /refunds-disputes/imports`
|
|
9831
|
+
*/
|
|
9832
|
+
async create(request) {
|
|
9833
|
+
return this.request("POST", "/refunds-disputes/imports", { body: request });
|
|
9834
|
+
}
|
|
9835
|
+
/**
|
|
9836
|
+
* The newest import in the environment, running or finished.
|
|
9837
|
+
*
|
|
9838
|
+
* `GET /refunds-disputes/imports/latest`
|
|
9839
|
+
*/
|
|
9840
|
+
async latest(params) {
|
|
9841
|
+
return this.request("GET", "/refunds-disputes/imports/latest", {
|
|
9842
|
+
query: { test_mode: params.test_mode }
|
|
9843
|
+
});
|
|
9844
|
+
}
|
|
9845
|
+
/** `GET /refunds-disputes/imports/{id}` */
|
|
9846
|
+
async retrieve(id) {
|
|
9847
|
+
return this.request("GET", `/refunds-disputes/imports/${encodeURIComponent(id)}`);
|
|
9848
|
+
}
|
|
9849
|
+
/**
|
|
9850
|
+
* The records an import left out or could not record, each with its reason.
|
|
9851
|
+
*
|
|
9852
|
+
* `GET /refunds-disputes/imports/{id}/issues`
|
|
9853
|
+
*/
|
|
9854
|
+
async issues(id, params) {
|
|
9855
|
+
return this.request("GET", `/refunds-disputes/imports/${encodeURIComponent(id)}/issues`, {
|
|
9856
|
+
query: { limit: params?.limit, offset: params?.offset }
|
|
9857
|
+
});
|
|
9858
|
+
}
|
|
9859
|
+
/**
|
|
9860
|
+
* Ask a running import to stop. It stops after the page it is reading;
|
|
9861
|
+
* what it recorded stays recorded.
|
|
9862
|
+
*
|
|
9863
|
+
* `POST /refunds-disputes/imports/{id}/cancel`
|
|
9864
|
+
*/
|
|
9865
|
+
async cancel(id) {
|
|
9866
|
+
return this.request("POST", `/refunds-disputes/imports/${encodeURIComponent(id)}/cancel`);
|
|
9867
|
+
}
|
|
9868
|
+
/**
|
|
9869
|
+
* Open the progress stream of an import. Resolves once the server answered;
|
|
9870
|
+
* a `401` rejects with `DelopayAuthenticationError`.
|
|
9871
|
+
*
|
|
9872
|
+
* `GET /refunds-disputes/imports/{id}/stream`
|
|
9873
|
+
*
|
|
9874
|
+
* @example
|
|
9875
|
+
* ```typescript
|
|
9876
|
+
* const stream = await delopay.processorImports.stream(run.id, { signal });
|
|
9877
|
+
* for await (const event of stream) {
|
|
9878
|
+
* if (event.type === 'progress') render(event.run);
|
|
9879
|
+
* }
|
|
9880
|
+
* ```
|
|
9881
|
+
*/
|
|
9882
|
+
async stream(id, options = {}) {
|
|
9883
|
+
const connection = await this.openStream(
|
|
9884
|
+
`/refunds-disputes/imports/${encodeURIComponent(id)}/stream`,
|
|
9885
|
+
{
|
|
9886
|
+
...options.signal ? { signal: options.signal } : {},
|
|
9887
|
+
...options.idleTimeoutMs !== void 0 ? { idleTimeoutMs: options.idleTimeoutMs } : {},
|
|
9888
|
+
...options.headers ? { headers: options.headers } : {}
|
|
9889
|
+
}
|
|
9890
|
+
);
|
|
9891
|
+
return new PspImportEventStream(connection);
|
|
9892
|
+
}
|
|
9893
|
+
};
|
|
9894
|
+
|
|
9895
|
+
// src/resources/deploymentBranding.ts
|
|
9896
|
+
function brandingAssetPath(asset, version) {
|
|
9897
|
+
const path = `/branding/assets/${encodeURIComponent(asset)}`;
|
|
9898
|
+
return version ? `${path}?v=${encodeURIComponent(version)}` : path;
|
|
9899
|
+
}
|
|
9900
|
+
var Branding = class {
|
|
9901
|
+
constructor(request, baseUrl) {
|
|
9902
|
+
this.request = request;
|
|
9903
|
+
this.baseUrl = baseUrl;
|
|
9904
|
+
}
|
|
9905
|
+
/**
|
|
9906
|
+
* The saved branding. A `null` field means "keep your own default".
|
|
9907
|
+
*
|
|
9908
|
+
* Branding is cosmetic, so treat any failure as "nothing saved": routers
|
|
9909
|
+
* from before this route answer 404, and a page must never wait long for
|
|
9910
|
+
* it. Pass a `signal` (e.g. `AbortSignal.timeout(2500)`) to bound the call
|
|
9911
|
+
* including its retries; a `timeout` alone applies to each attempt.
|
|
9912
|
+
*
|
|
9913
|
+
* `GET /branding`
|
|
9914
|
+
*/
|
|
9915
|
+
async retrieve(options) {
|
|
9916
|
+
return this.request("GET", "/branding", { ...options });
|
|
9917
|
+
}
|
|
9918
|
+
/**
|
|
9919
|
+
* The address of one branding image or font file on this client's base
|
|
9920
|
+
* URL, for an `<img src>` or a `@font-face` `src`. See
|
|
9921
|
+
* {@link brandingAssetPath}.
|
|
9922
|
+
*
|
|
9923
|
+
* `GET /branding/assets/{asset}`
|
|
9924
|
+
*/
|
|
9925
|
+
assetUrl(asset, version) {
|
|
9926
|
+
return `${this.baseUrl}${brandingAssetPath(asset, version)}`;
|
|
9927
|
+
}
|
|
9928
|
+
};
|
|
9929
|
+
|
|
9505
9930
|
// src/client.ts
|
|
9506
9931
|
var PRODUCTION_URL = "https://api.delopay.net";
|
|
9507
9932
|
var SANDBOX_URL = "https://sandbox.delopay.net";
|
|
@@ -9781,6 +10206,8 @@ var Delopay = class {
|
|
|
9781
10206
|
this.messageTemplates = new MessageTemplates(request);
|
|
9782
10207
|
this.risk = new Risk(request);
|
|
9783
10208
|
this.live = new Live(request, openStream);
|
|
10209
|
+
this.processorImports = new ProcessorImports(request, openStream);
|
|
10210
|
+
this.branding = new Branding(request, this.baseUrl);
|
|
9784
10211
|
this.subscriptions = new Subscriptions(request);
|
|
9785
10212
|
this.buyerPortal = new BuyerPortal(request);
|
|
9786
10213
|
this.buyerAccount = new BuyerAccount(request);
|
|
@@ -9792,6 +10219,7 @@ var Delopay = class {
|
|
|
9792
10219
|
this.sellToRestrictions = new SellToRestrictions(request);
|
|
9793
10220
|
this.buyerBlocklist = new BuyerBlocklist(request);
|
|
9794
10221
|
this.shopLabels = new ShopLabels(request);
|
|
10222
|
+
this.checkoutTemplates = new CheckoutTemplates(request);
|
|
9795
10223
|
this.buyerConversations = new BuyerConversations(request);
|
|
9796
10224
|
this.buyerEvidence = new BuyerEvidenceReviews(request);
|
|
9797
10225
|
this.checkoutRecovery = new CheckoutRecovery(request);
|
|
@@ -14063,6 +14491,25 @@ var CheckoutSession = class {
|
|
|
14063
14491
|
headers: this.bearerHeaders(options?.headers)
|
|
14064
14492
|
});
|
|
14065
14493
|
}
|
|
14494
|
+
/**
|
|
14495
|
+
* Reserve this payment attempt before a hosted card form contacts Stripe,
|
|
14496
|
+
* Airwallex, or NomuPay. Send the provider object rendered to this checkout
|
|
14497
|
+
* and retain the same `flow_id` across retries and any 3-D Secure step.
|
|
14498
|
+
*
|
|
14499
|
+
* Only `authorized: true` permits the form to contact its processor. A
|
|
14500
|
+
* competing flow receives `false` and must reload; an unresolved provider
|
|
14501
|
+
* outcome stays reserved, regardless of elapsed time. A buyer-blocklist
|
|
14502
|
+
* refusal throws a `DelopayError` with code `DE_14`.
|
|
14503
|
+
*
|
|
14504
|
+
* `POST /payment-link/{merchantId}/{paymentId}/browser-card-claim`
|
|
14505
|
+
*/
|
|
14506
|
+
async claimBrowserCard(params, options) {
|
|
14507
|
+
return this.client.request("POST", `${this.linkBase}/browser-card-claim`, {
|
|
14508
|
+
body: params,
|
|
14509
|
+
...options,
|
|
14510
|
+
headers: this.bearerHeaders(options?.headers)
|
|
14511
|
+
});
|
|
14512
|
+
}
|
|
14066
14513
|
/**
|
|
14067
14514
|
* Confirm the Stripe card form's PaymentIntent through the router, for a
|
|
14068
14515
|
* checkout payload with `card_connector_server_confirm: true`. Stripe refuses
|
|
@@ -14084,6 +14531,10 @@ var CheckoutSession = class {
|
|
|
14084
14531
|
* and that secret confirms nothing without the secret key — then call this
|
|
14085
14532
|
* again without a payment method to finalize.
|
|
14086
14533
|
*
|
|
14534
|
+
* Reserve the attempt with {@link claimBrowserCard} first. Send its granted
|
|
14535
|
+
* `flow_id` as `browser_flow_id` on both the initial and post-action confirm;
|
|
14536
|
+
* an omitted, null or nonholder flow is refused with `400` and code `IR_16`.
|
|
14537
|
+
*
|
|
14087
14538
|
* A PaymentMethod rules out what `stripe.createPaymentMethod` cannot
|
|
14088
14539
|
* produce: Stripe names Amazon Pay and Klarna in the Express Checkout
|
|
14089
14540
|
* Element, which need `stripe.createConfirmationToken` instead. Neither can
|
|
@@ -14947,6 +15398,7 @@ var encodeNativePanes = encodePanes;
|
|
|
14947
15398
|
BRANDING_EXPORT_FORMAT,
|
|
14948
15399
|
BRANDING_EXPORT_VERSION,
|
|
14949
15400
|
BUILTIN_PAYMENT_ICON_KEYS,
|
|
15401
|
+
Branding,
|
|
14950
15402
|
BuyerBlocklist,
|
|
14951
15403
|
BuyerConversations,
|
|
14952
15404
|
BuyerEvidenceReviews,
|
|
@@ -14968,6 +15420,7 @@ var encodeNativePanes = encodePanes;
|
|
|
14968
15420
|
CheckoutMethods,
|
|
14969
15421
|
CheckoutRecovery,
|
|
14970
15422
|
CheckoutSession,
|
|
15423
|
+
CheckoutTemplates,
|
|
14971
15424
|
CostRules,
|
|
14972
15425
|
DEFAULT_BADGES,
|
|
14973
15426
|
DEFAULT_BADGES_DARK,
|
|
@@ -15017,7 +15470,9 @@ var encodeNativePanes = encodePanes;
|
|
|
15017
15470
|
PaypalDisputes,
|
|
15018
15471
|
PresentationCache,
|
|
15019
15472
|
ProcessorCosts,
|
|
15473
|
+
ProcessorImports,
|
|
15020
15474
|
Products,
|
|
15475
|
+
PspImportEventStream,
|
|
15021
15476
|
RTL_CHECKOUT_LOCALES,
|
|
15022
15477
|
Regions,
|
|
15023
15478
|
Risk,
|
|
@@ -15069,6 +15524,7 @@ var encodeNativePanes = encodePanes;
|
|
|
15069
15524
|
anyOf,
|
|
15070
15525
|
applyBrandingVariables,
|
|
15071
15526
|
asAirwallexCardPreset,
|
|
15527
|
+
brandingAssetPath,
|
|
15072
15528
|
buildBrandingExport,
|
|
15073
15529
|
builtinPaymentIconDataUri,
|
|
15074
15530
|
builtinPaymentIconSvg,
|