@delopay/sdk 0.115.0 → 0.118.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-IQIUYV2B.js} +465 -19
- package/dist/chunk-IQIUYV2B.js.map +1 -0
- package/dist/index.cjs +483 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +811 -199
- package/dist/index.d.ts +811 -199
- package/dist/index.js +39 -1
- package/dist/internal.cjs +517 -38
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +66 -26
- package/dist/internal.d.ts +66 -26
- package/dist/internal.js +73 -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
|
*
|
|
@@ -3709,11 +3709,79 @@ var Export = class {
|
|
|
3709
3709
|
constructor(request) {
|
|
3710
3710
|
this.request = request;
|
|
3711
3711
|
}
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3712
|
+
async transactions(params, options) {
|
|
3713
|
+
return this.request(
|
|
3714
|
+
"POST",
|
|
3715
|
+
"/export/transactions",
|
|
3716
|
+
transactionBody(params, options)
|
|
3717
|
+
);
|
|
3718
|
+
}
|
|
3719
|
+
async transactionsForProfile(params, options) {
|
|
3720
|
+
return this.request(
|
|
3721
|
+
"POST",
|
|
3722
|
+
"/export/profile/transactions",
|
|
3723
|
+
transactionBody(params, options)
|
|
3724
|
+
);
|
|
3725
|
+
}
|
|
3726
|
+
async refunds(params, options) {
|
|
3727
|
+
return this.request("POST", "/refunds/list/export", bodied(params ?? {}, options));
|
|
3728
|
+
}
|
|
3729
|
+
async refundsForProfile(params, options) {
|
|
3730
|
+
return this.request(
|
|
3731
|
+
"POST",
|
|
3732
|
+
"/refunds/profile/list/export",
|
|
3733
|
+
bodied(params ?? {}, options)
|
|
3734
|
+
);
|
|
3735
|
+
}
|
|
3736
|
+
async disputes(params, options) {
|
|
3737
|
+
return this.request("GET", "/disputes/list/export", queried(params, options));
|
|
3738
|
+
}
|
|
3739
|
+
async disputesForProfile(params, options) {
|
|
3740
|
+
return this.request(
|
|
3741
|
+
"GET",
|
|
3742
|
+
"/disputes/profile/list/export",
|
|
3743
|
+
queried(params, options)
|
|
3744
|
+
);
|
|
3745
|
+
}
|
|
3746
|
+
async payouts(params, options) {
|
|
3747
|
+
return this.request("POST", "/payouts/list/export", bodied(params, options));
|
|
3748
|
+
}
|
|
3749
|
+
async payoutsForProfile(params, options) {
|
|
3750
|
+
return this.request("POST", "/payouts/profile/list/export", bodied(params, options));
|
|
3751
|
+
}
|
|
3752
|
+
async subscriptions(profileId, params, options) {
|
|
3753
|
+
return this.request(
|
|
3754
|
+
"GET",
|
|
3755
|
+
"/subscriptions/list/export",
|
|
3756
|
+
queried(params, options, { "X-Profile-Id": profileId })
|
|
3757
|
+
);
|
|
3758
|
+
}
|
|
3759
|
+
async auditLog(params, options) {
|
|
3760
|
+
return this.request("GET", "/audit/export", queried(params, options));
|
|
3715
3761
|
}
|
|
3716
3762
|
};
|
|
3763
|
+
var ACCEPT = {
|
|
3764
|
+
csv: "text/csv",
|
|
3765
|
+
json: "application/json",
|
|
3766
|
+
pdf: "application/pdf"
|
|
3767
|
+
};
|
|
3768
|
+
function negotiated(options, format) {
|
|
3769
|
+
const headers = { ...options.headers, Accept: ACCEPT[format] };
|
|
3770
|
+
return format === "json" ? { ...options, headers } : { ...options, headers, responseType: "blob" };
|
|
3771
|
+
}
|
|
3772
|
+
function transactionBody(params, options) {
|
|
3773
|
+
const format = options?.format ?? "json";
|
|
3774
|
+
return negotiated({ body: { ...params, format } }, format);
|
|
3775
|
+
}
|
|
3776
|
+
function bodied(body, options) {
|
|
3777
|
+
return negotiated({ body }, options?.format ?? "json");
|
|
3778
|
+
}
|
|
3779
|
+
function queried(params, options, headers) {
|
|
3780
|
+
return negotiated(
|
|
3781
|
+
{ query: params ?? {}, ...headers ? { headers } : {} },
|
|
3782
|
+
options?.format ?? "json"
|
|
3783
|
+
);
|
|
3784
|
+
}
|
|
3717
3785
|
|
|
3718
3786
|
// src/resources/featureMatrix.ts
|
|
3719
3787
|
var FeatureMatrix = class {
|
|
@@ -4164,11 +4232,12 @@ var Settlement = class {
|
|
|
4164
4232
|
/**
|
|
4165
4233
|
* Record payout progress on a statement (`unpaid` / `partial` / `paid`).
|
|
4166
4234
|
*
|
|
4167
|
-
* Subject to the caller's `settlement_payout` operation limit
|
|
4168
|
-
*
|
|
4169
|
-
*
|
|
4170
|
-
*
|
|
4171
|
-
*
|
|
4235
|
+
* Subject to the caller's `settlement_payout` operation limit — a
|
|
4236
|
+
* per-operation ceiling, a windowed total, a windowed count, or any
|
|
4237
|
+
* combination: an over-limit call fails with `DE_01` and nothing is
|
|
4238
|
+
* recorded. There is no approval route out of it — four-eyes needs an
|
|
4239
|
+
* executor that can run the operation once somebody says yes, and only
|
|
4240
|
+
* refunds have one, so a settlement rule can only block.
|
|
4172
4241
|
*
|
|
4173
4242
|
* `POST /settlement/statements/{statementId}/payout`
|
|
4174
4243
|
*/
|
|
@@ -5034,6 +5103,121 @@ function feeProgram() {
|
|
|
5034
5103
|
}
|
|
5035
5104
|
|
|
5036
5105
|
// src/branding.ts
|
|
5106
|
+
function surchargeShowsLabel(labelMode, style, position) {
|
|
5107
|
+
if (labelMode !== "labelled") return false;
|
|
5108
|
+
return !(style === "ribbon" && (position === "cornerStart" || position === "cornerEnd"));
|
|
5109
|
+
}
|
|
5110
|
+
function surchargeFigurePlan(branding, isDiscount, percentAvailable) {
|
|
5111
|
+
const mode = isDiscount ? branding.discountFigure : branding.surchargeFigure;
|
|
5112
|
+
const label = surchargeShowsLabel(
|
|
5113
|
+
branding.surchargeLabel,
|
|
5114
|
+
branding.surchargeStyle,
|
|
5115
|
+
branding.surchargePosition
|
|
5116
|
+
);
|
|
5117
|
+
if (!percentAvailable) return { first: "amount", second: null, label };
|
|
5118
|
+
const ordered = {
|
|
5119
|
+
amount: ["amount", null],
|
|
5120
|
+
percent: ["percent", null],
|
|
5121
|
+
amountThenPercent: ["amount", "percent"],
|
|
5122
|
+
percentThenAmount: ["percent", "amount"]
|
|
5123
|
+
};
|
|
5124
|
+
const [first, second] = ordered[mode];
|
|
5125
|
+
const cornerRibbon = branding.surchargeStyle === "ribbon" && (branding.surchargePosition === "cornerStart" || branding.surchargePosition === "cornerEnd");
|
|
5126
|
+
return { first, second: cornerRibbon ? null : second, label };
|
|
5127
|
+
}
|
|
5128
|
+
function readableInkOn(color) {
|
|
5129
|
+
const onBlack = contrastRatio(color, "#000000");
|
|
5130
|
+
const onWhite = contrastRatio(color, "#ffffff");
|
|
5131
|
+
if (onBlack === null || onWhite === null) return "#ffffff";
|
|
5132
|
+
return onBlack >= onWhite ? "#000000" : "#ffffff";
|
|
5133
|
+
}
|
|
5134
|
+
var SURCHARGE_FONT_SIZE = {
|
|
5135
|
+
sm: "0.6875rem",
|
|
5136
|
+
md: "0.8125rem",
|
|
5137
|
+
lg: "0.9375rem"
|
|
5138
|
+
};
|
|
5139
|
+
var SURCHARGE_PAD = {
|
|
5140
|
+
sm: "1px 6px",
|
|
5141
|
+
md: "2px 8px",
|
|
5142
|
+
lg: "3px 10px"
|
|
5143
|
+
};
|
|
5144
|
+
var SURCHARGE_RADIUS = {
|
|
5145
|
+
pill: "999px",
|
|
5146
|
+
rounded: "6px",
|
|
5147
|
+
square: "0px"
|
|
5148
|
+
};
|
|
5149
|
+
var SURCHARGE_BORDER_WIDTH = {
|
|
5150
|
+
none: "0px",
|
|
5151
|
+
thin: "1px",
|
|
5152
|
+
medium: "2px",
|
|
5153
|
+
thick: "3px"
|
|
5154
|
+
};
|
|
5155
|
+
var SURCHARGE_FONT_WEIGHT = {
|
|
5156
|
+
regular: "400",
|
|
5157
|
+
medium: "600",
|
|
5158
|
+
bold: "700"
|
|
5159
|
+
};
|
|
5160
|
+
var SURCHARGE_POSITIONS = [
|
|
5161
|
+
"trailing",
|
|
5162
|
+
"inline",
|
|
5163
|
+
"below",
|
|
5164
|
+
"above",
|
|
5165
|
+
"cornerStart",
|
|
5166
|
+
"cornerEnd"
|
|
5167
|
+
];
|
|
5168
|
+
var SURCHARGE_STYLES = [
|
|
5169
|
+
"plain",
|
|
5170
|
+
"underline",
|
|
5171
|
+
"outline",
|
|
5172
|
+
"badge",
|
|
5173
|
+
"solid",
|
|
5174
|
+
"ribbon"
|
|
5175
|
+
];
|
|
5176
|
+
var SURCHARGE_BORDER_WIDTHS = [
|
|
5177
|
+
"none",
|
|
5178
|
+
"thin",
|
|
5179
|
+
"medium",
|
|
5180
|
+
"thick"
|
|
5181
|
+
];
|
|
5182
|
+
var SURCHARGE_BORDER_STYLES = [
|
|
5183
|
+
"solid",
|
|
5184
|
+
"dashed",
|
|
5185
|
+
"dotted"
|
|
5186
|
+
];
|
|
5187
|
+
var SURCHARGE_SIZES = ["sm", "md", "lg"];
|
|
5188
|
+
function surchargeStyleDrawsAShape(style) {
|
|
5189
|
+
return style === "badge" || style === "outline" || style === "solid";
|
|
5190
|
+
}
|
|
5191
|
+
var SURCHARGE_SHAPES = ["pill", "rounded", "square"];
|
|
5192
|
+
var SURCHARGE_WEIGHTS = ["regular", "medium", "bold"];
|
|
5193
|
+
var SURCHARGE_SIGNS = ["always", "minusOnly", "none"];
|
|
5194
|
+
var SURCHARGE_LABEL_MODES = ["amount", "labelled"];
|
|
5195
|
+
var SURCHARGE_FIGURE_MODES = [
|
|
5196
|
+
"amount",
|
|
5197
|
+
"percent",
|
|
5198
|
+
"amountThenPercent",
|
|
5199
|
+
"percentThenAmount"
|
|
5200
|
+
];
|
|
5201
|
+
var CHECKOUT_LOCALES = ["en", "de"];
|
|
5202
|
+
var LOCALIZABLE_COPY_FIELDS = [
|
|
5203
|
+
"headerText",
|
|
5204
|
+
"payButtonLabel",
|
|
5205
|
+
"cardTermsMessage",
|
|
5206
|
+
"footerText"
|
|
5207
|
+
];
|
|
5208
|
+
function copyTranslationsKey(field) {
|
|
5209
|
+
return `${field}Translations`;
|
|
5210
|
+
}
|
|
5211
|
+
function checkoutCopy(branding, field, locale) {
|
|
5212
|
+
const translated = translationFor(branding[copyTranslationsKey(field)], locale);
|
|
5213
|
+
return translated ?? branding[field];
|
|
5214
|
+
}
|
|
5215
|
+
function surchargeWordFor(branding, isDiscount, locale) {
|
|
5216
|
+
return translationFor(
|
|
5217
|
+
isDiscount ? branding.discountWordTranslations : branding.surchargeWordTranslations,
|
|
5218
|
+
locale
|
|
5219
|
+
);
|
|
5220
|
+
}
|
|
5037
5221
|
var FONT_STACKS = {
|
|
5038
5222
|
inter: "'Inter Variable', 'Inter', system-ui, -apple-system, sans-serif",
|
|
5039
5223
|
system: "system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif",
|
|
@@ -5224,6 +5408,44 @@ var DEFAULT_BRANDING_BASE = {
|
|
|
5224
5408
|
verticalGap: "comfortable",
|
|
5225
5409
|
inputSize: "md",
|
|
5226
5410
|
buttonSize: "md",
|
|
5411
|
+
// Disclosure on by default: with provider-scoped pricing the tile is where
|
|
5412
|
+
// the buyer chooses between prices, and a price they cannot see is one they
|
|
5413
|
+
// find out about on the statement.
|
|
5414
|
+
showSurcharge: true,
|
|
5415
|
+
surchargePosition: "trailing",
|
|
5416
|
+
surchargeStyle: "badge",
|
|
5417
|
+
surchargeSize: "sm",
|
|
5418
|
+
surchargeShape: "pill",
|
|
5419
|
+
surchargeBorderWidth: "thin",
|
|
5420
|
+
surchargeBorderStyle: "solid",
|
|
5421
|
+
surchargeWeight: "medium",
|
|
5422
|
+
surchargeSign: "always",
|
|
5423
|
+
surchargeUppercase: false,
|
|
5424
|
+
// Named, not bare. A tile that reads "-EUR 2.50" beside a brand name is a
|
|
5425
|
+
// number with no subject — buyers read it as the price, not as a change to
|
|
5426
|
+
// it. "Discount -EUR 2.50" needs no interpreting, and the word is what makes
|
|
5427
|
+
// the default configuration legible without the merchant touching anything.
|
|
5428
|
+
surchargeLabel: "labelled",
|
|
5429
|
+
// The two directions default differently on purpose, which is the whole
|
|
5430
|
+
// reason they are two settings. A fee is something a buyer acts on in money,
|
|
5431
|
+
// so it leads with money and says nothing else. A saving is something worth
|
|
5432
|
+
// advertising, and the share is the persuasive half of it — "-5.1% (EUR
|
|
5433
|
+
// 2.50)" sells what "-EUR 2.50" merely states, and the amount is still right
|
|
5434
|
+
// there beside it.
|
|
5435
|
+
surchargeFigure: "amount",
|
|
5436
|
+
discountFigure: "percentThenAmount",
|
|
5437
|
+
// Empty: the checkout's own localized words are the default, in every
|
|
5438
|
+
// language it ships. A merchant fills these in only to say it differently.
|
|
5439
|
+
surchargeWordTranslations: {},
|
|
5440
|
+
discountWordTranslations: {},
|
|
5441
|
+
// amber-700 / emerald-700, not the 600s: the `plain` style renders the
|
|
5442
|
+
// disclosure as coloured TEXT, so it is bound by `WCAG_AA_TEXT` (4.5) rather
|
|
5443
|
+
// than by the 3:1 a coloured shape would be, and the 600s come to 3.19 and
|
|
5444
|
+
// 3.77 against the default white surface. These are 5.02 and 5.48, pinned by
|
|
5445
|
+
// tests. Far enough apart to read as opposite news at a glance rather than as
|
|
5446
|
+
// two shades of "extra".
|
|
5447
|
+
surchargeColor: "#b45309",
|
|
5448
|
+
discountColor: "#047857",
|
|
5227
5449
|
layout: "split",
|
|
5228
5450
|
summaryPosition: "left",
|
|
5229
5451
|
showOrderSummary: true,
|
|
@@ -5232,10 +5454,17 @@ var DEFAULT_BRANDING_BASE = {
|
|
|
5232
5454
|
totalLabel: "Total",
|
|
5233
5455
|
showCurrencyCode: false,
|
|
5234
5456
|
showOrderItems: true,
|
|
5457
|
+
// Each flat field keeps its meaning: what the merchant wrote, used in every
|
|
5458
|
+
// locale that carries no override. Empty maps therefore change nothing for a
|
|
5459
|
+
// profile saved before translations existed.
|
|
5235
5460
|
headerText: "",
|
|
5461
|
+
headerTextTranslations: {},
|
|
5236
5462
|
payButtonLabel: "",
|
|
5463
|
+
payButtonLabelTranslations: {},
|
|
5237
5464
|
cardTermsMessage: "",
|
|
5465
|
+
cardTermsMessageTranslations: {},
|
|
5238
5466
|
footerText: "",
|
|
5467
|
+
footerTextTranslations: {},
|
|
5239
5468
|
supportEmail: "",
|
|
5240
5469
|
paymentLayout: "tabs",
|
|
5241
5470
|
labelStyle: "above",
|
|
@@ -5261,6 +5490,11 @@ var DEFAULT_BRANDING_DARK = {
|
|
|
5261
5490
|
buttonBackground: "#1E4FEB",
|
|
5262
5491
|
buttonText: "#ffffff",
|
|
5263
5492
|
surfaceStyle: "flat",
|
|
5493
|
+
// amber-400 / emerald-400: the 700s above are far too dark to read on
|
|
5494
|
+
// slate-900, and this pair is the same news in the same order at the light
|
|
5495
|
+
// end of the ramp — 10.69 and 9.29 against the dark surface, also pinned.
|
|
5496
|
+
surchargeColor: "#fbbf24",
|
|
5497
|
+
discountColor: "#34d399",
|
|
5264
5498
|
trustBadges: DEFAULT_BADGES_DARK.map((b) => ({ ...b })),
|
|
5265
5499
|
customFields: []
|
|
5266
5500
|
};
|
|
@@ -5271,7 +5505,16 @@ function cloneBranding(b) {
|
|
|
5271
5505
|
return {
|
|
5272
5506
|
...b,
|
|
5273
5507
|
trustBadges: b.trustBadges.map((badge) => ({ ...badge })),
|
|
5274
|
-
customFields: b.customFields.map(cloneCustomField)
|
|
5508
|
+
customFields: b.customFields.map(cloneCustomField),
|
|
5509
|
+
// Copied, not shared. A spread alone would leave the clone pointing at the
|
|
5510
|
+
// original's maps, and the dashboard edits a clone precisely so the form
|
|
5511
|
+
// can be abandoned without touching what is saved.
|
|
5512
|
+
surchargeWordTranslations: { ...b.surchargeWordTranslations },
|
|
5513
|
+
discountWordTranslations: { ...b.discountWordTranslations },
|
|
5514
|
+
headerTextTranslations: { ...b.headerTextTranslations },
|
|
5515
|
+
payButtonLabelTranslations: { ...b.payButtonLabelTranslations },
|
|
5516
|
+
cardTermsMessageTranslations: { ...b.cardTermsMessageTranslations },
|
|
5517
|
+
footerTextTranslations: { ...b.footerTextTranslations }
|
|
5275
5518
|
};
|
|
5276
5519
|
}
|
|
5277
5520
|
function cloneCustomField(f) {
|
|
@@ -5422,13 +5665,25 @@ function defaultCustomFieldVisibility() {
|
|
|
5422
5665
|
return { mode: "always", match: "all", conditions: [] };
|
|
5423
5666
|
}
|
|
5424
5667
|
function parseTranslations(raw) {
|
|
5425
|
-
|
|
5668
|
+
let value = raw;
|
|
5669
|
+
if (typeof value === "string") {
|
|
5670
|
+
try {
|
|
5671
|
+
value = JSON.parse(value);
|
|
5672
|
+
} catch {
|
|
5673
|
+
return {};
|
|
5674
|
+
}
|
|
5675
|
+
}
|
|
5676
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return {};
|
|
5426
5677
|
const out = {};
|
|
5427
|
-
for (const [k, v] of Object.entries(
|
|
5428
|
-
if (typeof v === "string" && v.length > 0) out[k] = v;
|
|
5678
|
+
for (const [k, v] of Object.entries(value)) {
|
|
5679
|
+
if (typeof v === "string" && v.trim().length > 0) out[k] = v;
|
|
5429
5680
|
}
|
|
5430
5681
|
return out;
|
|
5431
5682
|
}
|
|
5683
|
+
function encodeTranslations(map) {
|
|
5684
|
+
const entries = Object.entries(map).filter(([, v]) => v.trim().length > 0);
|
|
5685
|
+
return entries.length > 0 ? JSON.stringify(Object.fromEntries(entries)) : void 0;
|
|
5686
|
+
}
|
|
5432
5687
|
function normalizeCondition(raw, index) {
|
|
5433
5688
|
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return null;
|
|
5434
5689
|
const c = raw;
|
|
@@ -5780,6 +6035,74 @@ function decodeBranding(source) {
|
|
|
5780
6035
|
["sm", "md", "lg"],
|
|
5781
6036
|
DEFAULT_BRANDING.buttonSize
|
|
5782
6037
|
),
|
|
6038
|
+
showSurcharge: parseBool(extras["showSurcharge"], DEFAULT_BRANDING.showSurcharge),
|
|
6039
|
+
surchargePosition: pickEnum(
|
|
6040
|
+
extras["surchargePosition"],
|
|
6041
|
+
SURCHARGE_POSITIONS,
|
|
6042
|
+
DEFAULT_BRANDING.surchargePosition
|
|
6043
|
+
),
|
|
6044
|
+
surchargeStyle: pickEnum(
|
|
6045
|
+
extras["surchargeStyle"],
|
|
6046
|
+
SURCHARGE_STYLES,
|
|
6047
|
+
DEFAULT_BRANDING.surchargeStyle
|
|
6048
|
+
),
|
|
6049
|
+
surchargeSize: pickEnum(
|
|
6050
|
+
extras["surchargeSize"],
|
|
6051
|
+
SURCHARGE_SIZES,
|
|
6052
|
+
DEFAULT_BRANDING.surchargeSize
|
|
6053
|
+
),
|
|
6054
|
+
surchargeShape: pickEnum(
|
|
6055
|
+
extras["surchargeShape"],
|
|
6056
|
+
SURCHARGE_SHAPES,
|
|
6057
|
+
DEFAULT_BRANDING.surchargeShape
|
|
6058
|
+
),
|
|
6059
|
+
surchargeBorderWidth: pickEnum(
|
|
6060
|
+
extras["surchargeBorderWidth"],
|
|
6061
|
+
SURCHARGE_BORDER_WIDTHS,
|
|
6062
|
+
DEFAULT_BRANDING.surchargeBorderWidth
|
|
6063
|
+
),
|
|
6064
|
+
surchargeBorderStyle: pickEnum(
|
|
6065
|
+
extras["surchargeBorderStyle"],
|
|
6066
|
+
SURCHARGE_BORDER_STYLES,
|
|
6067
|
+
DEFAULT_BRANDING.surchargeBorderStyle
|
|
6068
|
+
),
|
|
6069
|
+
surchargeWeight: pickEnum(
|
|
6070
|
+
extras["surchargeWeight"],
|
|
6071
|
+
SURCHARGE_WEIGHTS,
|
|
6072
|
+
DEFAULT_BRANDING.surchargeWeight
|
|
6073
|
+
),
|
|
6074
|
+
surchargeSign: pickEnum(
|
|
6075
|
+
extras["surchargeSign"],
|
|
6076
|
+
SURCHARGE_SIGNS,
|
|
6077
|
+
DEFAULT_BRANDING.surchargeSign
|
|
6078
|
+
),
|
|
6079
|
+
surchargeUppercase: parseBool(
|
|
6080
|
+
extras["surchargeUppercase"],
|
|
6081
|
+
DEFAULT_BRANDING.surchargeUppercase
|
|
6082
|
+
),
|
|
6083
|
+
surchargeLabel: pickEnum(
|
|
6084
|
+
extras["surchargeLabel"],
|
|
6085
|
+
SURCHARGE_LABEL_MODES,
|
|
6086
|
+
DEFAULT_BRANDING.surchargeLabel
|
|
6087
|
+
),
|
|
6088
|
+
surchargeFigure: pickEnum(
|
|
6089
|
+
extras["surchargeFigure"],
|
|
6090
|
+
SURCHARGE_FIGURE_MODES,
|
|
6091
|
+
DEFAULT_BRANDING.surchargeFigure
|
|
6092
|
+
),
|
|
6093
|
+
discountFigure: pickEnum(
|
|
6094
|
+
extras["discountFigure"],
|
|
6095
|
+
SURCHARGE_FIGURE_MODES,
|
|
6096
|
+
DEFAULT_BRANDING.discountFigure
|
|
6097
|
+
),
|
|
6098
|
+
surchargeWordTranslations: parseTranslations(extras["surchargeWordTranslations"]),
|
|
6099
|
+
discountWordTranslations: parseTranslations(extras["discountWordTranslations"]),
|
|
6100
|
+
headerTextTranslations: parseTranslations(extras["headerTextTranslations"]),
|
|
6101
|
+
payButtonLabelTranslations: parseTranslations(extras["payButtonLabelTranslations"]),
|
|
6102
|
+
cardTermsMessageTranslations: parseTranslations(extras["cardTermsMessageTranslations"]),
|
|
6103
|
+
footerTextTranslations: parseTranslations(extras["footerTextTranslations"]),
|
|
6104
|
+
surchargeColor: s(extras["surchargeColor"]) || DEFAULT_BRANDING.surchargeColor,
|
|
6105
|
+
discountColor: s(extras["discountColor"]) || DEFAULT_BRANDING.discountColor,
|
|
5783
6106
|
layout: pickEnum(extras["layout"], ["compact", "split"], DEFAULT_BRANDING.layout),
|
|
5784
6107
|
summaryPosition: pickEnum(
|
|
5785
6108
|
extras["summaryPosition"],
|
|
@@ -5833,6 +6156,21 @@ function encodeBranding(branding, base) {
|
|
|
5833
6156
|
verticalGap: branding.verticalGap,
|
|
5834
6157
|
inputSize: branding.inputSize,
|
|
5835
6158
|
buttonSize: branding.buttonSize,
|
|
6159
|
+
showSurcharge: String(branding.showSurcharge),
|
|
6160
|
+
surchargePosition: branding.surchargePosition,
|
|
6161
|
+
surchargeStyle: branding.surchargeStyle,
|
|
6162
|
+
surchargeSize: branding.surchargeSize,
|
|
6163
|
+
surchargeShape: branding.surchargeShape,
|
|
6164
|
+
surchargeBorderWidth: branding.surchargeBorderWidth,
|
|
6165
|
+
surchargeBorderStyle: branding.surchargeBorderStyle,
|
|
6166
|
+
surchargeWeight: branding.surchargeWeight,
|
|
6167
|
+
surchargeSign: branding.surchargeSign,
|
|
6168
|
+
surchargeUppercase: String(branding.surchargeUppercase),
|
|
6169
|
+
surchargeLabel: branding.surchargeLabel,
|
|
6170
|
+
surchargeFigure: branding.surchargeFigure,
|
|
6171
|
+
discountFigure: branding.discountFigure,
|
|
6172
|
+
surchargeColor: branding.surchargeColor,
|
|
6173
|
+
discountColor: branding.discountColor,
|
|
5836
6174
|
layout: branding.layout,
|
|
5837
6175
|
summaryPosition: branding.summaryPosition,
|
|
5838
6176
|
showOrderSummary: String(branding.showOrderSummary),
|
|
@@ -5850,6 +6188,17 @@ function encodeBranding(branding, base) {
|
|
|
5850
6188
|
if (branding.customFields.length > 0) {
|
|
5851
6189
|
extras["customFields"] = encodeCustomFields(branding.customFields);
|
|
5852
6190
|
}
|
|
6191
|
+
for (const key of [
|
|
6192
|
+
"surchargeWordTranslations",
|
|
6193
|
+
"discountWordTranslations",
|
|
6194
|
+
"headerTextTranslations",
|
|
6195
|
+
"payButtonLabelTranslations",
|
|
6196
|
+
"cardTermsMessageTranslations",
|
|
6197
|
+
"footerTextTranslations"
|
|
6198
|
+
]) {
|
|
6199
|
+
const encoded = encodeTranslations(branding[key]);
|
|
6200
|
+
if (encoded) extras[key] = encoded;
|
|
6201
|
+
}
|
|
5853
6202
|
const tagline = trim(branding.tagline);
|
|
5854
6203
|
if (tagline) extras["tagline"] = tagline;
|
|
5855
6204
|
const footer = trim(branding.footerText);
|
|
@@ -5958,6 +6307,71 @@ function parseImportedBranding(raw) {
|
|
|
5958
6307
|
),
|
|
5959
6308
|
inputSize: pickEnum(root["inputSize"], ["sm", "md", "lg"], dflt.inputSize),
|
|
5960
6309
|
buttonSize: pickEnum(root["buttonSize"], ["sm", "md", "lg"], dflt.buttonSize),
|
|
6310
|
+
showSurcharge: parseBool(root["showSurcharge"], dflt.showSurcharge),
|
|
6311
|
+
surchargePosition: pickEnum(
|
|
6312
|
+
root["surchargePosition"],
|
|
6313
|
+
SURCHARGE_POSITIONS,
|
|
6314
|
+
dflt.surchargePosition
|
|
6315
|
+
),
|
|
6316
|
+
surchargeStyle: pickEnum(
|
|
6317
|
+
root["surchargeStyle"],
|
|
6318
|
+
SURCHARGE_STYLES,
|
|
6319
|
+
dflt.surchargeStyle
|
|
6320
|
+
),
|
|
6321
|
+
surchargeSize: pickEnum(
|
|
6322
|
+
root["surchargeSize"],
|
|
6323
|
+
SURCHARGE_SIZES,
|
|
6324
|
+
dflt.surchargeSize
|
|
6325
|
+
),
|
|
6326
|
+
surchargeShape: pickEnum(
|
|
6327
|
+
root["surchargeShape"],
|
|
6328
|
+
SURCHARGE_SHAPES,
|
|
6329
|
+
dflt.surchargeShape
|
|
6330
|
+
),
|
|
6331
|
+
surchargeBorderWidth: pickEnum(
|
|
6332
|
+
root["surchargeBorderWidth"],
|
|
6333
|
+
SURCHARGE_BORDER_WIDTHS,
|
|
6334
|
+
dflt.surchargeBorderWidth
|
|
6335
|
+
),
|
|
6336
|
+
surchargeBorderStyle: pickEnum(
|
|
6337
|
+
root["surchargeBorderStyle"],
|
|
6338
|
+
SURCHARGE_BORDER_STYLES,
|
|
6339
|
+
dflt.surchargeBorderStyle
|
|
6340
|
+
),
|
|
6341
|
+
surchargeWeight: pickEnum(
|
|
6342
|
+
root["surchargeWeight"],
|
|
6343
|
+
SURCHARGE_WEIGHTS,
|
|
6344
|
+
dflt.surchargeWeight
|
|
6345
|
+
),
|
|
6346
|
+
surchargeSign: pickEnum(
|
|
6347
|
+
root["surchargeSign"],
|
|
6348
|
+
SURCHARGE_SIGNS,
|
|
6349
|
+
dflt.surchargeSign
|
|
6350
|
+
),
|
|
6351
|
+
surchargeUppercase: parseBool(root["surchargeUppercase"], dflt.surchargeUppercase),
|
|
6352
|
+
surchargeLabel: pickEnum(
|
|
6353
|
+
root["surchargeLabel"],
|
|
6354
|
+
SURCHARGE_LABEL_MODES,
|
|
6355
|
+
dflt.surchargeLabel
|
|
6356
|
+
),
|
|
6357
|
+
surchargeFigure: pickEnum(
|
|
6358
|
+
root["surchargeFigure"],
|
|
6359
|
+
SURCHARGE_FIGURE_MODES,
|
|
6360
|
+
dflt.surchargeFigure
|
|
6361
|
+
),
|
|
6362
|
+
discountFigure: pickEnum(
|
|
6363
|
+
root["discountFigure"],
|
|
6364
|
+
SURCHARGE_FIGURE_MODES,
|
|
6365
|
+
dflt.discountFigure
|
|
6366
|
+
),
|
|
6367
|
+
surchargeWordTranslations: parseTranslations(root["surchargeWordTranslations"]),
|
|
6368
|
+
discountWordTranslations: parseTranslations(root["discountWordTranslations"]),
|
|
6369
|
+
headerTextTranslations: parseTranslations(root["headerTextTranslations"]),
|
|
6370
|
+
payButtonLabelTranslations: parseTranslations(root["payButtonLabelTranslations"]),
|
|
6371
|
+
cardTermsMessageTranslations: parseTranslations(root["cardTermsMessageTranslations"]),
|
|
6372
|
+
footerTextTranslations: parseTranslations(root["footerTextTranslations"]),
|
|
6373
|
+
surchargeColor: sHex(root["surchargeColor"], dflt.surchargeColor),
|
|
6374
|
+
discountColor: sHex(root["discountColor"], dflt.discountColor),
|
|
5961
6375
|
layout: pickEnum(root["layout"], ["compact", "split"], dflt.layout),
|
|
5962
6376
|
summaryPosition: pickEnum(
|
|
5963
6377
|
root["summaryPosition"],
|
|
@@ -6024,6 +6438,19 @@ function applyBrandingVariables(el, b) {
|
|
|
6024
6438
|
set("--dp-gap-vertical", VERTICAL_GAP[b.verticalGap]);
|
|
6025
6439
|
set("--dp-input-pad", INPUT_PAD[b.inputSize]);
|
|
6026
6440
|
set("--dp-button-pad", BUTTON_PAD[b.buttonSize]);
|
|
6441
|
+
set("--dp-surcharge", b.surchargeColor);
|
|
6442
|
+
set("--dp-discount", b.discountColor);
|
|
6443
|
+
set("--dp-surcharge-ink", readableInkOn(b.surchargeColor));
|
|
6444
|
+
set("--dp-discount-ink", readableInkOn(b.discountColor));
|
|
6445
|
+
set("--dp-surcharge-size", SURCHARGE_FONT_SIZE[b.surchargeSize]);
|
|
6446
|
+
set("--dp-surcharge-pad", SURCHARGE_PAD[b.surchargeSize]);
|
|
6447
|
+
set("--dp-surcharge-radius", SURCHARGE_RADIUS[b.surchargeShape]);
|
|
6448
|
+
set("--dp-surcharge-weight", SURCHARGE_FONT_WEIGHT[b.surchargeWeight]);
|
|
6449
|
+
set(
|
|
6450
|
+
"--dp-surcharge-border-width",
|
|
6451
|
+
SURCHARGE_BORDER_WIDTH[b.surchargeStyle === "outline" && b.surchargeBorderWidth === "none" ? "thin" : b.surchargeBorderWidth]
|
|
6452
|
+
);
|
|
6453
|
+
set("--dp-surcharge-border-style", b.surchargeBorderStyle);
|
|
6027
6454
|
set("--dp-shadow", shadowFor(b.surfaceStyle));
|
|
6028
6455
|
set(
|
|
6029
6456
|
"--dp-surface-border",
|
|
@@ -6414,9 +6841,9 @@ var STRIPE_FALLBACK_PANE_METHODS = [
|
|
|
6414
6841
|
requiresBillingCountry: true,
|
|
6415
6842
|
defaultLabel: "Klarna",
|
|
6416
6843
|
// NOT the router's current "Pay later or in 3 instalments". This table is
|
|
6417
|
-
// what a router predating the capability endpoint
|
|
6418
|
-
//
|
|
6419
|
-
//
|
|
6844
|
+
// what a router predating the capability endpoint renders, and that copy
|
|
6845
|
+
// only gained the "3" in the same release that added the endpoint.
|
|
6846
|
+
// Restating the new string here
|
|
6420
6847
|
// would put copy no reachable router emits in front of a merchant, and
|
|
6421
6848
|
// would change what the deprecated `nativePaneMethodInfo` has returned
|
|
6422
6849
|
// since 0.106.0.
|
|
@@ -6766,6 +7193,25 @@ export {
|
|
|
6766
7193
|
programToTree,
|
|
6767
7194
|
FeeProgramBuilder,
|
|
6768
7195
|
feeProgram,
|
|
7196
|
+
surchargeShowsLabel,
|
|
7197
|
+
surchargeFigurePlan,
|
|
7198
|
+
readableInkOn,
|
|
7199
|
+
SURCHARGE_POSITIONS,
|
|
7200
|
+
SURCHARGE_STYLES,
|
|
7201
|
+
SURCHARGE_BORDER_WIDTHS,
|
|
7202
|
+
SURCHARGE_BORDER_STYLES,
|
|
7203
|
+
SURCHARGE_SIZES,
|
|
7204
|
+
surchargeStyleDrawsAShape,
|
|
7205
|
+
SURCHARGE_SHAPES,
|
|
7206
|
+
SURCHARGE_WEIGHTS,
|
|
7207
|
+
SURCHARGE_SIGNS,
|
|
7208
|
+
SURCHARGE_LABEL_MODES,
|
|
7209
|
+
SURCHARGE_FIGURE_MODES,
|
|
7210
|
+
CHECKOUT_LOCALES,
|
|
7211
|
+
LOCALIZABLE_COPY_FIELDS,
|
|
7212
|
+
copyTranslationsKey,
|
|
7213
|
+
checkoutCopy,
|
|
7214
|
+
surchargeWordFor,
|
|
6769
7215
|
fontStack,
|
|
6770
7216
|
radiusValue,
|
|
6771
7217
|
fontWeightValue,
|
|
@@ -6852,4 +7298,4 @@ export {
|
|
|
6852
7298
|
decodeNativePanes,
|
|
6853
7299
|
encodeNativePanes
|
|
6854
7300
|
};
|
|
6855
|
-
//# sourceMappingURL=chunk-
|
|
7301
|
+
//# sourceMappingURL=chunk-IQIUYV2B.js.map
|