@delopay/sdk 0.115.0 → 0.117.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-VH5NCMH6.js → chunk-RN4LGMQM.js} +394 -16
- package/dist/chunk-RN4LGMQM.js.map +1 -0
- package/dist/index.cjs +412 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +540 -197
- package/dist/index.d.ts +540 -197
- package/dist/index.js +39 -1
- package/dist/internal.cjs +433 -35
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +25 -24
- package/dist/internal.d.ts +25 -24
- package/dist/internal.js +60 -21
- package/dist/internal.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-VH5NCMH6.js.map +0 -1
|
@@ -532,9 +532,9 @@ var Connectors = class {
|
|
|
532
532
|
/**
|
|
533
533
|
* Update a connector account.
|
|
534
534
|
*
|
|
535
|
-
* `connector_webhook_details` **merges** into the stored block key by key
|
|
536
|
-
*
|
|
537
|
-
*
|
|
535
|
+
* `connector_webhook_details` **merges** into the stored block key by key:
|
|
536
|
+
* an absent key keeps its stored secret, an explicit value is written, and
|
|
537
|
+
* an explicit empty string clears that secret. Send only the
|
|
538
538
|
* keys the operator typed — padding the other environment's keys with `''`
|
|
539
539
|
* clears a live signing secret and inbound webhooks stop verifying.
|
|
540
540
|
*
|
|
@@ -4164,11 +4164,12 @@ var Settlement = class {
|
|
|
4164
4164
|
/**
|
|
4165
4165
|
* Record payout progress on a statement (`unpaid` / `partial` / `paid`).
|
|
4166
4166
|
*
|
|
4167
|
-
* Subject to the caller's `settlement_payout` operation limit
|
|
4168
|
-
*
|
|
4169
|
-
*
|
|
4170
|
-
*
|
|
4171
|
-
*
|
|
4167
|
+
* Subject to the caller's `settlement_payout` operation limit — a
|
|
4168
|
+
* per-operation ceiling, a windowed total, a windowed count, or any
|
|
4169
|
+
* combination: an over-limit call fails with `DE_01` and nothing is
|
|
4170
|
+
* recorded. There is no approval route out of it — four-eyes needs an
|
|
4171
|
+
* executor that can run the operation once somebody says yes, and only
|
|
4172
|
+
* refunds have one, so a settlement rule can only block.
|
|
4172
4173
|
*
|
|
4173
4174
|
* `POST /settlement/statements/{statementId}/payout`
|
|
4174
4175
|
*/
|
|
@@ -5034,6 +5035,121 @@ function feeProgram() {
|
|
|
5034
5035
|
}
|
|
5035
5036
|
|
|
5036
5037
|
// src/branding.ts
|
|
5038
|
+
function surchargeShowsLabel(labelMode, style, position) {
|
|
5039
|
+
if (labelMode !== "labelled") return false;
|
|
5040
|
+
return !(style === "ribbon" && (position === "cornerStart" || position === "cornerEnd"));
|
|
5041
|
+
}
|
|
5042
|
+
function surchargeFigurePlan(branding, isDiscount, percentAvailable) {
|
|
5043
|
+
const mode = isDiscount ? branding.discountFigure : branding.surchargeFigure;
|
|
5044
|
+
const label = surchargeShowsLabel(
|
|
5045
|
+
branding.surchargeLabel,
|
|
5046
|
+
branding.surchargeStyle,
|
|
5047
|
+
branding.surchargePosition
|
|
5048
|
+
);
|
|
5049
|
+
if (!percentAvailable) return { first: "amount", second: null, label };
|
|
5050
|
+
const ordered = {
|
|
5051
|
+
amount: ["amount", null],
|
|
5052
|
+
percent: ["percent", null],
|
|
5053
|
+
amountThenPercent: ["amount", "percent"],
|
|
5054
|
+
percentThenAmount: ["percent", "amount"]
|
|
5055
|
+
};
|
|
5056
|
+
const [first, second] = ordered[mode];
|
|
5057
|
+
const cornerRibbon = branding.surchargeStyle === "ribbon" && (branding.surchargePosition === "cornerStart" || branding.surchargePosition === "cornerEnd");
|
|
5058
|
+
return { first, second: cornerRibbon ? null : second, label };
|
|
5059
|
+
}
|
|
5060
|
+
function readableInkOn(color) {
|
|
5061
|
+
const onBlack = contrastRatio(color, "#000000");
|
|
5062
|
+
const onWhite = contrastRatio(color, "#ffffff");
|
|
5063
|
+
if (onBlack === null || onWhite === null) return "#ffffff";
|
|
5064
|
+
return onBlack >= onWhite ? "#000000" : "#ffffff";
|
|
5065
|
+
}
|
|
5066
|
+
var SURCHARGE_FONT_SIZE = {
|
|
5067
|
+
sm: "0.6875rem",
|
|
5068
|
+
md: "0.8125rem",
|
|
5069
|
+
lg: "0.9375rem"
|
|
5070
|
+
};
|
|
5071
|
+
var SURCHARGE_PAD = {
|
|
5072
|
+
sm: "1px 6px",
|
|
5073
|
+
md: "2px 8px",
|
|
5074
|
+
lg: "3px 10px"
|
|
5075
|
+
};
|
|
5076
|
+
var SURCHARGE_RADIUS = {
|
|
5077
|
+
pill: "999px",
|
|
5078
|
+
rounded: "6px",
|
|
5079
|
+
square: "0px"
|
|
5080
|
+
};
|
|
5081
|
+
var SURCHARGE_BORDER_WIDTH = {
|
|
5082
|
+
none: "0px",
|
|
5083
|
+
thin: "1px",
|
|
5084
|
+
medium: "2px",
|
|
5085
|
+
thick: "3px"
|
|
5086
|
+
};
|
|
5087
|
+
var SURCHARGE_FONT_WEIGHT = {
|
|
5088
|
+
regular: "400",
|
|
5089
|
+
medium: "600",
|
|
5090
|
+
bold: "700"
|
|
5091
|
+
};
|
|
5092
|
+
var SURCHARGE_POSITIONS = [
|
|
5093
|
+
"trailing",
|
|
5094
|
+
"inline",
|
|
5095
|
+
"below",
|
|
5096
|
+
"above",
|
|
5097
|
+
"cornerStart",
|
|
5098
|
+
"cornerEnd"
|
|
5099
|
+
];
|
|
5100
|
+
var SURCHARGE_STYLES = [
|
|
5101
|
+
"plain",
|
|
5102
|
+
"underline",
|
|
5103
|
+
"outline",
|
|
5104
|
+
"badge",
|
|
5105
|
+
"solid",
|
|
5106
|
+
"ribbon"
|
|
5107
|
+
];
|
|
5108
|
+
var SURCHARGE_BORDER_WIDTHS = [
|
|
5109
|
+
"none",
|
|
5110
|
+
"thin",
|
|
5111
|
+
"medium",
|
|
5112
|
+
"thick"
|
|
5113
|
+
];
|
|
5114
|
+
var SURCHARGE_BORDER_STYLES = [
|
|
5115
|
+
"solid",
|
|
5116
|
+
"dashed",
|
|
5117
|
+
"dotted"
|
|
5118
|
+
];
|
|
5119
|
+
var SURCHARGE_SIZES = ["sm", "md", "lg"];
|
|
5120
|
+
function surchargeStyleDrawsAShape(style) {
|
|
5121
|
+
return style === "badge" || style === "outline" || style === "solid";
|
|
5122
|
+
}
|
|
5123
|
+
var SURCHARGE_SHAPES = ["pill", "rounded", "square"];
|
|
5124
|
+
var SURCHARGE_WEIGHTS = ["regular", "medium", "bold"];
|
|
5125
|
+
var SURCHARGE_SIGNS = ["always", "minusOnly", "none"];
|
|
5126
|
+
var SURCHARGE_LABEL_MODES = ["amount", "labelled"];
|
|
5127
|
+
var SURCHARGE_FIGURE_MODES = [
|
|
5128
|
+
"amount",
|
|
5129
|
+
"percent",
|
|
5130
|
+
"amountThenPercent",
|
|
5131
|
+
"percentThenAmount"
|
|
5132
|
+
];
|
|
5133
|
+
var CHECKOUT_LOCALES = ["en", "de"];
|
|
5134
|
+
var LOCALIZABLE_COPY_FIELDS = [
|
|
5135
|
+
"headerText",
|
|
5136
|
+
"payButtonLabel",
|
|
5137
|
+
"cardTermsMessage",
|
|
5138
|
+
"footerText"
|
|
5139
|
+
];
|
|
5140
|
+
function copyTranslationsKey(field) {
|
|
5141
|
+
return `${field}Translations`;
|
|
5142
|
+
}
|
|
5143
|
+
function checkoutCopy(branding, field, locale) {
|
|
5144
|
+
const translated = translationFor(branding[copyTranslationsKey(field)], locale);
|
|
5145
|
+
return translated ?? branding[field];
|
|
5146
|
+
}
|
|
5147
|
+
function surchargeWordFor(branding, isDiscount, locale) {
|
|
5148
|
+
return translationFor(
|
|
5149
|
+
isDiscount ? branding.discountWordTranslations : branding.surchargeWordTranslations,
|
|
5150
|
+
locale
|
|
5151
|
+
);
|
|
5152
|
+
}
|
|
5037
5153
|
var FONT_STACKS = {
|
|
5038
5154
|
inter: "'Inter Variable', 'Inter', system-ui, -apple-system, sans-serif",
|
|
5039
5155
|
system: "system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif",
|
|
@@ -5224,6 +5340,44 @@ var DEFAULT_BRANDING_BASE = {
|
|
|
5224
5340
|
verticalGap: "comfortable",
|
|
5225
5341
|
inputSize: "md",
|
|
5226
5342
|
buttonSize: "md",
|
|
5343
|
+
// Disclosure on by default: with provider-scoped pricing the tile is where
|
|
5344
|
+
// the buyer chooses between prices, and a price they cannot see is one they
|
|
5345
|
+
// find out about on the statement.
|
|
5346
|
+
showSurcharge: true,
|
|
5347
|
+
surchargePosition: "trailing",
|
|
5348
|
+
surchargeStyle: "badge",
|
|
5349
|
+
surchargeSize: "sm",
|
|
5350
|
+
surchargeShape: "pill",
|
|
5351
|
+
surchargeBorderWidth: "thin",
|
|
5352
|
+
surchargeBorderStyle: "solid",
|
|
5353
|
+
surchargeWeight: "medium",
|
|
5354
|
+
surchargeSign: "always",
|
|
5355
|
+
surchargeUppercase: false,
|
|
5356
|
+
// Named, not bare. A tile that reads "-EUR 2.50" beside a brand name is a
|
|
5357
|
+
// number with no subject — buyers read it as the price, not as a change to
|
|
5358
|
+
// it. "Discount -EUR 2.50" needs no interpreting, and the word is what makes
|
|
5359
|
+
// the default configuration legible without the merchant touching anything.
|
|
5360
|
+
surchargeLabel: "labelled",
|
|
5361
|
+
// The two directions default differently on purpose, which is the whole
|
|
5362
|
+
// reason they are two settings. A fee is something a buyer acts on in money,
|
|
5363
|
+
// so it leads with money and says nothing else. A saving is something worth
|
|
5364
|
+
// advertising, and the share is the persuasive half of it — "-5.1% (EUR
|
|
5365
|
+
// 2.50)" sells what "-EUR 2.50" merely states, and the amount is still right
|
|
5366
|
+
// there beside it.
|
|
5367
|
+
surchargeFigure: "amount",
|
|
5368
|
+
discountFigure: "percentThenAmount",
|
|
5369
|
+
// Empty: the checkout's own localized words are the default, in every
|
|
5370
|
+
// language it ships. A merchant fills these in only to say it differently.
|
|
5371
|
+
surchargeWordTranslations: {},
|
|
5372
|
+
discountWordTranslations: {},
|
|
5373
|
+
// amber-700 / emerald-700, not the 600s: the `plain` style renders the
|
|
5374
|
+
// disclosure as coloured TEXT, so it is bound by `WCAG_AA_TEXT` (4.5) rather
|
|
5375
|
+
// than by the 3:1 a coloured shape would be, and the 600s come to 3.19 and
|
|
5376
|
+
// 3.77 against the default white surface. These are 5.02 and 5.48, pinned by
|
|
5377
|
+
// tests. Far enough apart to read as opposite news at a glance rather than as
|
|
5378
|
+
// two shades of "extra".
|
|
5379
|
+
surchargeColor: "#b45309",
|
|
5380
|
+
discountColor: "#047857",
|
|
5227
5381
|
layout: "split",
|
|
5228
5382
|
summaryPosition: "left",
|
|
5229
5383
|
showOrderSummary: true,
|
|
@@ -5232,10 +5386,17 @@ var DEFAULT_BRANDING_BASE = {
|
|
|
5232
5386
|
totalLabel: "Total",
|
|
5233
5387
|
showCurrencyCode: false,
|
|
5234
5388
|
showOrderItems: true,
|
|
5389
|
+
// Each flat field keeps its meaning: what the merchant wrote, used in every
|
|
5390
|
+
// locale that carries no override. Empty maps therefore change nothing for a
|
|
5391
|
+
// profile saved before translations existed.
|
|
5235
5392
|
headerText: "",
|
|
5393
|
+
headerTextTranslations: {},
|
|
5236
5394
|
payButtonLabel: "",
|
|
5395
|
+
payButtonLabelTranslations: {},
|
|
5237
5396
|
cardTermsMessage: "",
|
|
5397
|
+
cardTermsMessageTranslations: {},
|
|
5238
5398
|
footerText: "",
|
|
5399
|
+
footerTextTranslations: {},
|
|
5239
5400
|
supportEmail: "",
|
|
5240
5401
|
paymentLayout: "tabs",
|
|
5241
5402
|
labelStyle: "above",
|
|
@@ -5261,6 +5422,11 @@ var DEFAULT_BRANDING_DARK = {
|
|
|
5261
5422
|
buttonBackground: "#1E4FEB",
|
|
5262
5423
|
buttonText: "#ffffff",
|
|
5263
5424
|
surfaceStyle: "flat",
|
|
5425
|
+
// amber-400 / emerald-400: the 700s above are far too dark to read on
|
|
5426
|
+
// slate-900, and this pair is the same news in the same order at the light
|
|
5427
|
+
// end of the ramp — 10.69 and 9.29 against the dark surface, also pinned.
|
|
5428
|
+
surchargeColor: "#fbbf24",
|
|
5429
|
+
discountColor: "#34d399",
|
|
5264
5430
|
trustBadges: DEFAULT_BADGES_DARK.map((b) => ({ ...b })),
|
|
5265
5431
|
customFields: []
|
|
5266
5432
|
};
|
|
@@ -5271,7 +5437,16 @@ function cloneBranding(b) {
|
|
|
5271
5437
|
return {
|
|
5272
5438
|
...b,
|
|
5273
5439
|
trustBadges: b.trustBadges.map((badge) => ({ ...badge })),
|
|
5274
|
-
customFields: b.customFields.map(cloneCustomField)
|
|
5440
|
+
customFields: b.customFields.map(cloneCustomField),
|
|
5441
|
+
// Copied, not shared. A spread alone would leave the clone pointing at the
|
|
5442
|
+
// original's maps, and the dashboard edits a clone precisely so the form
|
|
5443
|
+
// can be abandoned without touching what is saved.
|
|
5444
|
+
surchargeWordTranslations: { ...b.surchargeWordTranslations },
|
|
5445
|
+
discountWordTranslations: { ...b.discountWordTranslations },
|
|
5446
|
+
headerTextTranslations: { ...b.headerTextTranslations },
|
|
5447
|
+
payButtonLabelTranslations: { ...b.payButtonLabelTranslations },
|
|
5448
|
+
cardTermsMessageTranslations: { ...b.cardTermsMessageTranslations },
|
|
5449
|
+
footerTextTranslations: { ...b.footerTextTranslations }
|
|
5275
5450
|
};
|
|
5276
5451
|
}
|
|
5277
5452
|
function cloneCustomField(f) {
|
|
@@ -5422,13 +5597,25 @@ function defaultCustomFieldVisibility() {
|
|
|
5422
5597
|
return { mode: "always", match: "all", conditions: [] };
|
|
5423
5598
|
}
|
|
5424
5599
|
function parseTranslations(raw) {
|
|
5425
|
-
|
|
5600
|
+
let value = raw;
|
|
5601
|
+
if (typeof value === "string") {
|
|
5602
|
+
try {
|
|
5603
|
+
value = JSON.parse(value);
|
|
5604
|
+
} catch {
|
|
5605
|
+
return {};
|
|
5606
|
+
}
|
|
5607
|
+
}
|
|
5608
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return {};
|
|
5426
5609
|
const out = {};
|
|
5427
|
-
for (const [k, v] of Object.entries(
|
|
5428
|
-
if (typeof v === "string" && v.length > 0) out[k] = v;
|
|
5610
|
+
for (const [k, v] of Object.entries(value)) {
|
|
5611
|
+
if (typeof v === "string" && v.trim().length > 0) out[k] = v;
|
|
5429
5612
|
}
|
|
5430
5613
|
return out;
|
|
5431
5614
|
}
|
|
5615
|
+
function encodeTranslations(map) {
|
|
5616
|
+
const entries = Object.entries(map).filter(([, v]) => v.trim().length > 0);
|
|
5617
|
+
return entries.length > 0 ? JSON.stringify(Object.fromEntries(entries)) : void 0;
|
|
5618
|
+
}
|
|
5432
5619
|
function normalizeCondition(raw, index) {
|
|
5433
5620
|
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return null;
|
|
5434
5621
|
const c = raw;
|
|
@@ -5780,6 +5967,74 @@ function decodeBranding(source) {
|
|
|
5780
5967
|
["sm", "md", "lg"],
|
|
5781
5968
|
DEFAULT_BRANDING.buttonSize
|
|
5782
5969
|
),
|
|
5970
|
+
showSurcharge: parseBool(extras["showSurcharge"], DEFAULT_BRANDING.showSurcharge),
|
|
5971
|
+
surchargePosition: pickEnum(
|
|
5972
|
+
extras["surchargePosition"],
|
|
5973
|
+
SURCHARGE_POSITIONS,
|
|
5974
|
+
DEFAULT_BRANDING.surchargePosition
|
|
5975
|
+
),
|
|
5976
|
+
surchargeStyle: pickEnum(
|
|
5977
|
+
extras["surchargeStyle"],
|
|
5978
|
+
SURCHARGE_STYLES,
|
|
5979
|
+
DEFAULT_BRANDING.surchargeStyle
|
|
5980
|
+
),
|
|
5981
|
+
surchargeSize: pickEnum(
|
|
5982
|
+
extras["surchargeSize"],
|
|
5983
|
+
SURCHARGE_SIZES,
|
|
5984
|
+
DEFAULT_BRANDING.surchargeSize
|
|
5985
|
+
),
|
|
5986
|
+
surchargeShape: pickEnum(
|
|
5987
|
+
extras["surchargeShape"],
|
|
5988
|
+
SURCHARGE_SHAPES,
|
|
5989
|
+
DEFAULT_BRANDING.surchargeShape
|
|
5990
|
+
),
|
|
5991
|
+
surchargeBorderWidth: pickEnum(
|
|
5992
|
+
extras["surchargeBorderWidth"],
|
|
5993
|
+
SURCHARGE_BORDER_WIDTHS,
|
|
5994
|
+
DEFAULT_BRANDING.surchargeBorderWidth
|
|
5995
|
+
),
|
|
5996
|
+
surchargeBorderStyle: pickEnum(
|
|
5997
|
+
extras["surchargeBorderStyle"],
|
|
5998
|
+
SURCHARGE_BORDER_STYLES,
|
|
5999
|
+
DEFAULT_BRANDING.surchargeBorderStyle
|
|
6000
|
+
),
|
|
6001
|
+
surchargeWeight: pickEnum(
|
|
6002
|
+
extras["surchargeWeight"],
|
|
6003
|
+
SURCHARGE_WEIGHTS,
|
|
6004
|
+
DEFAULT_BRANDING.surchargeWeight
|
|
6005
|
+
),
|
|
6006
|
+
surchargeSign: pickEnum(
|
|
6007
|
+
extras["surchargeSign"],
|
|
6008
|
+
SURCHARGE_SIGNS,
|
|
6009
|
+
DEFAULT_BRANDING.surchargeSign
|
|
6010
|
+
),
|
|
6011
|
+
surchargeUppercase: parseBool(
|
|
6012
|
+
extras["surchargeUppercase"],
|
|
6013
|
+
DEFAULT_BRANDING.surchargeUppercase
|
|
6014
|
+
),
|
|
6015
|
+
surchargeLabel: pickEnum(
|
|
6016
|
+
extras["surchargeLabel"],
|
|
6017
|
+
SURCHARGE_LABEL_MODES,
|
|
6018
|
+
DEFAULT_BRANDING.surchargeLabel
|
|
6019
|
+
),
|
|
6020
|
+
surchargeFigure: pickEnum(
|
|
6021
|
+
extras["surchargeFigure"],
|
|
6022
|
+
SURCHARGE_FIGURE_MODES,
|
|
6023
|
+
DEFAULT_BRANDING.surchargeFigure
|
|
6024
|
+
),
|
|
6025
|
+
discountFigure: pickEnum(
|
|
6026
|
+
extras["discountFigure"],
|
|
6027
|
+
SURCHARGE_FIGURE_MODES,
|
|
6028
|
+
DEFAULT_BRANDING.discountFigure
|
|
6029
|
+
),
|
|
6030
|
+
surchargeWordTranslations: parseTranslations(extras["surchargeWordTranslations"]),
|
|
6031
|
+
discountWordTranslations: parseTranslations(extras["discountWordTranslations"]),
|
|
6032
|
+
headerTextTranslations: parseTranslations(extras["headerTextTranslations"]),
|
|
6033
|
+
payButtonLabelTranslations: parseTranslations(extras["payButtonLabelTranslations"]),
|
|
6034
|
+
cardTermsMessageTranslations: parseTranslations(extras["cardTermsMessageTranslations"]),
|
|
6035
|
+
footerTextTranslations: parseTranslations(extras["footerTextTranslations"]),
|
|
6036
|
+
surchargeColor: s(extras["surchargeColor"]) || DEFAULT_BRANDING.surchargeColor,
|
|
6037
|
+
discountColor: s(extras["discountColor"]) || DEFAULT_BRANDING.discountColor,
|
|
5783
6038
|
layout: pickEnum(extras["layout"], ["compact", "split"], DEFAULT_BRANDING.layout),
|
|
5784
6039
|
summaryPosition: pickEnum(
|
|
5785
6040
|
extras["summaryPosition"],
|
|
@@ -5833,6 +6088,21 @@ function encodeBranding(branding, base) {
|
|
|
5833
6088
|
verticalGap: branding.verticalGap,
|
|
5834
6089
|
inputSize: branding.inputSize,
|
|
5835
6090
|
buttonSize: branding.buttonSize,
|
|
6091
|
+
showSurcharge: String(branding.showSurcharge),
|
|
6092
|
+
surchargePosition: branding.surchargePosition,
|
|
6093
|
+
surchargeStyle: branding.surchargeStyle,
|
|
6094
|
+
surchargeSize: branding.surchargeSize,
|
|
6095
|
+
surchargeShape: branding.surchargeShape,
|
|
6096
|
+
surchargeBorderWidth: branding.surchargeBorderWidth,
|
|
6097
|
+
surchargeBorderStyle: branding.surchargeBorderStyle,
|
|
6098
|
+
surchargeWeight: branding.surchargeWeight,
|
|
6099
|
+
surchargeSign: branding.surchargeSign,
|
|
6100
|
+
surchargeUppercase: String(branding.surchargeUppercase),
|
|
6101
|
+
surchargeLabel: branding.surchargeLabel,
|
|
6102
|
+
surchargeFigure: branding.surchargeFigure,
|
|
6103
|
+
discountFigure: branding.discountFigure,
|
|
6104
|
+
surchargeColor: branding.surchargeColor,
|
|
6105
|
+
discountColor: branding.discountColor,
|
|
5836
6106
|
layout: branding.layout,
|
|
5837
6107
|
summaryPosition: branding.summaryPosition,
|
|
5838
6108
|
showOrderSummary: String(branding.showOrderSummary),
|
|
@@ -5850,6 +6120,17 @@ function encodeBranding(branding, base) {
|
|
|
5850
6120
|
if (branding.customFields.length > 0) {
|
|
5851
6121
|
extras["customFields"] = encodeCustomFields(branding.customFields);
|
|
5852
6122
|
}
|
|
6123
|
+
for (const key of [
|
|
6124
|
+
"surchargeWordTranslations",
|
|
6125
|
+
"discountWordTranslations",
|
|
6126
|
+
"headerTextTranslations",
|
|
6127
|
+
"payButtonLabelTranslations",
|
|
6128
|
+
"cardTermsMessageTranslations",
|
|
6129
|
+
"footerTextTranslations"
|
|
6130
|
+
]) {
|
|
6131
|
+
const encoded = encodeTranslations(branding[key]);
|
|
6132
|
+
if (encoded) extras[key] = encoded;
|
|
6133
|
+
}
|
|
5853
6134
|
const tagline = trim(branding.tagline);
|
|
5854
6135
|
if (tagline) extras["tagline"] = tagline;
|
|
5855
6136
|
const footer = trim(branding.footerText);
|
|
@@ -5958,6 +6239,71 @@ function parseImportedBranding(raw) {
|
|
|
5958
6239
|
),
|
|
5959
6240
|
inputSize: pickEnum(root["inputSize"], ["sm", "md", "lg"], dflt.inputSize),
|
|
5960
6241
|
buttonSize: pickEnum(root["buttonSize"], ["sm", "md", "lg"], dflt.buttonSize),
|
|
6242
|
+
showSurcharge: parseBool(root["showSurcharge"], dflt.showSurcharge),
|
|
6243
|
+
surchargePosition: pickEnum(
|
|
6244
|
+
root["surchargePosition"],
|
|
6245
|
+
SURCHARGE_POSITIONS,
|
|
6246
|
+
dflt.surchargePosition
|
|
6247
|
+
),
|
|
6248
|
+
surchargeStyle: pickEnum(
|
|
6249
|
+
root["surchargeStyle"],
|
|
6250
|
+
SURCHARGE_STYLES,
|
|
6251
|
+
dflt.surchargeStyle
|
|
6252
|
+
),
|
|
6253
|
+
surchargeSize: pickEnum(
|
|
6254
|
+
root["surchargeSize"],
|
|
6255
|
+
SURCHARGE_SIZES,
|
|
6256
|
+
dflt.surchargeSize
|
|
6257
|
+
),
|
|
6258
|
+
surchargeShape: pickEnum(
|
|
6259
|
+
root["surchargeShape"],
|
|
6260
|
+
SURCHARGE_SHAPES,
|
|
6261
|
+
dflt.surchargeShape
|
|
6262
|
+
),
|
|
6263
|
+
surchargeBorderWidth: pickEnum(
|
|
6264
|
+
root["surchargeBorderWidth"],
|
|
6265
|
+
SURCHARGE_BORDER_WIDTHS,
|
|
6266
|
+
dflt.surchargeBorderWidth
|
|
6267
|
+
),
|
|
6268
|
+
surchargeBorderStyle: pickEnum(
|
|
6269
|
+
root["surchargeBorderStyle"],
|
|
6270
|
+
SURCHARGE_BORDER_STYLES,
|
|
6271
|
+
dflt.surchargeBorderStyle
|
|
6272
|
+
),
|
|
6273
|
+
surchargeWeight: pickEnum(
|
|
6274
|
+
root["surchargeWeight"],
|
|
6275
|
+
SURCHARGE_WEIGHTS,
|
|
6276
|
+
dflt.surchargeWeight
|
|
6277
|
+
),
|
|
6278
|
+
surchargeSign: pickEnum(
|
|
6279
|
+
root["surchargeSign"],
|
|
6280
|
+
SURCHARGE_SIGNS,
|
|
6281
|
+
dflt.surchargeSign
|
|
6282
|
+
),
|
|
6283
|
+
surchargeUppercase: parseBool(root["surchargeUppercase"], dflt.surchargeUppercase),
|
|
6284
|
+
surchargeLabel: pickEnum(
|
|
6285
|
+
root["surchargeLabel"],
|
|
6286
|
+
SURCHARGE_LABEL_MODES,
|
|
6287
|
+
dflt.surchargeLabel
|
|
6288
|
+
),
|
|
6289
|
+
surchargeFigure: pickEnum(
|
|
6290
|
+
root["surchargeFigure"],
|
|
6291
|
+
SURCHARGE_FIGURE_MODES,
|
|
6292
|
+
dflt.surchargeFigure
|
|
6293
|
+
),
|
|
6294
|
+
discountFigure: pickEnum(
|
|
6295
|
+
root["discountFigure"],
|
|
6296
|
+
SURCHARGE_FIGURE_MODES,
|
|
6297
|
+
dflt.discountFigure
|
|
6298
|
+
),
|
|
6299
|
+
surchargeWordTranslations: parseTranslations(root["surchargeWordTranslations"]),
|
|
6300
|
+
discountWordTranslations: parseTranslations(root["discountWordTranslations"]),
|
|
6301
|
+
headerTextTranslations: parseTranslations(root["headerTextTranslations"]),
|
|
6302
|
+
payButtonLabelTranslations: parseTranslations(root["payButtonLabelTranslations"]),
|
|
6303
|
+
cardTermsMessageTranslations: parseTranslations(root["cardTermsMessageTranslations"]),
|
|
6304
|
+
footerTextTranslations: parseTranslations(root["footerTextTranslations"]),
|
|
6305
|
+
surchargeColor: sHex(root["surchargeColor"], dflt.surchargeColor),
|
|
6306
|
+
discountColor: sHex(root["discountColor"], dflt.discountColor),
|
|
5961
6307
|
layout: pickEnum(root["layout"], ["compact", "split"], dflt.layout),
|
|
5962
6308
|
summaryPosition: pickEnum(
|
|
5963
6309
|
root["summaryPosition"],
|
|
@@ -6024,6 +6370,19 @@ function applyBrandingVariables(el, b) {
|
|
|
6024
6370
|
set("--dp-gap-vertical", VERTICAL_GAP[b.verticalGap]);
|
|
6025
6371
|
set("--dp-input-pad", INPUT_PAD[b.inputSize]);
|
|
6026
6372
|
set("--dp-button-pad", BUTTON_PAD[b.buttonSize]);
|
|
6373
|
+
set("--dp-surcharge", b.surchargeColor);
|
|
6374
|
+
set("--dp-discount", b.discountColor);
|
|
6375
|
+
set("--dp-surcharge-ink", readableInkOn(b.surchargeColor));
|
|
6376
|
+
set("--dp-discount-ink", readableInkOn(b.discountColor));
|
|
6377
|
+
set("--dp-surcharge-size", SURCHARGE_FONT_SIZE[b.surchargeSize]);
|
|
6378
|
+
set("--dp-surcharge-pad", SURCHARGE_PAD[b.surchargeSize]);
|
|
6379
|
+
set("--dp-surcharge-radius", SURCHARGE_RADIUS[b.surchargeShape]);
|
|
6380
|
+
set("--dp-surcharge-weight", SURCHARGE_FONT_WEIGHT[b.surchargeWeight]);
|
|
6381
|
+
set(
|
|
6382
|
+
"--dp-surcharge-border-width",
|
|
6383
|
+
SURCHARGE_BORDER_WIDTH[b.surchargeStyle === "outline" && b.surchargeBorderWidth === "none" ? "thin" : b.surchargeBorderWidth]
|
|
6384
|
+
);
|
|
6385
|
+
set("--dp-surcharge-border-style", b.surchargeBorderStyle);
|
|
6027
6386
|
set("--dp-shadow", shadowFor(b.surfaceStyle));
|
|
6028
6387
|
set(
|
|
6029
6388
|
"--dp-surface-border",
|
|
@@ -6414,9 +6773,9 @@ var STRIPE_FALLBACK_PANE_METHODS = [
|
|
|
6414
6773
|
requiresBillingCountry: true,
|
|
6415
6774
|
defaultLabel: "Klarna",
|
|
6416
6775
|
// NOT the router's current "Pay later or in 3 instalments". This table is
|
|
6417
|
-
// what a router predating the capability endpoint
|
|
6418
|
-
//
|
|
6419
|
-
//
|
|
6776
|
+
// what a router predating the capability endpoint renders, and that copy
|
|
6777
|
+
// only gained the "3" in the same release that added the endpoint.
|
|
6778
|
+
// Restating the new string here
|
|
6420
6779
|
// would put copy no reachable router emits in front of a merchant, and
|
|
6421
6780
|
// would change what the deprecated `nativePaneMethodInfo` has returned
|
|
6422
6781
|
// since 0.106.0.
|
|
@@ -6766,6 +7125,25 @@ export {
|
|
|
6766
7125
|
programToTree,
|
|
6767
7126
|
FeeProgramBuilder,
|
|
6768
7127
|
feeProgram,
|
|
7128
|
+
surchargeShowsLabel,
|
|
7129
|
+
surchargeFigurePlan,
|
|
7130
|
+
readableInkOn,
|
|
7131
|
+
SURCHARGE_POSITIONS,
|
|
7132
|
+
SURCHARGE_STYLES,
|
|
7133
|
+
SURCHARGE_BORDER_WIDTHS,
|
|
7134
|
+
SURCHARGE_BORDER_STYLES,
|
|
7135
|
+
SURCHARGE_SIZES,
|
|
7136
|
+
surchargeStyleDrawsAShape,
|
|
7137
|
+
SURCHARGE_SHAPES,
|
|
7138
|
+
SURCHARGE_WEIGHTS,
|
|
7139
|
+
SURCHARGE_SIGNS,
|
|
7140
|
+
SURCHARGE_LABEL_MODES,
|
|
7141
|
+
SURCHARGE_FIGURE_MODES,
|
|
7142
|
+
CHECKOUT_LOCALES,
|
|
7143
|
+
LOCALIZABLE_COPY_FIELDS,
|
|
7144
|
+
copyTranslationsKey,
|
|
7145
|
+
checkoutCopy,
|
|
7146
|
+
surchargeWordFor,
|
|
6769
7147
|
fontStack,
|
|
6770
7148
|
radiusValue,
|
|
6771
7149
|
fontWeightValue,
|
|
@@ -6852,4 +7230,4 @@ export {
|
|
|
6852
7230
|
decodeNativePanes,
|
|
6853
7231
|
encodeNativePanes
|
|
6854
7232
|
};
|
|
6855
|
-
//# sourceMappingURL=chunk-
|
|
7233
|
+
//# sourceMappingURL=chunk-RN4LGMQM.js.map
|