@delopay/sdk 0.108.0 → 0.111.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-C2O3D7ZM.js → chunk-TS422PA3.js} +235 -33
- package/dist/chunk-TS422PA3.js.map +1 -0
- package/dist/index.cjs +249 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +647 -104
- package/dist/index.d.ts +647 -104
- package/dist/index.js +37 -1
- package/dist/internal.cjs +249 -29
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +81 -2
- package/dist/internal.d.ts +81 -2
- package/dist/internal.js +37 -1
- package/dist/internal.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-C2O3D7ZM.js.map +0 -1
|
@@ -484,23 +484,38 @@ var Connectors = class {
|
|
|
484
484
|
);
|
|
485
485
|
}
|
|
486
486
|
/**
|
|
487
|
-
* Every connector's
|
|
488
|
-
*
|
|
489
|
-
*
|
|
487
|
+
* Every connector's pane capabilities, as the router itself knows them —
|
|
488
|
+
* which rails a connector supports, and which methods it can publish as a
|
|
489
|
+
* pane with the confirm routing keys each one carries.
|
|
490
490
|
*
|
|
491
491
|
* Capability facts only: no label, sublabel or category comes back. A
|
|
492
492
|
* designer renders a method's copy from its own locale files, keyed by
|
|
493
493
|
* `key`, and takes `payment_method` / `payment_method_type` from here
|
|
494
494
|
* verbatim rather than deriving them client-side.
|
|
495
495
|
*
|
|
496
|
+
* This is what the pane helpers in `src/panes.ts` should be driven from —
|
|
497
|
+
* `paneMethodInfo`, `defaultPane` and `validatePanes` all take a
|
|
498
|
+
* {@link PanesConnectorCatalog} out of this response, so a connector the
|
|
499
|
+
* router starts publishing panes for needs no SDK release.
|
|
500
|
+
*
|
|
496
501
|
* `GET /account/{accountId}/connectors/native-panes/catalog`
|
|
502
|
+
*
|
|
503
|
+
* The path keeps the `native-panes` spelling deliberately. The identifiers
|
|
504
|
+
* were renamed off "native pane"; the route was not, and pointing at the
|
|
505
|
+
* backend's new name before it is deployed everywhere would both 404 against
|
|
506
|
+
* un-upgraded replicas mid-rollout and fail `scripts/parity-check.mjs`,
|
|
507
|
+
* which blocks publishing.
|
|
497
508
|
*/
|
|
498
|
-
async
|
|
509
|
+
async getPanesCatalog(accountId) {
|
|
499
510
|
return this.request(
|
|
500
511
|
"GET",
|
|
501
512
|
`/account/${encodeURIComponent(accountId)}/connectors/native-panes/catalog`
|
|
502
513
|
);
|
|
503
514
|
}
|
|
515
|
+
/** @deprecated Renamed to {@link getPanesCatalog}. Removed in 0.112.0. */
|
|
516
|
+
async getNativePanesCatalog(accountId) {
|
|
517
|
+
return this.getPanesCatalog(accountId);
|
|
518
|
+
}
|
|
504
519
|
/**
|
|
505
520
|
* Sweep the merchant's own e-Payouts module and return the rails it
|
|
506
521
|
* actually has enabled. Server-side this makes many upstream calls, so it
|
|
@@ -3982,6 +3997,25 @@ var Subscriptions = class {
|
|
|
3982
3997
|
}
|
|
3983
3998
|
};
|
|
3984
3999
|
|
|
4000
|
+
// src/resources/audit.ts
|
|
4001
|
+
var Audit = class {
|
|
4002
|
+
constructor(request) {
|
|
4003
|
+
this.request = request;
|
|
4004
|
+
}
|
|
4005
|
+
async list(params) {
|
|
4006
|
+
return this.request("GET", "/audit", {
|
|
4007
|
+
query: params
|
|
4008
|
+
});
|
|
4009
|
+
}
|
|
4010
|
+
/**
|
|
4011
|
+
* One entry. An id belonging to another merchant answers 404, not 403 — the
|
|
4012
|
+
* endpoint does not confirm that an entry it will not serve exists.
|
|
4013
|
+
*/
|
|
4014
|
+
async retrieve(logId) {
|
|
4015
|
+
return this.request("GET", `/audit/${encodeURIComponent(logId)}`);
|
|
4016
|
+
}
|
|
4017
|
+
};
|
|
4018
|
+
|
|
3985
4019
|
// src/resources/settlement.ts
|
|
3986
4020
|
var Settlement = class {
|
|
3987
4021
|
constructor(request) {
|
|
@@ -4483,6 +4517,7 @@ var Delopay = class {
|
|
|
4483
4517
|
this.relay = new Relay(request);
|
|
4484
4518
|
this.stripeConnect = new StripeConnect(request);
|
|
4485
4519
|
this.threeDsRules = new ThreeDsRules(request);
|
|
4520
|
+
this.audit = new Audit(request);
|
|
4486
4521
|
this.settlement = new Settlement(request);
|
|
4487
4522
|
this.operationLimits = new OperationLimits(request);
|
|
4488
4523
|
this.risk = new Risk(request);
|
|
@@ -6261,11 +6296,23 @@ var CheckoutSession = class {
|
|
|
6261
6296
|
}
|
|
6262
6297
|
};
|
|
6263
6298
|
|
|
6264
|
-
// src/
|
|
6265
|
-
var
|
|
6299
|
+
// src/panes.ts
|
|
6300
|
+
var PANE_VISIBILITIES = ["always", "embedded_only", "external_only"];
|
|
6301
|
+
function parseVisibility(raw) {
|
|
6302
|
+
return PANE_VISIBILITIES.find((value) => value === raw) ?? "always";
|
|
6303
|
+
}
|
|
6304
|
+
function paneViewVisibility(view) {
|
|
6305
|
+
const declared = PANE_VISIBILITIES.find((value) => value === view.visibility);
|
|
6306
|
+
if (declared) return declared;
|
|
6307
|
+
return view.embedded_only === true ? "embedded_only" : "always";
|
|
6308
|
+
}
|
|
6309
|
+
var STRIPE_FALLBACK_PANE_METHODS = [
|
|
6266
6310
|
{
|
|
6267
6311
|
key: "apple_pay",
|
|
6268
6312
|
rail: "wallet",
|
|
6313
|
+
paymentMethod: "wallet",
|
|
6314
|
+
paymentMethodType: "apple_pay",
|
|
6315
|
+
requiresBillingCountry: false,
|
|
6269
6316
|
defaultLabel: "Apple Pay",
|
|
6270
6317
|
defaultSublabel: "Pay with Apple Pay",
|
|
6271
6318
|
defaultCategory: "wallet",
|
|
@@ -6274,6 +6321,9 @@ var STRIPE_NATIVE_PANE_METHODS = [
|
|
|
6274
6321
|
{
|
|
6275
6322
|
key: "google_pay",
|
|
6276
6323
|
rail: "wallet",
|
|
6324
|
+
paymentMethod: "wallet",
|
|
6325
|
+
paymentMethodType: "google_pay",
|
|
6326
|
+
requiresBillingCountry: false,
|
|
6277
6327
|
defaultLabel: "Google Pay",
|
|
6278
6328
|
defaultSublabel: "Pay with Google Pay",
|
|
6279
6329
|
defaultCategory: "wallet",
|
|
@@ -6282,6 +6332,9 @@ var STRIPE_NATIVE_PANE_METHODS = [
|
|
|
6282
6332
|
{
|
|
6283
6333
|
key: "link",
|
|
6284
6334
|
rail: "wallet",
|
|
6335
|
+
paymentMethod: "wallet",
|
|
6336
|
+
paymentMethodType: "link",
|
|
6337
|
+
requiresBillingCountry: false,
|
|
6285
6338
|
defaultLabel: "Link",
|
|
6286
6339
|
defaultSublabel: "Pay with saved details",
|
|
6287
6340
|
defaultCategory: "wallet",
|
|
@@ -6290,7 +6343,18 @@ var STRIPE_NATIVE_PANE_METHODS = [
|
|
|
6290
6343
|
{
|
|
6291
6344
|
key: "klarna",
|
|
6292
6345
|
rail: "redirect",
|
|
6346
|
+
paymentMethod: "pay_later",
|
|
6347
|
+
paymentMethodType: "klarna",
|
|
6348
|
+
// Stripe's Klarna needs the buyer's country echoed into the confirm body.
|
|
6349
|
+
requiresBillingCountry: true,
|
|
6293
6350
|
defaultLabel: "Klarna",
|
|
6351
|
+
// NOT the router's current "Pay later or in 3 instalments". This table is
|
|
6352
|
+
// what a router predating the capability endpoint (delopay-backend#964)
|
|
6353
|
+
// renders, and that copy only gained the "3" in delopay-backend#1051 —
|
|
6354
|
+
// the same release that added the endpoint. Restating the new string here
|
|
6355
|
+
// would put copy no reachable router emits in front of a merchant, and
|
|
6356
|
+
// would change what the deprecated `nativePaneMethodInfo` has returned
|
|
6357
|
+
// since 0.106.0.
|
|
6294
6358
|
defaultSublabel: "Pay later or in instalments",
|
|
6295
6359
|
defaultCategory: "bnpl",
|
|
6296
6360
|
defaultIcon: "bnpl"
|
|
@@ -6298,6 +6362,9 @@ var STRIPE_NATIVE_PANE_METHODS = [
|
|
|
6298
6362
|
{
|
|
6299
6363
|
key: "affirm",
|
|
6300
6364
|
rail: "redirect",
|
|
6365
|
+
paymentMethod: "pay_later",
|
|
6366
|
+
paymentMethodType: "affirm",
|
|
6367
|
+
requiresBillingCountry: false,
|
|
6301
6368
|
defaultLabel: "Affirm",
|
|
6302
6369
|
defaultSublabel: "Pay over time",
|
|
6303
6370
|
defaultCategory: "bnpl",
|
|
@@ -6306,18 +6373,20 @@ var STRIPE_NATIVE_PANE_METHODS = [
|
|
|
6306
6373
|
{
|
|
6307
6374
|
key: "ideal",
|
|
6308
6375
|
rail: "redirect",
|
|
6376
|
+
paymentMethod: "bank_redirect",
|
|
6377
|
+
paymentMethodType: "ideal",
|
|
6378
|
+
requiresBillingCountry: false,
|
|
6309
6379
|
defaultLabel: "iDEAL",
|
|
6310
6380
|
defaultSublabel: "Pay from your bank",
|
|
6311
6381
|
defaultCategory: "bank_redirect",
|
|
6312
6382
|
defaultIcon: "bank"
|
|
6313
6383
|
},
|
|
6314
|
-
// eps / p24 / bancontact were removed from the router catalog: Stripe
|
|
6315
|
-
// hard-requires billing fields the focused checkout never collects (full
|
|
6316
|
-
// name for EPS/Bancontact, email for Przelewy24), so their tiles could
|
|
6317
|
-
// never succeed. They may return behind billing-aware gating.
|
|
6318
6384
|
{
|
|
6319
6385
|
key: "alipay",
|
|
6320
6386
|
rail: "redirect",
|
|
6387
|
+
paymentMethod: "wallet",
|
|
6388
|
+
paymentMethodType: "ali_pay",
|
|
6389
|
+
requiresBillingCountry: false,
|
|
6321
6390
|
defaultLabel: "Alipay",
|
|
6322
6391
|
defaultSublabel: "Pay with Alipay",
|
|
6323
6392
|
defaultCategory: "wallet",
|
|
@@ -6326,6 +6395,9 @@ var STRIPE_NATIVE_PANE_METHODS = [
|
|
|
6326
6395
|
{
|
|
6327
6396
|
key: "revolut_pay",
|
|
6328
6397
|
rail: "redirect",
|
|
6398
|
+
paymentMethod: "wallet",
|
|
6399
|
+
paymentMethodType: "revolut_pay",
|
|
6400
|
+
requiresBillingCountry: false,
|
|
6329
6401
|
defaultLabel: "Revolut Pay",
|
|
6330
6402
|
defaultSublabel: "Pay with Revolut",
|
|
6331
6403
|
defaultCategory: "wallet",
|
|
@@ -6334,35 +6406,120 @@ var STRIPE_NATIVE_PANE_METHODS = [
|
|
|
6334
6406
|
{
|
|
6335
6407
|
key: "amazon_pay",
|
|
6336
6408
|
rail: "redirect",
|
|
6409
|
+
paymentMethod: "wallet",
|
|
6410
|
+
paymentMethodType: "amazon_pay",
|
|
6411
|
+
requiresBillingCountry: false,
|
|
6337
6412
|
defaultLabel: "Amazon Pay",
|
|
6338
6413
|
defaultSublabel: "Pay with Amazon",
|
|
6339
6414
|
defaultCategory: "wallet",
|
|
6340
6415
|
defaultIcon: "wallet"
|
|
6341
6416
|
}
|
|
6342
6417
|
];
|
|
6343
|
-
var
|
|
6418
|
+
var STRIPE_FALLBACK_PANE_CATALOG = {
|
|
6419
|
+
connector: "stripe",
|
|
6420
|
+
allowed_rails: ["wallet", "redirect"],
|
|
6421
|
+
methods: STRIPE_FALLBACK_PANE_METHODS.map((info) => ({
|
|
6422
|
+
key: info.key,
|
|
6423
|
+
rail: info.rail,
|
|
6424
|
+
payment_method: info.paymentMethod,
|
|
6425
|
+
payment_method_type: info.paymentMethodType,
|
|
6426
|
+
requires_billing_country: info.requiresBillingCountry
|
|
6427
|
+
}))
|
|
6428
|
+
};
|
|
6429
|
+
function emptyPaneCatalog(connector) {
|
|
6430
|
+
return { connector, allowed_rails: [], methods: [] };
|
|
6431
|
+
}
|
|
6432
|
+
function paneCatalogFor(response, connector) {
|
|
6433
|
+
return response.connectors.find((entry) => entry.connector === connector) ?? emptyPaneCatalog(connector);
|
|
6434
|
+
}
|
|
6435
|
+
var PANE_ICON_KEYS = [
|
|
6344
6436
|
"wallet",
|
|
6345
6437
|
"card",
|
|
6346
6438
|
"bank",
|
|
6347
6439
|
"apple",
|
|
6348
6440
|
"google",
|
|
6349
6441
|
"bnpl",
|
|
6350
|
-
"cash"
|
|
6442
|
+
"cash",
|
|
6443
|
+
// Brand marks, not category glyphs: the checkout draws PayPal's monogram,
|
|
6444
|
+
// Klarna's squircle-K and the Bitcoin mark for these, the same logos the
|
|
6445
|
+
// bespoke panes they replace already drew. Listed here so a merchant's own
|
|
6446
|
+
// dashboard can offer them; the router decides which one a tile *defaults*
|
|
6447
|
+
// to, and a router predating them simply keeps sending the old default.
|
|
6448
|
+
"paypal",
|
|
6449
|
+
"klarna",
|
|
6450
|
+
"crypto"
|
|
6351
6451
|
];
|
|
6352
|
-
var
|
|
6452
|
+
var PANE_CATEGORY_KEYS = [
|
|
6353
6453
|
"wallet",
|
|
6354
6454
|
"card",
|
|
6355
6455
|
"bnpl",
|
|
6356
6456
|
"bank_redirect",
|
|
6357
6457
|
"bank_transfer",
|
|
6458
|
+
"crypto",
|
|
6459
|
+
"game_items",
|
|
6358
6460
|
"cash"
|
|
6359
6461
|
];
|
|
6360
|
-
var
|
|
6361
|
-
function
|
|
6362
|
-
return
|
|
6462
|
+
var PANES_MAX = 12;
|
|
6463
|
+
function paneMethodInfo(method, catalog = STRIPE_FALLBACK_PANE_CATALOG) {
|
|
6464
|
+
return catalog.methods.find((info) => info.key === method);
|
|
6363
6465
|
}
|
|
6364
|
-
function
|
|
6365
|
-
|
|
6466
|
+
function paneRailAllowed(rail, catalog) {
|
|
6467
|
+
return catalog.allowed_rails.includes(rail);
|
|
6468
|
+
}
|
|
6469
|
+
function offerablePaneMethods(catalog) {
|
|
6470
|
+
return catalog.methods.filter((info) => paneRailAllowed(info.rail, catalog));
|
|
6471
|
+
}
|
|
6472
|
+
var DISPLAY_DEFAULTS_BY_KEY = {
|
|
6473
|
+
apple_pay: { icon: "apple", category: "wallet" },
|
|
6474
|
+
google_pay: { icon: "google", category: "wallet" },
|
|
6475
|
+
paypal: { icon: "paypal", category: "wallet" },
|
|
6476
|
+
// Both the Klarna connector's own tile and Stripe's Klarna. Affirm stays on
|
|
6477
|
+
// the generic `bnpl` glyph — same rail, no mark of its own.
|
|
6478
|
+
klarna: { icon: "klarna", category: "bnpl" }
|
|
6479
|
+
};
|
|
6480
|
+
var DISPLAY_DEFAULTS_BY_PAYMENT_METHOD = {
|
|
6481
|
+
wallet: { icon: "wallet", category: "wallet" },
|
|
6482
|
+
card: { icon: "card", category: "card" },
|
|
6483
|
+
card_redirect: { icon: "card", category: "card" },
|
|
6484
|
+
pay_later: { icon: "bnpl", category: "bnpl" },
|
|
6485
|
+
bank_redirect: { icon: "bank", category: "bank_redirect" },
|
|
6486
|
+
bank_transfer: { icon: "bank", category: "bank_transfer" },
|
|
6487
|
+
bank_debit: { icon: "bank", category: "bank_transfer" },
|
|
6488
|
+
// Cryptomus and NowPayments publish the same `crypto` key on this rail, and
|
|
6489
|
+
// the router defaults both to the Bitcoin mark.
|
|
6490
|
+
crypto: { icon: "crypto", category: "crypto" },
|
|
6491
|
+
// Skinsback, which has no mark: the router defaults it to `wallet` too.
|
|
6492
|
+
game_items: { icon: "wallet", category: "game_items" },
|
|
6493
|
+
cash: { icon: "cash", category: "cash" },
|
|
6494
|
+
voucher: { icon: "cash", category: "cash" }
|
|
6495
|
+
};
|
|
6496
|
+
var DISPLAY_DEFAULTS_FALLBACK = { icon: "wallet", category: "wallet" };
|
|
6497
|
+
function paneDisplayDefaults(info) {
|
|
6498
|
+
if (!info) return DISPLAY_DEFAULTS_FALLBACK;
|
|
6499
|
+
return DISPLAY_DEFAULTS_BY_KEY[info.key] ?? DISPLAY_DEFAULTS_BY_PAYMENT_METHOD[info.payment_method] ?? DISPLAY_DEFAULTS_FALLBACK;
|
|
6500
|
+
}
|
|
6501
|
+
function validatePanes(panes, catalog = STRIPE_FALLBACK_PANE_CATALOG) {
|
|
6502
|
+
const issues = [];
|
|
6503
|
+
const claimedBy = /* @__PURE__ */ new Set();
|
|
6504
|
+
panes.forEach((pane, index) => {
|
|
6505
|
+
const info = paneMethodInfo(pane.method, catalog);
|
|
6506
|
+
if (!info) {
|
|
6507
|
+
issues.push({ index, method: pane.method, code: "method_unknown" });
|
|
6508
|
+
} else if (!paneRailAllowed(info.rail, catalog)) {
|
|
6509
|
+
issues.push({ index, method: pane.method, code: "rail_not_allowed" });
|
|
6510
|
+
} else if (pane.enabled) {
|
|
6511
|
+
if (claimedBy.has(info.key)) {
|
|
6512
|
+
issues.push({ index, method: pane.method, code: "duplicate_method" });
|
|
6513
|
+
} else {
|
|
6514
|
+
claimedBy.add(info.key);
|
|
6515
|
+
}
|
|
6516
|
+
}
|
|
6517
|
+
if (index >= PANES_MAX) issues.push({ index, method: pane.method, code: "over_cap" });
|
|
6518
|
+
});
|
|
6519
|
+
return issues;
|
|
6520
|
+
}
|
|
6521
|
+
function defaultPane(method, catalog = STRIPE_FALLBACK_PANE_CATALOG) {
|
|
6522
|
+
const defaults = paneDisplayDefaults(paneMethodInfo(method, catalog));
|
|
6366
6523
|
return {
|
|
6367
6524
|
method,
|
|
6368
6525
|
enabled: true,
|
|
@@ -6370,15 +6527,15 @@ function defaultNativePane(method) {
|
|
|
6370
6527
|
labelTranslations: {},
|
|
6371
6528
|
sublabel: null,
|
|
6372
6529
|
sublabelTranslations: {},
|
|
6373
|
-
category:
|
|
6374
|
-
icon:
|
|
6530
|
+
category: defaults.category,
|
|
6531
|
+
icon: defaults.icon,
|
|
6375
6532
|
iconSvg: "",
|
|
6376
6533
|
displayOrder: 0,
|
|
6377
6534
|
visibility: "always",
|
|
6378
6535
|
openIn: "tab"
|
|
6379
6536
|
};
|
|
6380
6537
|
}
|
|
6381
|
-
function
|
|
6538
|
+
function clonePane(pane) {
|
|
6382
6539
|
return {
|
|
6383
6540
|
...pane,
|
|
6384
6541
|
labelTranslations: { ...pane.labelTranslations },
|
|
@@ -6405,7 +6562,7 @@ function clampDisplayOrder(raw) {
|
|
|
6405
6562
|
if (!Number.isFinite(raw)) return 0;
|
|
6406
6563
|
return Math.min(DISPLAY_ORDER_MAX, Math.max(DISPLAY_ORDER_MIN, Math.trunc(raw)));
|
|
6407
6564
|
}
|
|
6408
|
-
function
|
|
6565
|
+
function decodePanes(raw) {
|
|
6409
6566
|
if (!Array.isArray(raw)) return null;
|
|
6410
6567
|
const decodeRow = (entry, method) => ({
|
|
6411
6568
|
method,
|
|
@@ -6419,14 +6576,14 @@ function decodeNativePanes(raw) {
|
|
|
6419
6576
|
iconSvg: str(entry["icon_svg"]),
|
|
6420
6577
|
displayOrder: clampDisplayOrder(Number(entry["display_order"])),
|
|
6421
6578
|
// Anything unrecognised degrades to `always` rather than dropping the row.
|
|
6422
|
-
visibility: entry["visibility"]
|
|
6579
|
+
visibility: parseVisibility(entry["visibility"]),
|
|
6423
6580
|
// Same tolerance: an unknown value degrades to the default `tab`.
|
|
6424
6581
|
openIn: entry["open_in"] === "popup" ? "popup" : "tab"
|
|
6425
6582
|
});
|
|
6426
6583
|
const indexByMethod = /* @__PURE__ */ new Map();
|
|
6427
6584
|
const out = [];
|
|
6428
6585
|
for (const entry of raw) {
|
|
6429
|
-
if (out.length >=
|
|
6586
|
+
if (out.length >= PANES_MAX) break;
|
|
6430
6587
|
if (!isObject2(entry)) continue;
|
|
6431
6588
|
const method = str(entry["method"]).trim();
|
|
6432
6589
|
if (!method) continue;
|
|
@@ -6442,12 +6599,12 @@ function decodeNativePanes(raw) {
|
|
|
6442
6599
|
}
|
|
6443
6600
|
return out;
|
|
6444
6601
|
}
|
|
6445
|
-
function
|
|
6602
|
+
function encodePanes(panes) {
|
|
6446
6603
|
const nonEmpty = (map) => {
|
|
6447
6604
|
const entries = Object.entries(map).filter(([, v]) => v.trim().length > 0);
|
|
6448
6605
|
return entries.length > 0 ? Object.fromEntries(entries) : void 0;
|
|
6449
6606
|
};
|
|
6450
|
-
return panes.slice(0,
|
|
6607
|
+
return panes.slice(0, PANES_MAX).map((pane) => {
|
|
6451
6608
|
const labelTranslations = nonEmpty(pane.labelTranslations);
|
|
6452
6609
|
const sublabelTranslations = nonEmpty(pane.sublabelTranslations);
|
|
6453
6610
|
return {
|
|
@@ -6455,7 +6612,7 @@ function encodeNativePanes(panes) {
|
|
|
6455
6612
|
enabled: pane.enabled,
|
|
6456
6613
|
...pane.label.trim() ? { label: pane.label.trim() } : {},
|
|
6457
6614
|
...labelTranslations ? { label_translations: labelTranslations } : {},
|
|
6458
|
-
// `null` omits the key entirely (
|
|
6615
|
+
// `null` omits the key entirely (catalogue default wins); `''` is sent
|
|
6459
6616
|
// as-is because that is how the merchant hides the second line.
|
|
6460
6617
|
...pane.sublabel !== null ? { sublabel: pane.sublabel } : {},
|
|
6461
6618
|
...sublabelTranslations ? { sublabel_translations: sublabelTranslations } : {},
|
|
@@ -6467,8 +6624,13 @@ function encodeNativePanes(panes) {
|
|
|
6467
6624
|
// writing e.g. 3.5 or Date.now() verbatim would silently delete the
|
|
6468
6625
|
// pane at render while every read surface shows it healthy.
|
|
6469
6626
|
display_order: clampDisplayOrder(pane.displayOrder),
|
|
6470
|
-
|
|
6471
|
-
|
|
6627
|
+
// Normalised on encode for the same reason `display_order` is clamped:
|
|
6628
|
+
// the router's strict row decode drops a row whole on a value outside
|
|
6629
|
+
// its enum, and a caller who built a `Pane` by hand (or in plain JS)
|
|
6630
|
+
// never went through `decodePanes`. A decoded pane always holds a valid
|
|
6631
|
+
// value, so this is a no-op on the round-trip path.
|
|
6632
|
+
visibility: parseVisibility(pane.visibility),
|
|
6633
|
+
open_in: pane.openIn === "popup" ? "popup" : "tab"
|
|
6472
6634
|
};
|
|
6473
6635
|
});
|
|
6474
6636
|
}
|
|
@@ -6478,6 +6640,10 @@ function focusedCheckoutUrl(params) {
|
|
|
6478
6640
|
params.paymentId
|
|
6479
6641
|
)}`;
|
|
6480
6642
|
const query = new URLSearchParams({ pane: params.method });
|
|
6643
|
+
const connector = params.connector?.trim();
|
|
6644
|
+
if (connector) query.set("connector", connector);
|
|
6645
|
+
const merchantConnectorId = params.merchantConnectorId?.trim();
|
|
6646
|
+
if (merchantConnectorId) query.set("mca", merchantConnectorId);
|
|
6481
6647
|
if (params.locale) query.set("locale", params.locale);
|
|
6482
6648
|
if (params.customFieldsCollected) query.set("cf", "1");
|
|
6483
6649
|
return `${path}?${query.toString()}`;
|
|
@@ -6489,6 +6655,24 @@ var CHECKOUT_EVENT_KINDS = [
|
|
|
6489
6655
|
"native_pane_abandoned",
|
|
6490
6656
|
"native_pane_returned"
|
|
6491
6657
|
];
|
|
6658
|
+
var STRIPE_NATIVE_PANE_METHODS = STRIPE_FALLBACK_PANE_METHODS;
|
|
6659
|
+
var NATIVE_PANE_ICON_KEYS = PANE_ICON_KEYS;
|
|
6660
|
+
var NATIVE_PANE_CATEGORY_KEYS = PANE_CATEGORY_KEYS;
|
|
6661
|
+
var NATIVE_PANES_MAX = PANES_MAX;
|
|
6662
|
+
function nativePaneMethodInfo(method) {
|
|
6663
|
+
return STRIPE_FALLBACK_PANE_METHODS.find((info) => info.key === method);
|
|
6664
|
+
}
|
|
6665
|
+
function defaultNativePane(method) {
|
|
6666
|
+
const info = nativePaneMethodInfo(method);
|
|
6667
|
+
return {
|
|
6668
|
+
...defaultPane(method),
|
|
6669
|
+
category: "",
|
|
6670
|
+
icon: info?.defaultIcon ?? ""
|
|
6671
|
+
};
|
|
6672
|
+
}
|
|
6673
|
+
var cloneNativePane = clonePane;
|
|
6674
|
+
var decodeNativePanes = decodePanes;
|
|
6675
|
+
var encodeNativePanes = encodePanes;
|
|
6492
6676
|
|
|
6493
6677
|
export {
|
|
6494
6678
|
DelopayError,
|
|
@@ -6505,6 +6689,7 @@ export {
|
|
|
6505
6689
|
Regions,
|
|
6506
6690
|
AvailabilityOverrides,
|
|
6507
6691
|
Subscriptions,
|
|
6692
|
+
Audit,
|
|
6508
6693
|
Settlement,
|
|
6509
6694
|
OperationLimits,
|
|
6510
6695
|
Risk,
|
|
@@ -6570,6 +6755,25 @@ export {
|
|
|
6570
6755
|
applyBrandingVariables,
|
|
6571
6756
|
shadowFor,
|
|
6572
6757
|
CheckoutSession,
|
|
6758
|
+
paneViewVisibility,
|
|
6759
|
+
STRIPE_FALLBACK_PANE_METHODS,
|
|
6760
|
+
STRIPE_FALLBACK_PANE_CATALOG,
|
|
6761
|
+
emptyPaneCatalog,
|
|
6762
|
+
paneCatalogFor,
|
|
6763
|
+
PANE_ICON_KEYS,
|
|
6764
|
+
PANE_CATEGORY_KEYS,
|
|
6765
|
+
PANES_MAX,
|
|
6766
|
+
paneMethodInfo,
|
|
6767
|
+
paneRailAllowed,
|
|
6768
|
+
offerablePaneMethods,
|
|
6769
|
+
paneDisplayDefaults,
|
|
6770
|
+
validatePanes,
|
|
6771
|
+
defaultPane,
|
|
6772
|
+
clonePane,
|
|
6773
|
+
decodePanes,
|
|
6774
|
+
encodePanes,
|
|
6775
|
+
focusedCheckoutUrl,
|
|
6776
|
+
CHECKOUT_EVENT_KINDS,
|
|
6573
6777
|
STRIPE_NATIVE_PANE_METHODS,
|
|
6574
6778
|
NATIVE_PANE_ICON_KEYS,
|
|
6575
6779
|
NATIVE_PANE_CATEGORY_KEYS,
|
|
@@ -6578,8 +6782,6 @@ export {
|
|
|
6578
6782
|
defaultNativePane,
|
|
6579
6783
|
cloneNativePane,
|
|
6580
6784
|
decodeNativePanes,
|
|
6581
|
-
encodeNativePanes
|
|
6582
|
-
focusedCheckoutUrl,
|
|
6583
|
-
CHECKOUT_EVENT_KINDS
|
|
6785
|
+
encodeNativePanes
|
|
6584
6786
|
};
|
|
6585
|
-
//# sourceMappingURL=chunk-
|
|
6787
|
+
//# sourceMappingURL=chunk-TS422PA3.js.map
|