@agent-cards/sdk 0.24.0 → 0.24.2
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/CHANGELOG.md +32 -0
- package/README.md +61 -4
- package/dist/adyen-merchant-hosted.generated.d.ts +1 -1
- package/dist/adyen-merchant-hosted.generated.js +128 -35
- package/dist/agent-amount.generated.js +1 -1
- package/dist/aurus.d.ts +33 -0
- package/dist/aurus.js +75 -0
- package/dist/builtin-registry.generated.js +1 -1
- package/dist/capabilities.generated.js +1 -1
- package/dist/card-fields.generated.js +1854 -440
- package/dist/cardlink-vpos.d.ts +43 -0
- package/dist/cardlink-vpos.js +90 -0
- package/dist/cdp.js +22 -0
- package/dist/checkout-com.generated.js +5 -1
- package/dist/client.d.ts +75 -0
- package/dist/client.js +75 -0
- package/dist/cybersource-flex.generated.d.ts +39 -1
- package/dist/cybersource-flex.generated.js +100 -11
- package/dist/eghl.d.ts +40 -0
- package/dist/eghl.js +72 -0
- package/dist/gmo.generated.js +7 -2
- package/dist/hosted-entry.js +2 -0
- package/dist/lifecycle.d.ts +10 -0
- package/dist/lifecycle.js +25 -0
- package/dist/paddle-tokenex.generated.js +7 -2
- package/dist/payrails.generated.js +7 -2
- package/dist/pre-claim.d.ts +5 -0
- package/dist/pre-claim.js +90 -2
- package/dist/preflight-catalog.json +179 -1
- package/dist/preflight-schemas.json +16 -0
- package/dist/preflight.generated.d.ts +5 -0
- package/dist/preflight.generated.js +49 -3
- package/dist/preparation.d.ts +7 -0
- package/dist/preparation.js +21 -0
- package/dist/primer.generated.js +1856 -442
- package/dist/shiji-sts.generated.js +7 -2
- package/dist/stripe-checkout.generated.js +1837 -475
- package/dist/substitutions.generated.js +94 -1
- package/dist/tap-payments.generated.js +7 -2
- package/dist/token-repeats.d.ts +32 -0
- package/dist/token-repeats.js +64 -0
- package/dist/twoc2p.generated.js +7 -2
- package/examples/preflight/kernel-native/inventory.json +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
// Generated from @agent-cards/payment-core. Do not edit.
|
|
3
|
-
// artifact-sha256:
|
|
3
|
+
// artifact-sha256: b51ae1e970674f5e2b35bd33193e9a5ed5b04142e3764296c28dcb3d91e3d17b
|
|
4
4
|
// src/card-number-key.js
|
|
5
5
|
var CARD_NUMBER_KEY = /^(number|card_number|cardnumber|cardNum|card_num|pan)$/i;
|
|
6
6
|
// src/json-path.js
|
|
@@ -101,8 +101,8 @@ function parseConvergeBody(body) {
|
|
|
101
101
|
return parsed;
|
|
102
102
|
}
|
|
103
103
|
function convergeAmountCents(value) {
|
|
104
|
-
const
|
|
105
|
-
const m = typeof
|
|
104
|
+
const text10 = typeof value === "number" && Number.isFinite(value) ? String(value) : value;
|
|
105
|
+
const m = typeof text10 === "string" ? AMOUNT.exec(text10) : null;
|
|
106
106
|
if (!m)
|
|
107
107
|
return null;
|
|
108
108
|
const cents2 = Number(m[1]) * 100 + Number(((m[2] ?? "") + "00").slice(0, 2));
|
|
@@ -357,8 +357,8 @@ var CONTROL = /[\u0000-\u001f\u007f]/;
|
|
|
357
357
|
var cardLikeName = (name) => (name.match(/[0-9]/g) ?? []).length >= 12;
|
|
358
358
|
var record3 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
359
359
|
var sameKeys = (value, keys) => {
|
|
360
|
-
const
|
|
361
|
-
return
|
|
360
|
+
const own24 = Object.keys(value);
|
|
361
|
+
return own24.length === keys.length && own24.every((key, at) => key === keys[at]);
|
|
362
362
|
};
|
|
363
363
|
var refuse4 = (code) => Object.freeze({ verdict: "refuse", code });
|
|
364
364
|
var CARD4 = /* @__PURE__ */ Object.freeze({ verdict: "card" });
|
|
@@ -582,9 +582,9 @@ var K = /* @__PURE__ */ new Uint32Array([
|
|
|
582
582
|
3329325298
|
|
583
583
|
]);
|
|
584
584
|
var rotr = (x, n) => x >>> n | x << 32 - n;
|
|
585
|
-
function utf8(
|
|
585
|
+
function utf8(text10) {
|
|
586
586
|
const out = [];
|
|
587
|
-
for (const char of
|
|
587
|
+
for (const char of text10) {
|
|
588
588
|
let cp = char.codePointAt(0);
|
|
589
589
|
if (cp >= 55296 && cp <= 57343)
|
|
590
590
|
cp = 65533;
|
|
@@ -659,6 +659,7 @@ var BASE64 = /^[A-Za-z0-9+/]+={0,2}$/;
|
|
|
659
659
|
var SHA256_HEX = /^[0-9a-f]{64}$/;
|
|
660
660
|
var RSA_ALGORITHM = [48, 13, 6, 9, 42, 134, 72, 134, 247, 13, 1, 1, 1, 5, 0];
|
|
661
661
|
var MODULUS_BYTES = [128, 256, 384, 512];
|
|
662
|
+
var SMALL_MODULUS_BYTES = 64;
|
|
662
663
|
var TYPED_ARRAY = Object.getPrototypeOf(Uint8Array.prototype);
|
|
663
664
|
var typedArrayName = Object.getOwnPropertyDescriptor(TYPED_ARRAY, Symbol.toStringTag).get;
|
|
664
665
|
function parseRsaPublicKey(key) {
|
|
@@ -667,6 +668,9 @@ function parseRsaPublicKey(key) {
|
|
|
667
668
|
const named = key && typeof key === "object" && Object.prototype.hasOwnProperty.call(key, "exponent") ? key.exponent : void 0;
|
|
668
669
|
if (named !== void 0 && named !== 17)
|
|
669
670
|
throw refuse6("key");
|
|
671
|
+
const sized = key && typeof key === "object" && Object.prototype.hasOwnProperty.call(key, "bits") ? key.bits : void 0;
|
|
672
|
+
if (sized !== void 0 && sized !== 512)
|
|
673
|
+
throw refuse6("key");
|
|
670
674
|
if (typeof spki !== "string" || spki.length > 1024 || spki.length % 4 !== 0 || !BASE64.test(spki))
|
|
671
675
|
throw refuse6("key");
|
|
672
676
|
if (typeof pin10 !== "string" || !SHA256_HEX.test(pin10))
|
|
@@ -699,7 +703,8 @@ function parseRsaPublicKey(key) {
|
|
|
699
703
|
if (exponent.end !== rsa.end)
|
|
700
704
|
throw refuse6("key");
|
|
701
705
|
const n = modulus.bytes;
|
|
702
|
-
|
|
706
|
+
const sizes = sized === 512 ? [SMALL_MODULUS_BYTES] : MODULUS_BYTES;
|
|
707
|
+
if (!sizes.includes(n.length) || !(n[0] & 128) || !(n[n.length - 1] & 1))
|
|
703
708
|
throw refuse6("key");
|
|
704
709
|
const e = exponent.bytes;
|
|
705
710
|
const expected = named === 17 ? [17] : [1, 0, 1];
|
|
@@ -771,8 +776,8 @@ var PADDLE_TOKENEX_PSP = "paddle_tokenex";
|
|
|
771
776
|
var PADDLE_TOKENEX_FACT_KEYS = /* @__PURE__ */ Object.freeze(["card_first_six", "card_last_four", "expiry_month", "expiry_year", "card_brand"]);
|
|
772
777
|
var record4 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
773
778
|
var sameKeys2 = (value, keys) => {
|
|
774
|
-
const
|
|
775
|
-
return
|
|
779
|
+
const own24 = Object.keys(value);
|
|
780
|
+
return own24.length === keys.length && own24.every((key, at) => key === keys[at]);
|
|
776
781
|
};
|
|
777
782
|
var refuse7 = (code) => Object.freeze({ verdict: "refuse", code });
|
|
778
783
|
var CARD6 = /* @__PURE__ */ Object.freeze({ verdict: "card" });
|
|
@@ -1261,8 +1266,8 @@ var TEXT_LIMIT = 256;
|
|
|
1261
1266
|
var CONTROL4 = /[\u0000-\u001f\u007f]/;
|
|
1262
1267
|
var record6 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
1263
1268
|
var sameKeys3 = (value, keys) => {
|
|
1264
|
-
const
|
|
1265
|
-
return
|
|
1269
|
+
const own24 = Object.keys(value);
|
|
1270
|
+
return own24.length === keys.length && own24.every((key, at) => key === keys[at]);
|
|
1266
1271
|
};
|
|
1267
1272
|
var plainText = (value) => typeof value === "string" && value.length <= TEXT_LIMIT && !CONTROL4.test(value) && (value.match(/[0-9]/g) ?? []).length < 12;
|
|
1268
1273
|
var refuse9 = (code) => Object.freeze({ verdict: "refuse", code });
|
|
@@ -1292,13 +1297,13 @@ function billingFields(value) {
|
|
|
1292
1297
|
if (names.length > MAX_FIELDS)
|
|
1293
1298
|
return false;
|
|
1294
1299
|
return names.every((name) => {
|
|
1295
|
-
const
|
|
1300
|
+
const field5 = value[name];
|
|
1296
1301
|
if (!FIELD_NAME.test(name))
|
|
1297
1302
|
return false;
|
|
1298
|
-
if (!record6(
|
|
1299
|
-
return billingText(
|
|
1300
|
-
const nested = Object.keys(
|
|
1301
|
-
return nested.length <= MAX_NESTED_FIELDS && nested.every((key) => FIELD_NAME.test(key) && billingText(
|
|
1303
|
+
if (!record6(field5))
|
|
1304
|
+
return billingText(field5);
|
|
1305
|
+
const nested = Object.keys(field5);
|
|
1306
|
+
return nested.length <= MAX_NESTED_FIELDS && nested.every((key) => FIELD_NAME.test(key) && billingText(field5[key]));
|
|
1302
1307
|
});
|
|
1303
1308
|
}
|
|
1304
1309
|
function wixPaymentsBodyVerdict(body) {
|
|
@@ -1464,8 +1469,8 @@ var EXPIRATION = /^[0-9]{2}(?:0[1-9]|1[0-2])$/;
|
|
|
1464
1469
|
var CARD_PAYMENT = "PAYMENT_CARD";
|
|
1465
1470
|
var record8 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
1466
1471
|
var sameKeys4 = (value, keys) => {
|
|
1467
|
-
const
|
|
1468
|
-
return
|
|
1472
|
+
const own24 = Object.keys(value);
|
|
1473
|
+
return own24.length === keys.length && own24.every((key, at) => key === keys[at]);
|
|
1469
1474
|
};
|
|
1470
1475
|
var refuse11 = (code) => Object.freeze({ verdict: "refuse", code });
|
|
1471
1476
|
var CARD10 = /* @__PURE__ */ Object.freeze({ verdict: "card" });
|
|
@@ -1695,8 +1700,8 @@ var LOCALE = /^[a-z]{2}(?:-[A-Za-z]{2,4})?$/;
|
|
|
1695
1700
|
var PAN_LIKE3 = /(?:[0-9][ _.:-]*){12,}/;
|
|
1696
1701
|
var record9 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
1697
1702
|
var sameKeys5 = (value, keys) => {
|
|
1698
|
-
const
|
|
1699
|
-
return
|
|
1703
|
+
const own24 = Object.keys(value);
|
|
1704
|
+
return own24.length === keys.length && own24.every((key, at) => key === keys[at]);
|
|
1700
1705
|
};
|
|
1701
1706
|
var refuse13 = (code) => Object.freeze({ verdict: "refuse", code });
|
|
1702
1707
|
var CARD12 = /* @__PURE__ */ Object.freeze({ verdict: "card" });
|
|
@@ -2112,7 +2117,7 @@ var luhn2 = (digits3) => {
|
|
|
2112
2117
|
return sum % 10 === 0;
|
|
2113
2118
|
};
|
|
2114
2119
|
var ANY_NETWORK = /^[2-6][0-9]{12,18}$/;
|
|
2115
|
-
var holdsCardShape = (
|
|
2120
|
+
var holdsCardShape = (text10, shape = NETWORK) => (text10.match(/[0-9]{13,}/g) ?? []).some((run) => run.length > 19 || shape.test(run) && luhn2(run));
|
|
2116
2121
|
var phone = (value) => typeof value === "string" && PHONE.test(value) && (value.match(/[0-9]/g) ?? []).length >= 6 && (value.match(/[0-9]/g) ?? []).length <= 15;
|
|
2117
2122
|
var refuse16 = (code) => Object.freeze({ verdict: "refuse", code });
|
|
2118
2123
|
var CARD15 = /* @__PURE__ */ Object.freeze({ verdict: "card" });
|
|
@@ -2340,13 +2345,13 @@ var printable = (value) => [...value].every((ch) => ch.charCodeAt(0) >= 32 && ch
|
|
|
2340
2345
|
function typed(value, limit = 256) {
|
|
2341
2346
|
return typeof value === "string" && value.length >= 1 && value.length <= limit && !PAN_LIKE4.test(value) && printable(value);
|
|
2342
2347
|
}
|
|
2343
|
-
function decodeBase64(
|
|
2344
|
-
if (typeof
|
|
2348
|
+
function decodeBase64(text10) {
|
|
2349
|
+
if (typeof text10 !== "string" || !BASE643.test(text10) || text10.length % 4 !== 0)
|
|
2345
2350
|
return null;
|
|
2346
2351
|
let bits = 0;
|
|
2347
2352
|
let value = 0;
|
|
2348
2353
|
let out = "";
|
|
2349
|
-
for (const ch of
|
|
2354
|
+
for (const ch of text10.replace(/=+$/, "")) {
|
|
2350
2355
|
value = (value << 6 | BASE64_ALPHABET.indexOf(ch)) & 16777215;
|
|
2351
2356
|
bits += 6;
|
|
2352
2357
|
if (bits >= 8) {
|
|
@@ -2356,8 +2361,8 @@ function decodeBase64(text9) {
|
|
|
2356
2361
|
}
|
|
2357
2362
|
return out;
|
|
2358
2363
|
}
|
|
2359
|
-
function soundDevice(
|
|
2360
|
-
const json = decodeBase64(
|
|
2364
|
+
function soundDevice(text10) {
|
|
2365
|
+
const json = decodeBase64(text10);
|
|
2361
2366
|
if (json === null)
|
|
2362
2367
|
return false;
|
|
2363
2368
|
let value;
|
|
@@ -2475,17 +2480,17 @@ function sumupBodyVerdict(body, url) {
|
|
|
2475
2480
|
var SALTED = /* @__PURE__ */ Object.freeze([83, 97, 108, 116, 101, 100, 95, 95]);
|
|
2476
2481
|
var B64 = /^[A-Za-z0-9+/]+={0,2}$/;
|
|
2477
2482
|
var FIELD_LIMIT = 1024;
|
|
2478
|
-
function decodeCanonical(
|
|
2479
|
-
if (typeof
|
|
2483
|
+
function decodeCanonical(text10) {
|
|
2484
|
+
if (typeof text10 !== "string" || text10.length === 0 || text10.length % 4 !== 0 || !B64.test(text10))
|
|
2480
2485
|
return null;
|
|
2481
2486
|
let binary;
|
|
2482
2487
|
try {
|
|
2483
|
-
binary = atob(
|
|
2488
|
+
binary = atob(text10);
|
|
2484
2489
|
}
|
|
2485
2490
|
catch {
|
|
2486
2491
|
return null;
|
|
2487
2492
|
}
|
|
2488
|
-
if (btoa(binary) !==
|
|
2493
|
+
if (btoa(binary) !== text10)
|
|
2489
2494
|
return null;
|
|
2490
2495
|
return Uint8Array.from(binary, (char) => char.charCodeAt(0));
|
|
2491
2496
|
}
|
|
@@ -2727,8 +2732,8 @@ var TEXT_LIMIT3 = 256;
|
|
|
2727
2732
|
var CONTROL7 = /[\u0000-\u001f\u007f]/;
|
|
2728
2733
|
var record13 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
2729
2734
|
var sameKeys7 = (value, keys) => {
|
|
2730
|
-
const
|
|
2731
|
-
return
|
|
2735
|
+
const own24 = Object.keys(value);
|
|
2736
|
+
return own24.length === keys.length && own24.every((key, at) => key === keys[at]);
|
|
2732
2737
|
};
|
|
2733
2738
|
var plainText3 = (value) => typeof value === "string" && value.length <= TEXT_LIMIT3 && !CONTROL7.test(value) && (value.match(/[0-9]/g) ?? []).length < 12;
|
|
2734
2739
|
var refuse19 = (code) => Object.freeze({ verdict: "refuse", code });
|
|
@@ -3424,7 +3429,7 @@ var YEAR11 = /^[0-9]{2}$/;
|
|
|
3424
3429
|
var CODE4 = /^[0-9]{3}$/;
|
|
3425
3430
|
var NAME_LIMIT3 = 100;
|
|
3426
3431
|
var NAME_WORD = /[a-z]+/gi;
|
|
3427
|
-
var printable2 = (
|
|
3432
|
+
var printable2 = (text10) => [...text10].every((character) => {
|
|
3428
3433
|
const point = character.codePointAt(0);
|
|
3429
3434
|
return point >= 32 && !(point >= 127 && point <= 159) && point !== 8232 && point !== 8233;
|
|
3430
3435
|
});
|
|
@@ -3433,8 +3438,8 @@ var HOSTNAME = /^(?=.{1,253}$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](
|
|
|
3433
3438
|
var PUBLISHABLE_KEY = /^[A-Za-z0-9]{16,64}$/;
|
|
3434
3439
|
var record18 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
3435
3440
|
var sameKeys8 = (value, keys) => {
|
|
3436
|
-
const
|
|
3437
|
-
return
|
|
3441
|
+
const own24 = Object.keys(value);
|
|
3442
|
+
return own24.length === keys.length && own24.every((key, at) => key === keys[at]);
|
|
3438
3443
|
};
|
|
3439
3444
|
var refuse24 = (code) => Object.freeze({ verdict: "refuse", code });
|
|
3440
3445
|
var CARD23 = /* @__PURE__ */ Object.freeze({ verdict: "card" });
|
|
@@ -3804,7 +3809,7 @@ var POSTAL_CODE3 = /^[A-Za-z0-9_]{0,16}$/;
|
|
|
3804
3809
|
var COUNTRY4 = /^[A-Z]{2}$/;
|
|
3805
3810
|
var TEXT_LIMIT7 = 256;
|
|
3806
3811
|
var CONTROL10 = /[\u0000-\u001f\u007f]/;
|
|
3807
|
-
var cardLike2 = (
|
|
3812
|
+
var cardLike2 = (text10) => (text10.match(/[0-9]/g) ?? []).length >= 12;
|
|
3808
3813
|
var text5 = (value) => typeof value === "string" && value.length <= TEXT_LIMIT7 && !CONTROL10.test(value) && !cardLike2(value);
|
|
3809
3814
|
var record21 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
3810
3815
|
var own5 = (value, key) => Object.prototype.hasOwnProperty.call(value, key);
|
|
@@ -4125,11 +4130,11 @@ var LONG_TEXT_LIMIT = BODY_LIMIT25;
|
|
|
4125
4130
|
var record22 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
4126
4131
|
var owns6 = (value, key) => Object.prototype.hasOwnProperty.call(value, key);
|
|
4127
4132
|
var sameKeys9 = (value, keys) => {
|
|
4128
|
-
const
|
|
4129
|
-
return
|
|
4133
|
+
const own24 = Object.keys(value);
|
|
4134
|
+
return own24.length === keys.length && own24.every((key, at) => key === keys[at]);
|
|
4130
4135
|
};
|
|
4131
4136
|
var exact3 = (pattern, value) => typeof value === "string" && pattern.test(value);
|
|
4132
|
-
var printable3 = (
|
|
4137
|
+
var printable3 = (text10) => [...text10].every((character) => {
|
|
4133
4138
|
const point = character.codePointAt(0);
|
|
4134
4139
|
return point >= 32 && !(point >= 127 && point <= 159) && point !== 8232 && point !== 8233;
|
|
4135
4140
|
});
|
|
@@ -4202,7 +4207,7 @@ function companyStore(value) {
|
|
|
4202
4207
|
return record22(value) && sameKeys9(value, COMPANY_KEYS) && whole(value.CompanyNumber, 1) && COMPANY_KEYS.slice(1).every((key) => key.startsWith("Show") ? flag(value[key]) : pageText(value[key]));
|
|
4203
4208
|
}
|
|
4204
4209
|
var SUM_TEXT = /^(?:0*[1-9][0-9]*(?:\.[0-9]+)?|0+\.[0-9]*[1-9][0-9]*)$/;
|
|
4205
|
-
var sumText = (
|
|
4210
|
+
var sumText = (text10, sum) => text10 === null || typeof text10 === "string" && SUM_TEXT.test(text10) && Number.parseFloat(text10) === sum;
|
|
4206
4211
|
function chosenProduct(value) {
|
|
4207
4212
|
return record22(value) && sameKeys9(value, PRODUCT_KEYS) && whole(value.MinQuantity) && whole(value.MaxQuantity) && whole(value.JumpsInQuantity) && value.SelectedBuyQuantity === 1 && Array.isArray(value.QuantityOptions) && value.QuantityOptions.length === 0 && pageText(value.Comments) && flag(value.IsManualSum) && Array.isArray(value.PaymentsOptions) && flag(value.IsCouponActive) && typeof value.ManualPrice === "number" && sumText(value.ManualPriceTxt, value.ManualPrice) && flag(value.IsVatFree) && Array.isArray(value.SpecialPrices) && (value.PreConfiguredPrice === null || typeof value.PreConfiguredPrice === "number") && flag(value.IsPreSelected) && typeof value.CurrentInventory === "number" && flag(value.CheckInventory) && exact3(PRODUCT_ID, value.uid) && pageText(value.imageUrl) && typeof value.name === "string" && pageText(value.name) && pageText(value.description) && typeof value.BasePrice === "number" && typeof value.PriceBeforeDiscount === "number" && whole(value.BaseISOCurrency) && typeof value.PriceToShow === "number" && typeof value.PriceBeforeDiscountToShow === "number" && flag(value.IsCurrent);
|
|
4208
4213
|
}
|
|
@@ -4433,7 +4438,7 @@ var sameKeys10 = (value, keys) => {
|
|
|
4433
4438
|
};
|
|
4434
4439
|
var refuse28 = (code) => Object.freeze({ verdict: "refuse", code });
|
|
4435
4440
|
var CARD27 = /* @__PURE__ */ Object.freeze({ verdict: "card" });
|
|
4436
|
-
var printable4 = (
|
|
4441
|
+
var printable4 = (text10) => [...text10].every((character) => {
|
|
4437
4442
|
const point = character.codePointAt(0);
|
|
4438
4443
|
return point >= 32 && !(point >= 127 && point <= 159) && point !== 8232 && point !== 8233;
|
|
4439
4444
|
});
|
|
@@ -4525,8 +4530,8 @@ var POSTAL_CODE4 = /^[A-Za-z0-9 -]{0,16}$/;
|
|
|
4525
4530
|
var CIPHERTEXT_B64 = /^[A-Za-z0-9+/]{341}[AQgw]==$/;
|
|
4526
4531
|
var record24 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
4527
4532
|
var sameKeys11 = (value, keys) => {
|
|
4528
|
-
const
|
|
4529
|
-
return
|
|
4533
|
+
const own24 = Object.keys(value);
|
|
4534
|
+
return own24.length === keys.length && own24.every((key, at) => key === keys[at]);
|
|
4530
4535
|
};
|
|
4531
4536
|
var refuse29 = (code) => Object.freeze({ verdict: "refuse", code });
|
|
4532
4537
|
var failed = (code) => (
|
|
@@ -4995,20 +5000,20 @@ function readBody18(body) {
|
|
|
4995
5000
|
function amountValue(value) {
|
|
4996
5001
|
if (typeof value === "number" && !Number.isFinite(value))
|
|
4997
5002
|
return false;
|
|
4998
|
-
const
|
|
4999
|
-
if (typeof
|
|
5003
|
+
const text10 = typeof value === "number" ? String(value) : value;
|
|
5004
|
+
if (typeof text10 !== "string" || !AMOUNT_TEXT.test(text10))
|
|
5000
5005
|
return false;
|
|
5001
|
-
const amount2 = Number(
|
|
5006
|
+
const amount2 = Number(text10);
|
|
5002
5007
|
return amount2 > 0 && amount2 <= AMOUNT_LIMIT3;
|
|
5003
5008
|
}
|
|
5004
5009
|
function billingDetails(value) {
|
|
5005
5010
|
if (!record27(value) || !inOrder5(value, BILLING_KEYS))
|
|
5006
5011
|
return false;
|
|
5007
5012
|
return Object.keys(value).every((key) => {
|
|
5008
|
-
const
|
|
5013
|
+
const field5 = value[key];
|
|
5009
5014
|
if (key !== "address")
|
|
5010
|
-
return key === "mobile_number" || key === "phone_number" ? typeof
|
|
5011
|
-
return record27(
|
|
5015
|
+
return key === "mobile_number" || key === "phone_number" ? typeof field5 === "string" && PHONE4.test(field5) : plainText6(field5);
|
|
5016
|
+
return record27(field5) && inOrder5(field5, ADDRESS_KEYS5) && Object.keys(field5).every((name) => plainText6(field5[name]));
|
|
5012
5017
|
});
|
|
5013
5018
|
}
|
|
5014
5019
|
function cardData(value) {
|
|
@@ -5196,10 +5201,10 @@ function isPaymobPayUrl(url) {
|
|
|
5196
5201
|
var BASE645 = /^[A-Za-z0-9+/]+={0,2}$/;
|
|
5197
5202
|
var BASE64URL = /^[A-Za-z0-9_-]+$/;
|
|
5198
5203
|
var ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
5199
|
-
function decodeBase642(
|
|
5200
|
-
if (typeof
|
|
5204
|
+
function decodeBase642(text10, url) {
|
|
5205
|
+
if (typeof text10 !== "string" || text10 === "")
|
|
5201
5206
|
return null;
|
|
5202
|
-
let body =
|
|
5207
|
+
let body = text10;
|
|
5203
5208
|
if (url) {
|
|
5204
5209
|
if (!BASE64URL.test(body) || body.length % 4 === 1)
|
|
5205
5210
|
return null;
|
|
@@ -5232,15 +5237,15 @@ function decodeBase642(text9, url) {
|
|
|
5232
5237
|
function jsonOf(bytes) {
|
|
5233
5238
|
if (!bytes)
|
|
5234
5239
|
return null;
|
|
5235
|
-
let
|
|
5240
|
+
let text10;
|
|
5236
5241
|
try {
|
|
5237
|
-
|
|
5242
|
+
text10 = new TextDecoder("utf-8", { fatal: true }).decode(bytes);
|
|
5238
5243
|
}
|
|
5239
5244
|
catch {
|
|
5240
5245
|
return null;
|
|
5241
5246
|
}
|
|
5242
5247
|
try {
|
|
5243
|
-
const value = JSON.parse(
|
|
5248
|
+
const value = JSON.parse(text10);
|
|
5244
5249
|
return record29(value) ? value : null;
|
|
5245
5250
|
}
|
|
5246
5251
|
catch {
|
|
@@ -5341,7 +5346,7 @@ function namesCardValue3(parsed) {
|
|
|
5341
5346
|
return false;
|
|
5342
5347
|
}
|
|
5343
5348
|
function addressBlock(value) {
|
|
5344
|
-
return record29(value) && Object.keys(value).length <= 32 && Object.entries(value).every(([key,
|
|
5349
|
+
return record29(value) && Object.keys(value).length <= 32 && Object.entries(value).every(([key, text10]) => FIELD.test(key) && !CARD_MEMBER4.test(key) && (text10 === null || typeof text10 === "string" && TEXT3.test(text10)));
|
|
5345
5350
|
}
|
|
5346
5351
|
function judgeCardPayment(parsed) {
|
|
5347
5352
|
const source = parsed.source;
|
|
@@ -5839,8 +5844,8 @@ function cardNamed2(key) {
|
|
|
5839
5844
|
const phrase = words.join(" ");
|
|
5840
5845
|
return words.some((word) => CARD_WORDS.includes(word)) || ["security code", "codigo seguridad", "codigo verificacion"].some((said) => phrase.includes(said));
|
|
5841
5846
|
}
|
|
5842
|
-
function carriesCardNumber(
|
|
5843
|
-
for (const [run] of
|
|
5847
|
+
function carriesCardNumber(text10) {
|
|
5848
|
+
for (const [run] of text10.matchAll(/[0-9]+(?:[ ._/,-][0-9]+)*/g)) {
|
|
5844
5849
|
const groups = run.split(/[ ._/,-]/);
|
|
5845
5850
|
for (let first = 0; first < groups.length; first += 1) {
|
|
5846
5851
|
let digits3 = "";
|
|
@@ -5853,17 +5858,17 @@ function carriesCardNumber(text9) {
|
|
|
5853
5858
|
}
|
|
5854
5859
|
return false;
|
|
5855
5860
|
}
|
|
5856
|
-
var wholeCardNumber = (
|
|
5861
|
+
var wholeCardNumber = (text10) => /^[2-6][0-9]{12,18}$/.test(text10) && luhn7(text10);
|
|
5857
5862
|
function membersRefusal(root) {
|
|
5858
5863
|
const pending = [[root, ""]];
|
|
5859
5864
|
while (pending.length > 0) {
|
|
5860
5865
|
const [node, path] = pending.pop();
|
|
5861
|
-
const
|
|
5866
|
+
const own24 = path === "" ? TRANSACTION_MEMBERS : owns7(RECORD_MEMBERS, path) ? RECORD_MEMBERS[path] : null;
|
|
5862
5867
|
for (const [key, child] of Object.entries(node)) {
|
|
5863
5868
|
const at = Array.isArray(node) ? path : path === "" ? key : `${path}.${key}`;
|
|
5864
5869
|
if (at === "checkoutCreditCard")
|
|
5865
5870
|
continue;
|
|
5866
|
-
if (
|
|
5871
|
+
if (own24 !== null && !own24.includes(key))
|
|
5867
5872
|
return true;
|
|
5868
5873
|
if (TEXT_RECORDS.includes(path) && child !== null && typeof child !== "string")
|
|
5869
5874
|
return true;
|
|
@@ -6144,6 +6149,182 @@ function registered(spec, parts) {
|
|
|
6144
6149
|
function registerProcessor(spec) {
|
|
6145
6150
|
return registered(spec, PARTS);
|
|
6146
6151
|
}
|
|
6152
|
+
// src/processors/aurus.js
|
|
6153
|
+
var AURUS_PSP = "aurus";
|
|
6154
|
+
var AURUS_OPERATION = "aurus.card_request";
|
|
6155
|
+
var AURUS_FRAME_HOST = /^pecst[0-9]{2}\.aurusepay\.com$/;
|
|
6156
|
+
var AURUS_TOKEN_PATH = "/storeservices/ecom/oneTimeToken";
|
|
6157
|
+
var AURUS_PARTS = /* @__PURE__ */ Object.freeze(["Param", "formFactorId", "txnDateTime", "encryptionFlag", "sha256Flag", "hmacAuthData", "payload"]);
|
|
6158
|
+
var URL_LIMIT14 = 256;
|
|
6159
|
+
var BODY_LIMIT35 = 32768;
|
|
6160
|
+
var SERVER = /^es[0-9]{2}\.auruspay\.com$/;
|
|
6161
|
+
var HEX = /^[0-9A-Fa-f]{2,8192}$/;
|
|
6162
|
+
var FORM_FACTOR = /^[0-9]{1,16}$/;
|
|
6163
|
+
var DATE_TIME = /^[0-9]{14}$/;
|
|
6164
|
+
var FRAMED = /^STX[0-9]{1,6}\[FS\][0-9A-Fa-f]{2,16384}\[FS\]7[Bb][0-9A-Fa-f]{0,24576}7[Dd]ETX$/;
|
|
6165
|
+
var refuse37 = (code) => Object.freeze({ verdict: "refuse", code });
|
|
6166
|
+
var CARD36 = /* @__PURE__ */ Object.freeze({ verdict: "card" });
|
|
6167
|
+
function aurusTokenUrl(url) {
|
|
6168
|
+
if (typeof url !== "string" || url.length > URL_LIMIT14 || url.includes("#"))
|
|
6169
|
+
return null;
|
|
6170
|
+
let parsed;
|
|
6171
|
+
try {
|
|
6172
|
+
parsed = new URL(url);
|
|
6173
|
+
}
|
|
6174
|
+
catch {
|
|
6175
|
+
return null;
|
|
6176
|
+
}
|
|
6177
|
+
if (parsed.href !== url || parsed.protocol !== "https:" || parsed.port || parsed.username || parsed.password || !AURUS_FRAME_HOST.test(parsed.hostname) || parsed.pathname !== AURUS_TOKEN_PATH)
|
|
6178
|
+
return null;
|
|
6179
|
+
const query = parsed.search.startsWith("?") ? parsed.search.slice(1).split("&") : [];
|
|
6180
|
+
if (query.length !== 2)
|
|
6181
|
+
return null;
|
|
6182
|
+
const [d1, d2] = query.map((pair) => pair.split("="));
|
|
6183
|
+
if (d1.length !== 2 || d2.length !== 2 || d1[0] !== "d1" || d2[0] !== "d2" || !SERVER.test(d1[1]) || !SERVER.test(d2[1]))
|
|
6184
|
+
return null;
|
|
6185
|
+
return Object.freeze({ host: parsed.hostname });
|
|
6186
|
+
}
|
|
6187
|
+
var isAurusTokenUrl = (url) => aurusTokenUrl(url) !== null;
|
|
6188
|
+
function readBody21(body) {
|
|
6189
|
+
if (typeof body !== "string" || body === "" || body.length > BODY_LIMIT35)
|
|
6190
|
+
return null;
|
|
6191
|
+
const pairs = body.split("&");
|
|
6192
|
+
if (pairs.length !== AURUS_PARTS.length)
|
|
6193
|
+
return null;
|
|
6194
|
+
const value = {};
|
|
6195
|
+
for (const [at, pair] of pairs.entries()) {
|
|
6196
|
+
const cut = pair.indexOf("=");
|
|
6197
|
+
if (cut < 0 || pair.slice(0, cut) !== AURUS_PARTS[at])
|
|
6198
|
+
return null;
|
|
6199
|
+
value[AURUS_PARTS[at]] = pair.slice(cut + 1);
|
|
6200
|
+
}
|
|
6201
|
+
if (!HEX.test(value.Param) || !FORM_FACTOR.test(value.formFactorId) || !DATE_TIME.test(value.txnDateTime) || value.encryptionFlag !== "00" || value.sha256Flag !== "1" || !FRAMED.test(value.hmacAuthData) || !FRAMED.test(value.payload))
|
|
6202
|
+
return null;
|
|
6203
|
+
return value;
|
|
6204
|
+
}
|
|
6205
|
+
function aurusBodyVerdict(body) {
|
|
6206
|
+
return readBody21(body) === null ? refuse37("aurus_body_unsupported") : CARD36;
|
|
6207
|
+
}
|
|
6208
|
+
var aurus_default = /* @__PURE__ */ registerProcessor({
|
|
6209
|
+
psp: AURUS_PSP,
|
|
6210
|
+
definitions: [
|
|
6211
|
+
{
|
|
6212
|
+
psp: "aurus",
|
|
6213
|
+
// The frame's card request, as the header above reads it. No sandbox host is known: Aurus's test instances were
|
|
6214
|
+
// not read, so none is listed and no environment is pinned.
|
|
6215
|
+
// Ships dark: served only to a client that declares `aurus_one_time_token`, and only for a company the backend's
|
|
6216
|
+
// processor gate turns Aurus on for. `(?![\w/.%-])` ends the path for a consumer that tests `match` unanchored.
|
|
6217
|
+
capability: "aurus_one_time_token",
|
|
6218
|
+
match: "pecst[0-9]{2}\\.aurusepay\\.com/storeservices/ecom/oneTimeToken(?![\\w/.%-])",
|
|
6219
|
+
hosts: ["^pecst[0-9]{2}\\.aurusepay\\.com$"],
|
|
6220
|
+
encoding: "form",
|
|
6221
|
+
// The frame's XHR marker. Origin, Referer and cookies never ride.
|
|
6222
|
+
passthroughHeaders: ["^x-requested-with$"]
|
|
6223
|
+
}
|
|
6224
|
+
],
|
|
6225
|
+
// Only the cardholder's device would send this card, after a person approves; no reviewed list names aurus.
|
|
6226
|
+
refusedOperations: [AURUS_OPERATION],
|
|
6227
|
+
// The frame mints a one-time token and reads nothing: the store's server charges it with its own credentials.
|
|
6228
|
+
settlementReadback: {
|
|
6229
|
+
answer: "none",
|
|
6230
|
+
reason: "tokenization_credential_cannot_read_charges",
|
|
6231
|
+
note: "The tokenization credential cannot read a charge; the shop charges the token later with its own credentials.",
|
|
6232
|
+
source: "https://www.oreillyauto.com/checkout (Aurus's ecom iframe, read 2026-10-31)"
|
|
6233
|
+
},
|
|
6234
|
+
exactUrl: isAurusTokenUrl,
|
|
6235
|
+
bodyGate: (url, body) => url !== void 0 && !isAurusTokenUrl(url) ? refuse37("aurus_url_refused") : aurusBodyVerdict(body),
|
|
6236
|
+
limitations: ["The card frame seals the card in the page under a public key its own script carries; the cardholder's device does not seal for Aurus yet, so a held request opens no approval that pays."]
|
|
6237
|
+
});
|
|
6238
|
+
// src/processors/bigcommerce.js
|
|
6239
|
+
var BIGCOMMERCE_PSP = "bigcommerce";
|
|
6240
|
+
var BIGCOMMERCE_OPERATION = "bigcommerce.card_request";
|
|
6241
|
+
var BIGCOMMERCE_PAYMENTS_URL = "https://payments.bigcommerce.com/api/public/v1/orders/payments";
|
|
6242
|
+
var BODY_LIMIT36 = 65536;
|
|
6243
|
+
var CARD_KEYS16 = /* @__PURE__ */ new Set([
|
|
6244
|
+
"account_name",
|
|
6245
|
+
"month",
|
|
6246
|
+
"number",
|
|
6247
|
+
"verification_value",
|
|
6248
|
+
"year",
|
|
6249
|
+
"customer_code",
|
|
6250
|
+
"three_d_secure",
|
|
6251
|
+
"hosted_form_nonce"
|
|
6252
|
+
]);
|
|
6253
|
+
var OTHER_INSTRUMENTS = /* @__PURE__ */ Object.freeze(["bigpay_token", "credit_card_token", "credit_card_cryptogram"]);
|
|
6254
|
+
var NUMBER8 = /^[0-9]{12,19}$/;
|
|
6255
|
+
var CURRENCY6 = /^[A-Z]{3}$/;
|
|
6256
|
+
var record32 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
6257
|
+
var own12 = (value, key) => Object.prototype.hasOwnProperty.call(value, key);
|
|
6258
|
+
var refuse38 = (code) => Object.freeze({ verdict: "refuse", code });
|
|
6259
|
+
var CARD37 = /* @__PURE__ */ Object.freeze({ verdict: "card" });
|
|
6260
|
+
var CONTINUE13 = /* @__PURE__ */ Object.freeze({ verdict: "continue" });
|
|
6261
|
+
function isBigcommercePaymentsUrl(url) {
|
|
6262
|
+
return url === BIGCOMMERCE_PAYMENTS_URL;
|
|
6263
|
+
}
|
|
6264
|
+
function readBody22(body) {
|
|
6265
|
+
if (typeof body !== "string" || body === "" || body.length > BODY_LIMIT36)
|
|
6266
|
+
return null;
|
|
6267
|
+
try {
|
|
6268
|
+
const parsed = JSON.parse(body);
|
|
6269
|
+
return record32(parsed) && record32(parsed.payment) ? parsed : null;
|
|
6270
|
+
}
|
|
6271
|
+
catch {
|
|
6272
|
+
return null;
|
|
6273
|
+
}
|
|
6274
|
+
}
|
|
6275
|
+
function bigcommerceBodyVerdict(body, url) {
|
|
6276
|
+
if (url !== void 0 && !isBigcommercePaymentsUrl(url))
|
|
6277
|
+
return refuse38("bigcommerce_url_refused");
|
|
6278
|
+
const parsed = readBody22(body);
|
|
6279
|
+
if (!parsed)
|
|
6280
|
+
return refuse38("bigcommerce_body_unsupported");
|
|
6281
|
+
const { payment } = parsed;
|
|
6282
|
+
if (!own12(payment, "credit_card"))
|
|
6283
|
+
return CONTINUE13;
|
|
6284
|
+
const card = payment.credit_card;
|
|
6285
|
+
if (!record32(card) || OTHER_INSTRUMENTS.some((key) => own12(payment, key)) || Object.keys(card).some((key) => !CARD_KEYS16.has(key)) || typeof card.number !== "string" || !NUMBER8.test(card.number)) {
|
|
6286
|
+
return refuse38("bigcommerce_body_unsupported");
|
|
6287
|
+
}
|
|
6288
|
+
if (payment.vault_payment_instrument === true)
|
|
6289
|
+
return refuse38("bigcommerce_keep_on_file");
|
|
6290
|
+
return CARD37;
|
|
6291
|
+
}
|
|
6292
|
+
function bigcommerceAmount(template) {
|
|
6293
|
+
const parsed = record32(template) ? readBody22(template.body) : null;
|
|
6294
|
+
const order = parsed && record32(parsed.order) ? parsed.order : null;
|
|
6295
|
+
const total = order && record32(order.totals) ? order.totals.grand_total : void 0;
|
|
6296
|
+
if (!Number.isSafeInteger(total) || total <= 0 || typeof order.currency !== "string" || !CURRENCY6.test(order.currency))
|
|
6297
|
+
return null;
|
|
6298
|
+
return { amountCents: total, currency: order.currency.toLowerCase() };
|
|
6299
|
+
}
|
|
6300
|
+
var bigcommerce_default = /* @__PURE__ */ registerProcessor({
|
|
6301
|
+
psp: BIGCOMMERCE_PSP,
|
|
6302
|
+
definitions: [
|
|
6303
|
+
{
|
|
6304
|
+
psp: "bigcommerce",
|
|
6305
|
+
// The card request above. One host serves every BigCommerce store, test and live alike, so no sandbox host is
|
|
6306
|
+
// marked. Ships dark: served only to a client that declares `bigcommerce_card_form`, for a company the backend's
|
|
6307
|
+
// processor gate turns BigCommerce on for. `(?![\w/.%-])` ends the path for a consumer that tests `match`
|
|
6308
|
+
// unanchored; the exact-URL rule holds the rest.
|
|
6309
|
+
capability: "bigcommerce_card_form",
|
|
6310
|
+
match: "payments\\.bigcommerce\\.com/api/public/v1/orders/payments(?![\\w/.%-])",
|
|
6311
|
+
hosts: ["^payments\\.bigcommerce\\.com$"],
|
|
6312
|
+
encoding: "json",
|
|
6313
|
+
// The order's payment token and the JSON Accept. Origin, Referer and cookies never ride.
|
|
6314
|
+
passthroughHeaders: ["^authorization$", "^accept$"],
|
|
6315
|
+
jsonCardFields: [["payment", "credit_card", "number"]],
|
|
6316
|
+
// A payment with no new card on the same URL continues untouched (bigcommerceBodyVerdict says which).
|
|
6317
|
+
passWithoutCard: "payments\\.bigcommerce\\.com/api/public/v1/orders/payments"
|
|
6318
|
+
}
|
|
6319
|
+
],
|
|
6320
|
+
// The request charges the store's gateway at once, so only the cardholder's device sends it, after a person approves.
|
|
6321
|
+
refusedOperations: [BIGCOMMERCE_OPERATION],
|
|
6322
|
+
// Not surveyed: reading a BigCommerce payment back takes the store's own API credentials, which Agentcard never holds.
|
|
6323
|
+
settlementReadback: "not_surveyed",
|
|
6324
|
+
exactUrl: isBigcommercePaymentsUrl,
|
|
6325
|
+
bodyGate: (url, body) => bigcommerceBodyVerdict(body, url),
|
|
6326
|
+
amount: bigcommerceAmount
|
|
6327
|
+
});
|
|
6147
6328
|
// src/processors/bluesnap.js
|
|
6148
6329
|
var BLUESNAP_PSP = "bluesnap";
|
|
6149
6330
|
var BLUESNAP_OPERATION = "bluesnap.card_request";
|
|
@@ -6151,16 +6332,16 @@ var BLUESNAP_HOSTS = /* @__PURE__ */ Object.freeze({ 1: "ws1.bluesnap.com", 2: "
|
|
|
6151
6332
|
var BLUESNAP_SANDBOX_HOST = "sandpay.bluesnap.com";
|
|
6152
6333
|
var BLUESNAP_CARD_KEYS = /* @__PURE__ */ Object.freeze(["cvv", "ccNumber", "expDate"]);
|
|
6153
6334
|
var BLUESNAP_LEG_KEYS = /* @__PURE__ */ Object.freeze(["cvv", "expDate"]);
|
|
6154
|
-
var
|
|
6335
|
+
var BODY_LIMIT37 = 1024;
|
|
6155
6336
|
var TOKEN_URL2 = /^https:\/\/(ws1|ws2|sandpay)\.bluesnap\.com\/services\/2\/payment-fields-tokens\/([0-9a-f]{64}_[12]?)$/;
|
|
6156
6337
|
var CARD_NUMBER18 = /^[0-9]{12,19}$/;
|
|
6157
6338
|
var SECURITY_CODE22 = /^[0-9]{3,4}$/;
|
|
6158
6339
|
var EXPIRY3 = /^(?:0[1-9]|1[0-2])\/20[0-9]{2}$/;
|
|
6159
6340
|
var SAVED_CARD_KEYS2 = ["last4Digits", "lastFourDigits", "ccType"];
|
|
6160
|
-
var
|
|
6161
|
-
var
|
|
6162
|
-
var
|
|
6163
|
-
var
|
|
6341
|
+
var record33 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
6342
|
+
var own13 = (value, key) => Object.prototype.hasOwnProperty.call(value, key);
|
|
6343
|
+
var refuse39 = (code) => Object.freeze({ verdict: "refuse", code });
|
|
6344
|
+
var CARD38 = /* @__PURE__ */ Object.freeze({ verdict: "card" });
|
|
6164
6345
|
var LEG = /* @__PURE__ */ Object.freeze({ verdict: "continue" });
|
|
6165
6346
|
function bluesnapTokenUrl(url) {
|
|
6166
6347
|
const match = typeof url === "string" ? TOKEN_URL2.exec(url) : null;
|
|
@@ -6172,30 +6353,30 @@ function bluesnapTokenUrl(url) {
|
|
|
6172
6353
|
function isBluesnapTokenUrl(url) {
|
|
6173
6354
|
return bluesnapTokenUrl(url) !== null;
|
|
6174
6355
|
}
|
|
6175
|
-
function
|
|
6176
|
-
if (typeof body !== "string" || body === "" || body.length >
|
|
6356
|
+
function readBody23(body) {
|
|
6357
|
+
if (typeof body !== "string" || body === "" || body.length > BODY_LIMIT37)
|
|
6177
6358
|
return null;
|
|
6178
6359
|
try {
|
|
6179
6360
|
const value = JSON.parse(body);
|
|
6180
|
-
return
|
|
6361
|
+
return record33(value) && JSON.stringify(value) === body ? value : null;
|
|
6181
6362
|
}
|
|
6182
6363
|
catch {
|
|
6183
6364
|
return null;
|
|
6184
6365
|
}
|
|
6185
6366
|
}
|
|
6186
6367
|
function bluesnapBodyVerdict(body) {
|
|
6187
|
-
const value =
|
|
6368
|
+
const value = readBody23(body);
|
|
6188
6369
|
if (value === null)
|
|
6189
|
-
return
|
|
6370
|
+
return refuse39("bluesnap_body_unsupported");
|
|
6190
6371
|
const keys = Object.keys(value);
|
|
6191
6372
|
if (keys.some((key) => SAVED_CARD_KEYS2.includes(key)))
|
|
6192
|
-
return
|
|
6373
|
+
return refuse39(own13(value, "ccNumber") ? "bluesnap_body_unsupported" : "bluesnap_saved_card");
|
|
6193
6374
|
if (keys.length === 0 || keys.some((key, i) => !BLUESNAP_CARD_KEYS.includes(key) || i > 0 && BLUESNAP_CARD_KEYS.indexOf(keys[i - 1]) >= BLUESNAP_CARD_KEYS.indexOf(key))) {
|
|
6194
|
-
return
|
|
6375
|
+
return refuse39("bluesnap_body_unsupported");
|
|
6195
6376
|
}
|
|
6196
|
-
if (
|
|
6197
|
-
return
|
|
6198
|
-
return
|
|
6377
|
+
if (own13(value, "ccNumber") && !(typeof value.ccNumber === "string" && CARD_NUMBER18.test(value.ccNumber)) || own13(value, "cvv") && !(typeof value.cvv === "string" && SECURITY_CODE22.test(value.cvv)) || own13(value, "expDate") && !(typeof value.expDate === "string" && EXPIRY3.test(value.expDate)))
|
|
6378
|
+
return refuse39("bluesnap_body_unsupported");
|
|
6379
|
+
return own13(value, "ccNumber") ? CARD38 : LEG;
|
|
6199
6380
|
}
|
|
6200
6381
|
var bluesnap_default = /* @__PURE__ */ registerProcessor({
|
|
6201
6382
|
psp: BLUESNAP_PSP,
|
|
@@ -6229,96 +6410,1012 @@ var bluesnap_default = /* @__PURE__ */ registerProcessor({
|
|
|
6229
6410
|
exactUrl: isBluesnapTokenUrl,
|
|
6230
6411
|
bodyGate: (url, body) => url !== void 0 && !isBluesnapTokenUrl(url) ? { verdict: "refuse", code: "bluesnap_url_refused" } : bluesnapBodyVerdict(body)
|
|
6231
6412
|
});
|
|
6232
|
-
// src/processors/
|
|
6233
|
-
var
|
|
6234
|
-
var
|
|
6235
|
-
var
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
"
|
|
6239
|
-
"
|
|
6240
|
-
"
|
|
6241
|
-
"
|
|
6242
|
-
"
|
|
6243
|
-
"
|
|
6244
|
-
"
|
|
6245
|
-
"
|
|
6246
|
-
"
|
|
6413
|
+
// src/processors/ekashu.js
|
|
6414
|
+
var EKASHU_HOSTS = Object.freeze(["live.ekashu.com", "test.ekashu.com"]);
|
|
6415
|
+
var EKASHU_TEST_PANS = Object.freeze(["4100000000000100", "5100000000000107"]);
|
|
6416
|
+
var EKASHU_SIGNED_FIELDS = Object.freeze([
|
|
6417
|
+
"ekashu_3d_secure_verify",
|
|
6418
|
+
"ekashu_amount",
|
|
6419
|
+
"ekashu_amount_format",
|
|
6420
|
+
"ekashu_auto_confirm",
|
|
6421
|
+
"ekashu_callback_failure_url",
|
|
6422
|
+
"ekashu_callback_include_post",
|
|
6423
|
+
"ekashu_callback_success_url",
|
|
6424
|
+
"ekashu_card_address_editable",
|
|
6425
|
+
"ekashu_card_address_required",
|
|
6426
|
+
"ekashu_card_address_verify",
|
|
6427
|
+
"ekashu_card_email_address_mandatory",
|
|
6428
|
+
"ekashu_card_phone_number_mandatory",
|
|
6429
|
+
"ekashu_card_title_mandatory",
|
|
6430
|
+
"ekashu_card_zip_code_verify",
|
|
6431
|
+
"ekashu_currency",
|
|
6432
|
+
"ekashu_delivery_address_editable",
|
|
6433
|
+
"ekashu_delivery_address_required",
|
|
6434
|
+
"ekashu_delivery_email_address_mandatory",
|
|
6435
|
+
"ekashu_delivery_phone_number_mandatory",
|
|
6436
|
+
"ekashu_delivery_title_mandatory",
|
|
6437
|
+
"ekashu_description",
|
|
6438
|
+
"ekashu_device",
|
|
6439
|
+
"ekashu_duplicate_check",
|
|
6440
|
+
"ekashu_duplicate_minutes",
|
|
6441
|
+
"ekashu_failure_return_text",
|
|
6442
|
+
"ekashu_failure_url",
|
|
6443
|
+
"ekashu_hash_code_format",
|
|
6444
|
+
"ekashu_hash_code_type",
|
|
6445
|
+
"ekashu_hash_code_version",
|
|
6446
|
+
"ekashu_include_post",
|
|
6447
|
+
"ekashu_invoice_address_editable",
|
|
6448
|
+
"ekashu_invoice_address_required",
|
|
6449
|
+
"ekashu_invoice_email_address_mandatory",
|
|
6450
|
+
"ekashu_invoice_phone_number_mandatory",
|
|
6451
|
+
"ekashu_invoice_title_mandatory",
|
|
6452
|
+
"ekashu_locale",
|
|
6453
|
+
"ekashu_payment_methods",
|
|
6454
|
+
"ekashu_reference",
|
|
6455
|
+
"ekashu_request_type",
|
|
6456
|
+
"ekashu_return_text",
|
|
6457
|
+
"ekashu_seller_address",
|
|
6458
|
+
"ekashu_seller_email_address",
|
|
6459
|
+
"ekashu_seller_id",
|
|
6460
|
+
"ekashu_seller_key",
|
|
6461
|
+
"ekashu_seller_name",
|
|
6462
|
+
"ekashu_shortcut_icon",
|
|
6463
|
+
"ekashu_style_sheet",
|
|
6464
|
+
"ekashu_success_url",
|
|
6465
|
+
"ekashu_title",
|
|
6466
|
+
"ekashu_verification_value_mask",
|
|
6467
|
+
"ekashu_verification_value_verify",
|
|
6468
|
+
"ekashu_viewport"
|
|
6247
6469
|
]);
|
|
6248
|
-
var
|
|
6249
|
-
"
|
|
6250
|
-
"
|
|
6251
|
-
"
|
|
6252
|
-
"
|
|
6253
|
-
"
|
|
6254
|
-
"
|
|
6255
|
-
"
|
|
6470
|
+
var REQUIRED = Object.freeze([
|
|
6471
|
+
"ekashu_seller_id",
|
|
6472
|
+
"ekashu_seller_key",
|
|
6473
|
+
"ekashu_amount",
|
|
6474
|
+
"ekashu_currency",
|
|
6475
|
+
"ekashu_reference",
|
|
6476
|
+
"ekashu_hash_code",
|
|
6477
|
+
"ekashu_hash_code_type",
|
|
6478
|
+
"ekashu_hash_code_version",
|
|
6479
|
+
"ekashu_success_url",
|
|
6480
|
+
"ekashu_failure_url",
|
|
6481
|
+
"ekashu_callback_success_url"
|
|
6256
6482
|
]);
|
|
6257
|
-
var
|
|
6258
|
-
|
|
6259
|
-
|
|
6260
|
-
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
|
|
6266
|
-
var
|
|
6267
|
-
var
|
|
6268
|
-
var
|
|
6269
|
-
var
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
var
|
|
6282
|
-
|
|
6283
|
-
|
|
6483
|
+
var CARD_KEYS17 = Object.freeze([
|
|
6484
|
+
"ekashu_card_number",
|
|
6485
|
+
"ekashu_expires_end_month",
|
|
6486
|
+
"ekashu_expires_end_year",
|
|
6487
|
+
"ekashu_verification_value",
|
|
6488
|
+
"ekashu_valid_from_month",
|
|
6489
|
+
"ekashu_valid_from_year",
|
|
6490
|
+
"ekashu_issue_number"
|
|
6491
|
+
]);
|
|
6492
|
+
var PAGE_KEYS = Object.freeze(["ekashu_stage", "ekashu_context", "ekashu_submission_id"]);
|
|
6493
|
+
var STORED_KEYS = Object.freeze(["ekashu_card_hash", "ekashu_card_reference", "ekashu_cof_initiated_by", "ekashu_cof_reason", "ekashu_cof_id"]);
|
|
6494
|
+
var REDIRECT_KEYS = Object.freeze(["ekashu_success_url", "ekashu_failure_url", "ekashu_return_url"]);
|
|
6495
|
+
var CALLBACK_KEYS = Object.freeze(["ekashu_callback_success_url", "ekashu_callback_failure_url"]);
|
|
6496
|
+
var MAX_ENTRY = 16 * 1024;
|
|
6497
|
+
var MAX_PAGE = 256 * 1024;
|
|
6498
|
+
var EKASHU_SELLERS = Object.freeze([
|
|
6499
|
+
Object.freeze({ sellerId: "25060100", merchant: "Heathrow Drop-off", entryHost: "heathrowdropoff.apcoa.com", callbackHost: "incomingapi.apcoa.co.uk" })
|
|
6500
|
+
]);
|
|
6501
|
+
var CARD_FIELDS = Object.freeze({
|
|
6502
|
+
number: "ekashu_card_number",
|
|
6503
|
+
month: "ekashu_expires_end_month",
|
|
6504
|
+
year: "ekashu_expires_end_year",
|
|
6505
|
+
cvc: "ekashu_verification_value"
|
|
6506
|
+
});
|
|
6507
|
+
var NAME_FIELDS = Object.freeze({ first: "ekashu_card_first_name", last: "ekashu_card_last_name" });
|
|
6508
|
+
var LEFT_EMPTY = Object.freeze(["ekashu_card_title", "ekashu_valid_from_month", "ekashu_valid_from_year", "ekashu_issue_number"]);
|
|
6509
|
+
var VISIBLE = /* @__PURE__ */ new Set([...Object.values(CARD_FIELDS), ...Object.values(NAME_FIELDS), ...LEFT_EMPTY]);
|
|
6510
|
+
// src/processors/redsys.js
|
|
6511
|
+
var REDSYS_HOSTS = Object.freeze(["sis.redsys.es"]);
|
|
6512
|
+
var REDSYS_ENTRY_PATHS = Object.freeze(["/sis/realizarPago", "/sis/realizarPago/utf-8"]);
|
|
6513
|
+
var REDSYS_MERCHANTS = Object.freeze([]);
|
|
6514
|
+
var MAX_ENTRY2 = 16 * 1024;
|
|
6515
|
+
var MAX_PARAMETERS = 8 * 1024;
|
|
6516
|
+
var FORM_KEY = /^[A-Za-z][A-Za-z0-9_-]{0,63}$/;
|
|
6517
|
+
var ENTRY_KEYS = Object.freeze(["Ds_SignatureVersion", "Ds_MerchantParameters", "Ds_Signature"]);
|
|
6518
|
+
var REQUIRED2 = Object.freeze([
|
|
6519
|
+
"DS_MERCHANT_AMOUNT",
|
|
6520
|
+
"DS_MERCHANT_CURRENCY",
|
|
6521
|
+
"DS_MERCHANT_MERCHANTCODE",
|
|
6522
|
+
"DS_MERCHANT_ORDER",
|
|
6523
|
+
"DS_MERCHANT_TERMINAL",
|
|
6524
|
+
"DS_MERCHANT_TRANSACTIONTYPE",
|
|
6525
|
+
"DS_MERCHANT_MERCHANTURL",
|
|
6526
|
+
"DS_MERCHANT_URLOK",
|
|
6527
|
+
"DS_MERCHANT_URLKO"
|
|
6528
|
+
]);
|
|
6529
|
+
var STORED = Object.freeze([
|
|
6530
|
+
"DS_MERCHANT_IDENTIFIER",
|
|
6531
|
+
"DS_MERCHANT_GROUP",
|
|
6532
|
+
"DS_MERCHANT_COF_INI",
|
|
6533
|
+
"DS_MERCHANT_COF_TYPE",
|
|
6534
|
+
"DS_MERCHANT_COF_TXNID"
|
|
6535
|
+
]);
|
|
6536
|
+
var SPECIAL = Object.freeze([
|
|
6537
|
+
"DS_MERCHANT_DIRECTPAYMENT",
|
|
6538
|
+
"DS_MERCHANT_SUMTOTAL",
|
|
6539
|
+
"DS_MERCHANT_DATEFRECUENCY",
|
|
6540
|
+
"DS_MERCHANT_CHARGEEXPIRYDATE",
|
|
6541
|
+
"DS_MERCHANT_IDOPER"
|
|
6542
|
+
]);
|
|
6543
|
+
var CARD_PARAMETERS = Object.freeze(["DS_MERCHANT_PAN", "DS_MERCHANT_EXPIRYDATE", "DS_MERCHANT_CVV2"]);
|
|
6544
|
+
var CURRENCIES = Object.freeze({ 978: "eur", 840: "usd", 826: "gbp", 756: "chf" });
|
|
6545
|
+
function decode(text10) {
|
|
6546
|
+
return decodeURIComponent(text10.replace(/\+/g, " "));
|
|
6284
6547
|
}
|
|
6285
|
-
function
|
|
6286
|
-
if (typeof body !== "string" || body ===
|
|
6287
|
-
return null;
|
|
6288
|
-
try {
|
|
6289
|
-
const value = JSON.parse(body);
|
|
6290
|
-
return record33(value) && JSON.stringify(value) === body ? value : null;
|
|
6291
|
-
}
|
|
6292
|
-
catch {
|
|
6548
|
+
function parseRedsysForm(body) {
|
|
6549
|
+
if (typeof body !== "string" || body.length === 0 || body.length > MAX_ENTRY2 || /[^\x21-\x7e]/.test(body))
|
|
6293
6550
|
return null;
|
|
6551
|
+
const pairs = [];
|
|
6552
|
+
const seen = /* @__PURE__ */ new Set();
|
|
6553
|
+
for (const chunk of body.split("&")) {
|
|
6554
|
+
const eq = chunk.indexOf("=");
|
|
6555
|
+
if (eq < 1)
|
|
6556
|
+
return null;
|
|
6557
|
+
let key;
|
|
6558
|
+
let value;
|
|
6559
|
+
try {
|
|
6560
|
+
key = decode(chunk.slice(0, eq));
|
|
6561
|
+
value = decode(chunk.slice(eq + 1));
|
|
6562
|
+
}
|
|
6563
|
+
catch {
|
|
6564
|
+
return null;
|
|
6565
|
+
}
|
|
6566
|
+
if (!FORM_KEY.test(key) || value.length > MAX_PARAMETERS || /[\u0000-\u001f\u007f]/.test(value))
|
|
6567
|
+
return null;
|
|
6568
|
+
const folded = key.toLowerCase();
|
|
6569
|
+
if (seen.has(folded))
|
|
6570
|
+
return null;
|
|
6571
|
+
seen.add(folded);
|
|
6572
|
+
pairs.push({ key, value });
|
|
6294
6573
|
}
|
|
6574
|
+
return pairs;
|
|
6295
6575
|
}
|
|
6296
|
-
|
|
6297
|
-
|
|
6298
|
-
|
|
6299
|
-
|
|
6300
|
-
|
|
6301
|
-
|
|
6302
|
-
|
|
6303
|
-
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
|
|
6310
|
-
|
|
6311
|
-
|
|
6312
|
-
|
|
6313
|
-
|
|
6314
|
-
|
|
6315
|
-
|
|
6316
|
-
|
|
6317
|
-
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6576
|
+
var MAX_PAGE2 = 256 * 1024;
|
|
6577
|
+
var CARD_FIELDS2 = Object.freeze({
|
|
6578
|
+
shown: "Sis_card-number",
|
|
6579
|
+
expiry: "SIS_card-expiration",
|
|
6580
|
+
cvc: "Sis_Tarjeta_CVV2",
|
|
6581
|
+
holder: "cardholderName",
|
|
6582
|
+
number: "Sis_Numero_Tarjeta",
|
|
6583
|
+
month: "Sis_Caducidad_Tarjeta_Mes",
|
|
6584
|
+
year: "Sis_Caducidad_Tarjeta_Anno"
|
|
6585
|
+
});
|
|
6586
|
+
var BROWSER_FIELDS = Object.freeze([
|
|
6587
|
+
"browserJavaEnabled",
|
|
6588
|
+
"browserJavascriptEnabled",
|
|
6589
|
+
"browserLanguage",
|
|
6590
|
+
"browserColorDepth",
|
|
6591
|
+
"browserScreenHeight",
|
|
6592
|
+
"browserScreenWidth",
|
|
6593
|
+
"browserTZ",
|
|
6594
|
+
"browserUserAgent"
|
|
6595
|
+
]);
|
|
6596
|
+
var AS_SERVED = Object.freeze(["cvvObligatorio", "threeDSCompInd", "fuc", "terminal", "merchantOrder", "bcancel"]);
|
|
6597
|
+
var CARD_PAGE = /* @__PURE__ */ new Set([...Object.values(CARD_FIELDS2), ...BROWSER_FIELDS, ...AS_SERVED]);
|
|
6598
|
+
var VISIBLE2 = /* @__PURE__ */ new Set([CARD_FIELDS2.shown, CARD_FIELDS2.expiry, CARD_FIELDS2.cvc, CARD_FIELDS2.holder]);
|
|
6599
|
+
var METHOD_PAGE = /* @__PURE__ */ new Set(["resultadoMethod", ...BROWSER_FIELDS, "threeDSCompInd"]);
|
|
6600
|
+
var REDSYS_REFUSALS = Object.freeze(["redsys_card_page", "redsys_3ds_challenge", "redsys_declined"]);
|
|
6601
|
+
// src/processors/cardlink_vpos.js
|
|
6602
|
+
var CARDLINK_VPOS_PSP = "cardlink_vpos";
|
|
6603
|
+
var CARDLINK_VPOS_HOSTS = Object.freeze({
|
|
6604
|
+
"vpos.eurocommerce.gr": "worldline",
|
|
6605
|
+
"ecommerce.cardlink.gr": "cardlink",
|
|
6606
|
+
"www.alphaecommerce.gr": "nexi"
|
|
6607
|
+
});
|
|
6608
|
+
var CARDLINK_VPOS_TEST_HOSTS = Object.freeze([
|
|
6609
|
+
"eurocommerce-test.cardlink.gr",
|
|
6610
|
+
"ecommerce-test.cardlink.gr",
|
|
6611
|
+
"alphaecommerce-test.cardlink.gr"
|
|
6612
|
+
]);
|
|
6613
|
+
var CARDLINK_VPOS_ENTRY_PATH = "/vpos/shophandlermpi";
|
|
6614
|
+
var CARDLINK_VPOS_MERCHANTS = Object.freeze([
|
|
6615
|
+
Object.freeze({ merchant: "Holy Great Monastery of Vatopedi", mid: "0021713862", vposHost: "vpos.eurocommerce.gr", host: "www.vatopedi.gr" })
|
|
6616
|
+
]);
|
|
6617
|
+
var CARDLINK_VPOS_ENTRY_FIELDS = Object.freeze([
|
|
6618
|
+
"version",
|
|
6619
|
+
"mid",
|
|
6620
|
+
"lang",
|
|
6621
|
+
"deviceCategory",
|
|
6622
|
+
"orderid",
|
|
6623
|
+
"orderDesc",
|
|
6624
|
+
"orderAmount",
|
|
6625
|
+
"currency",
|
|
6626
|
+
"payerEmail",
|
|
6627
|
+
"payerPhone",
|
|
6628
|
+
"billCountry",
|
|
6629
|
+
"billState",
|
|
6630
|
+
"billZip",
|
|
6631
|
+
"billCity",
|
|
6632
|
+
"billAddress",
|
|
6633
|
+
"weight",
|
|
6634
|
+
"dimensions",
|
|
6635
|
+
"shipCountry",
|
|
6636
|
+
"shipState",
|
|
6637
|
+
"shipZip",
|
|
6638
|
+
"shipCity",
|
|
6639
|
+
"shipAddress",
|
|
6640
|
+
"addFraudScore",
|
|
6641
|
+
"maxPayRetries",
|
|
6642
|
+
"reject3dsU",
|
|
6643
|
+
"payMethod",
|
|
6644
|
+
"trType",
|
|
6645
|
+
"extInstallmentoffset",
|
|
6646
|
+
"extInstallmentperiod",
|
|
6647
|
+
"extRecurringfrequency",
|
|
6648
|
+
"extRecurringenddate",
|
|
6649
|
+
"blockScore",
|
|
6650
|
+
"cssUrl",
|
|
6651
|
+
"confirmUrl",
|
|
6652
|
+
"cancelUrl",
|
|
6653
|
+
"extTokenOptions",
|
|
6654
|
+
"extToken",
|
|
6655
|
+
"var1",
|
|
6656
|
+
"var2",
|
|
6657
|
+
"var3",
|
|
6658
|
+
"var4",
|
|
6659
|
+
"var5",
|
|
6660
|
+
"var6",
|
|
6661
|
+
"var7",
|
|
6662
|
+
"var8",
|
|
6663
|
+
"var9",
|
|
6664
|
+
"digest"
|
|
6665
|
+
]);
|
|
6666
|
+
var KNOWN = new Set(CARDLINK_VPOS_ENTRY_FIELDS);
|
|
6667
|
+
var REQUIRED3 = Object.freeze([
|
|
6668
|
+
"version",
|
|
6669
|
+
"mid",
|
|
6670
|
+
"orderid",
|
|
6671
|
+
"orderDesc",
|
|
6672
|
+
"orderAmount",
|
|
6673
|
+
"currency",
|
|
6674
|
+
"payerEmail",
|
|
6675
|
+
"confirmUrl",
|
|
6676
|
+
"cancelUrl",
|
|
6677
|
+
"digest"
|
|
6678
|
+
]);
|
|
6679
|
+
var STORED2 = Object.freeze(["extTokenOptions", "extToken"]);
|
|
6680
|
+
var SPECIAL2 = Object.freeze(["extInstallmentoffset", "extInstallmentperiod", "extRecurringfrequency", "extRecurringenddate"]);
|
|
6681
|
+
var CURRENCIES2 = Object.freeze({ EUR: "eur" });
|
|
6682
|
+
var MAX_URL = 512;
|
|
6683
|
+
var MAX_ENTRY3 = 8 * 1024;
|
|
6684
|
+
var MAX_VALUE = 256;
|
|
6685
|
+
var own14 = (value, key) => Object.prototype.hasOwnProperty.call(value, key);
|
|
6686
|
+
var field2 = (name, reason) => ({ ok: false, code: "hosted_form_field_refused", field: name, reason });
|
|
6687
|
+
function cardlinkVposEntryHost(raw) {
|
|
6688
|
+
if (typeof raw !== "string" || raw.length > MAX_URL || raw.includes("?") || raw.includes("#"))
|
|
6689
|
+
return null;
|
|
6690
|
+
let url;
|
|
6691
|
+
try {
|
|
6692
|
+
url = new URL(raw);
|
|
6693
|
+
}
|
|
6694
|
+
catch {
|
|
6695
|
+
return null;
|
|
6696
|
+
}
|
|
6697
|
+
if (url.href !== raw || url.protocol !== "https:" || url.port || url.username || url.password || !own14(CARDLINK_VPOS_HOSTS, url.hostname) || url.pathname !== CARDLINK_VPOS_ENTRY_PATH)
|
|
6698
|
+
return null;
|
|
6699
|
+
return url.hostname;
|
|
6700
|
+
}
|
|
6701
|
+
function isCardlinkVposEntryUrl(raw) {
|
|
6702
|
+
return cardlinkVposEntryHost(raw) !== null;
|
|
6703
|
+
}
|
|
6704
|
+
function parseCardlinkVposForm(body) {
|
|
6705
|
+
if (typeof body !== "string" || body.length === 0 || body.length > MAX_ENTRY3 || /[^\x21-\x7e]/.test(body))
|
|
6706
|
+
return null;
|
|
6707
|
+
const pairs = [];
|
|
6708
|
+
const seen = /* @__PURE__ */ new Set();
|
|
6709
|
+
for (const chunk of body.split("&")) {
|
|
6710
|
+
const eq = chunk.indexOf("=");
|
|
6711
|
+
if (eq < 1)
|
|
6712
|
+
return null;
|
|
6713
|
+
let key;
|
|
6714
|
+
let value;
|
|
6715
|
+
try {
|
|
6716
|
+
key = decodeURIComponent(chunk.slice(0, eq).replace(/\+/g, " "));
|
|
6717
|
+
value = decodeURIComponent(chunk.slice(eq + 1).replace(/\+/g, " "));
|
|
6718
|
+
}
|
|
6719
|
+
catch {
|
|
6720
|
+
return null;
|
|
6721
|
+
}
|
|
6722
|
+
if (!/^[A-Za-z_.][A-Za-z0-9_.-]{0,63}$/.test(key) || value.length > MAX_VALUE || /[\u0000-\u001f\u007f]/.test(value))
|
|
6723
|
+
return null;
|
|
6724
|
+
if (seen.has(key))
|
|
6725
|
+
return null;
|
|
6726
|
+
seen.add(key);
|
|
6727
|
+
pairs.push({ key, value });
|
|
6728
|
+
}
|
|
6729
|
+
return pairs;
|
|
6730
|
+
}
|
|
6731
|
+
function cardlinkVposMerchant(mid, vposHost, merchants = CARDLINK_VPOS_MERCHANTS) {
|
|
6732
|
+
if (typeof mid !== "string" || typeof vposHost !== "string" || !Array.isArray(merchants))
|
|
6733
|
+
return null;
|
|
6734
|
+
const found = merchants.filter((row) => !!row && typeof row.merchant === "string" && row.merchant.trim() !== "" && row.mid === mid && row.vposHost === vposHost && typeof row.host === "string" && row.host !== "");
|
|
6735
|
+
return found.length === 1 ? found[0] : null;
|
|
6736
|
+
}
|
|
6737
|
+
function entryAmount(values) {
|
|
6738
|
+
const amount2 = values.get("orderAmount");
|
|
6739
|
+
const code = values.get("currency");
|
|
6740
|
+
const currency = typeof code === "string" && own14(CURRENCIES2, code) ? CURRENCIES2[code] : null;
|
|
6741
|
+
if (!currency || typeof amount2 !== "string" || !/^(?:0|[1-9]\d{0,11})(?:\.\d{1,2})?$/.test(amount2))
|
|
6742
|
+
return null;
|
|
6743
|
+
const [whole2, fraction = ""] = amount2.split(".");
|
|
6744
|
+
const cents2 = Number(whole2) * 100 + Number(fraction.padEnd(2, "0"));
|
|
6745
|
+
return Number.isSafeInteger(cents2) && cents2 > 0 ? { amountCents: cents2, currency } : null;
|
|
6746
|
+
}
|
|
6747
|
+
function httpsUrl(value) {
|
|
6748
|
+
let url;
|
|
6749
|
+
try {
|
|
6750
|
+
url = new URL(value);
|
|
6751
|
+
}
|
|
6752
|
+
catch {
|
|
6753
|
+
return null;
|
|
6754
|
+
}
|
|
6755
|
+
if (url.protocol !== "https:" || url.username || url.password || url.port || url.hash)
|
|
6756
|
+
return null;
|
|
6757
|
+
return url;
|
|
6758
|
+
}
|
|
6759
|
+
function checkCardlinkVposEntry(body, { url = null, merchants = CARDLINK_VPOS_MERCHANTS } = {}) {
|
|
6760
|
+
const vposHost = cardlinkVposEntryHost(url);
|
|
6761
|
+
if (!vposHost)
|
|
6762
|
+
return field2("(url)", "malformed_field");
|
|
6763
|
+
const pairs = parseCardlinkVposForm(body);
|
|
6764
|
+
if (!pairs)
|
|
6765
|
+
return field2("(body)", "malformed");
|
|
6766
|
+
const values = new Map(pairs.map(({ key, value }) => [key, value]));
|
|
6767
|
+
for (const { key } of pairs) {
|
|
6768
|
+
if (KNOWN.has(key))
|
|
6769
|
+
continue;
|
|
6770
|
+
return field2(key, /^(?:card[._]|cvv|cmd$|trid$|st$|paystep$|paymentmethod$)/i.test(key) ? "card_in_entry" : "not_an_entry");
|
|
6771
|
+
}
|
|
6772
|
+
const missing = REQUIRED3.filter((name) => !values.get(name));
|
|
6773
|
+
if (missing.length)
|
|
6774
|
+
return { ok: false, code: "hosted_form_template_incomplete", missing };
|
|
6775
|
+
if (values.get("version") !== "2")
|
|
6776
|
+
return field2("version", "malformed");
|
|
6777
|
+
if (!/^[A-Za-z0-9+/]{43}=$/.test(values.get("digest")))
|
|
6778
|
+
return field2("digest", "unsigned");
|
|
6779
|
+
for (const name of STORED2)
|
|
6780
|
+
if (values.has(name))
|
|
6781
|
+
return field2(name, "stored_credential");
|
|
6782
|
+
for (const name of SPECIAL2)
|
|
6783
|
+
if (values.get(name))
|
|
6784
|
+
return field2(name, "special_flow");
|
|
6785
|
+
for (let i = 1; i <= 9; i += 1)
|
|
6786
|
+
if (/moto\s*=\s*true/i.test(values.get(`var${i}`) ?? ""))
|
|
6787
|
+
return field2(`var${i}`, "moto");
|
|
6788
|
+
if (values.has("trType") && values.get("trType") !== "1")
|
|
6789
|
+
return field2("trType", "not_a_sale");
|
|
6790
|
+
const method = values.get("payMethod");
|
|
6791
|
+
if (method)
|
|
6792
|
+
return field2("payMethod", /^iris$/i.test(method) ? "not_a_card_payment" : "special_flow");
|
|
6793
|
+
const amount2 = entryAmount(values);
|
|
6794
|
+
if (!amount2)
|
|
6795
|
+
return field2(own14(CURRENCIES2, values.get("currency")) ? "orderAmount" : "currency", "malformed");
|
|
6796
|
+
if (!/^\d{1,30}$/.test(values.get("mid")))
|
|
6797
|
+
return field2("mid", "malformed");
|
|
6798
|
+
if (!/^[A-Za-z0-9]{1,50}$/.test(values.get("orderid")))
|
|
6799
|
+
return field2("orderid", "malformed");
|
|
6800
|
+
const seller = cardlinkVposMerchant(values.get("mid"), vposHost, merchants);
|
|
6801
|
+
if (!seller)
|
|
6802
|
+
return field2("mid", "seller_unreviewed");
|
|
6803
|
+
for (const name of ["confirmUrl", "cancelUrl"]) {
|
|
6804
|
+
const target = httpsUrl(values.get(name));
|
|
6805
|
+
if (!target || target.hostname !== seller.host)
|
|
6806
|
+
return field2(name, "callback_host");
|
|
6807
|
+
}
|
|
6808
|
+
return {
|
|
6809
|
+
ok: true,
|
|
6810
|
+
pairs,
|
|
6811
|
+
gated: false,
|
|
6812
|
+
dedupe: [vposHost, values.get("mid"), values.get("orderid"), values.get("orderAmount"), values.get("currency")],
|
|
6813
|
+
seller
|
|
6814
|
+
};
|
|
6815
|
+
}
|
|
6816
|
+
function cardlinkVposEntryAmount(body) {
|
|
6817
|
+
const pairs = parseCardlinkVposForm(body);
|
|
6818
|
+
return pairs ? entryAmount(new Map(pairs.map(({ key, value }) => [key, value]))) : null;
|
|
6819
|
+
}
|
|
6820
|
+
var CARDLINK_VPOS_TDS2_FIELDS = Object.freeze([
|
|
6821
|
+
"TDS2_Navigator_language",
|
|
6822
|
+
"TDS2_Navigator_jsEnabled",
|
|
6823
|
+
"TDS2_Navigator_javaEnabled",
|
|
6824
|
+
"TDS2_Screen_colorDepth",
|
|
6825
|
+
"TDS2_Screen_height",
|
|
6826
|
+
"TDS2_Screen_width",
|
|
6827
|
+
"TDS2_screen_pixelDepth",
|
|
6828
|
+
"TDS2_TimezoneOffset"
|
|
6829
|
+
]);
|
|
6830
|
+
var PAGE_FIELDS = Object.freeze(["trid", "st", "payStep", "cmd", "startbonus", "bonusdata"]);
|
|
6831
|
+
var WALLET_FIELDS2 = Object.freeze(["walletId", "applePayResponse"]);
|
|
6832
|
+
var CARD39 = Object.freeze({ number: "card.pan", holder: "card.holderName", month: "card.expiryMonth", year: "card.expiryYear", cvc: "card.cvv" });
|
|
6833
|
+
var TEXT_CONTROLS = /* @__PURE__ */ new Set([CARD39.number, CARD39.holder, CARD39.cvc]);
|
|
6834
|
+
var SELECT_CONTROLS = /* @__PURE__ */ new Set([CARD39.month, CARD39.year]);
|
|
6835
|
+
var MAX_PAGE3 = 256 * 1024;
|
|
6836
|
+
var COOKIE_DOMAINS = Object.freeze({
|
|
6837
|
+
"vpos.eurocommerce.gr": "eurocommerce.gr",
|
|
6838
|
+
"ecommerce.cardlink.gr": "cardlink.gr",
|
|
6839
|
+
"www.alphaecommerce.gr": "alphaecommerce.gr"
|
|
6840
|
+
});
|
|
6841
|
+
var POST_REQUIRED = Object.freeze(["trid", "st", "cmd", CARD39.number, CARD39.holder, CARD39.month, CARD39.year, CARD39.cvc, "makepayment"]);
|
|
6842
|
+
var POST_EMPTY = Object.freeze(["payStep", "startbonus", "bonusdata", ...WALLET_FIELDS2]);
|
|
6843
|
+
var POST_ALLOWED = /* @__PURE__ */ new Set([...POST_REQUIRED, ...POST_EMPTY, "paymentMethod", ...CARDLINK_VPOS_TDS2_FIELDS]);
|
|
6844
|
+
var CARDLINK_VPOS_REFUSALS = Object.freeze([
|
|
6845
|
+
"cardlink_vpos_card_refused",
|
|
6846
|
+
"cardlink_vpos_card_page",
|
|
6847
|
+
"cardlink_vpos_3ds_challenge",
|
|
6848
|
+
"cardlink_vpos_declined"
|
|
6849
|
+
]);
|
|
6850
|
+
var REFUSAL_FOR = Object.freeze({
|
|
6851
|
+
card_refused: "cardlink_vpos_card_refused",
|
|
6852
|
+
card_page: "cardlink_vpos_card_page",
|
|
6853
|
+
challenge: "cardlink_vpos_3ds_challenge",
|
|
6854
|
+
declined: "cardlink_vpos_declined"
|
|
6855
|
+
});
|
|
6856
|
+
var CARDLINK_VPOS_CAPABILITY = "cardlink_vpos_hosted_payment_page";
|
|
6857
|
+
var CARDLINK_VPOS_OPERATION = "cardlink_vpos.hosted_sale";
|
|
6858
|
+
var cardlink_vpos_default = /* @__PURE__ */ registerProcessor({
|
|
6859
|
+
psp: CARDLINK_VPOS_PSP,
|
|
6860
|
+
definitions: [
|
|
6861
|
+
{
|
|
6862
|
+
psp: "cardlink_vpos",
|
|
6863
|
+
// The merchant's signed entry, as the header above reads it: a Document navigation that carries no card. The
|
|
6864
|
+
// cardholder's device repeats it over the end-to-end TLS relay, fills the card into the page the VPOS returns
|
|
6865
|
+
// and posts it in that same session, and the runtime resolves the paused navigation with the hosted_form notice.
|
|
6866
|
+
// Only the entry path on the three live hosts is matched (isCardlinkVposEntryUrl). The card page posts to the same
|
|
6867
|
+
// path, so the SDK fails every other post to these hosts in the agent's browser, and no placeholder card reaches
|
|
6868
|
+
// the VPOS. The test hosts are listed so a live host classifies as live and the create refuses a test row there;
|
|
6869
|
+
// no entry on them is paused. Ships dark: served only to a client that declares
|
|
6870
|
+
// `cardlink_vpos_hosted_payment_page`, and gated off for every company the operator has not turned it on for.
|
|
6871
|
+
capability: CARDLINK_VPOS_CAPABILITY,
|
|
6872
|
+
match: "(?:vpos\\.eurocommerce\\.gr|ecommerce\\.cardlink\\.gr|www\\.alphaecommerce\\.gr)/vpos/shophandlermpi(?![\\w/.%;=!-])",
|
|
6873
|
+
hosts: [
|
|
6874
|
+
"^vpos\\.eurocommerce\\.gr$",
|
|
6875
|
+
"^ecommerce\\.cardlink\\.gr$",
|
|
6876
|
+
"^www\\.alphaecommerce\\.gr$",
|
|
6877
|
+
"^eurocommerce-test\\.cardlink\\.gr$",
|
|
6878
|
+
"^ecommerce-test\\.cardlink\\.gr$",
|
|
6879
|
+
"^alphaecommerce-test\\.cardlink\\.gr$"
|
|
6880
|
+
],
|
|
6881
|
+
sandboxHosts: ["^eurocommerce-test\\.cardlink\\.gr$", "^ecommerce-test\\.cardlink\\.gr$", "^alphaecommerce-test\\.cardlink\\.gr$"],
|
|
6882
|
+
hostEnvironmentPinned: true,
|
|
6883
|
+
encoding: "form",
|
|
6884
|
+
// A form navigation: no captured header is ever replayed.
|
|
6885
|
+
passthroughHeaders: [],
|
|
6886
|
+
mode: "hosted_form",
|
|
6887
|
+
hostedForm: {
|
|
6888
|
+
// The card goes into the VPOS's own page on the device, never into the entry, which must carry none
|
|
6889
|
+
// (checkCardlinkVposEntry). The entry's rules come with this registration (hostedEntry below), so no policy is
|
|
6890
|
+
// named here.
|
|
6891
|
+
cardIn: "processor_page",
|
|
6892
|
+
required: [...REQUIRED3],
|
|
6893
|
+
// The card page's own fields, which the device fills on that page.
|
|
6894
|
+
card: { number: "card.pan", month: "card.expiryMonth", year: "card.expiryYear", cvc: "card.cvv" },
|
|
6895
|
+
// The host, the mid, the order id and the amount name one payment; the entry's rules read the host from its URL.
|
|
6896
|
+
dedupe: ["(vposHost)", "mid", "orderid", "orderAmount", "currency"]
|
|
6897
|
+
}
|
|
6898
|
+
}
|
|
6899
|
+
],
|
|
6900
|
+
// Only the cardholder's device repeats an entry, after a person approves; no reviewed list names cardlink_vpos.
|
|
6901
|
+
refusedOperations: [CARDLINK_VPOS_OPERATION],
|
|
6902
|
+
// Not surveyed: the VPOS tells the merchant the result through the browser's return and a copy to its server, both
|
|
6903
|
+
// signed under the merchant's secret, which Agentcard never holds.
|
|
6904
|
+
settlementReadback: "not_surveyed",
|
|
6905
|
+
exactUrl: isCardlinkVposEntryUrl,
|
|
6906
|
+
hostedEntry: (body, { url }) => checkCardlinkVposEntry(body, { url }),
|
|
6907
|
+
amount: (template) => template && isCardlinkVposEntryUrl(template.url) ? cardlinkVposEntryAmount(template.body) : null,
|
|
6908
|
+
limitations: [
|
|
6909
|
+
"The paused request is the merchant's signed entry form, which carries no card; the cardholder's device sends it to Cardlink's VPOS over the end-to-end TLS relay and fills the card into the page the VPOS returns.",
|
|
6910
|
+
"Agentcard takes only a reviewed merchant's entry: its mid and the host it posts to name the merchant the cardholder is shown, and its confirm and cancel URLs must sit on that merchant's own host.",
|
|
6911
|
+
"Agentcard takes one plain payment only and refuses an entry that asks for a stored card, installments, a recurring schedule, a pre-authorization, MOTO or a preselected payment method.",
|
|
6912
|
+
"The VPOS runs EMV 3-D Secure on the card. A frictionless answer pays; a challenge ends the payment on the device with nothing charged.",
|
|
6913
|
+
"The browser receives a submission notice, not the processor result."
|
|
6914
|
+
]
|
|
6915
|
+
});
|
|
6916
|
+
// src/processors/eghl.js
|
|
6917
|
+
var EGHL_PSP = "eghl";
|
|
6918
|
+
var EGHL_OPERATION = "eghl.hosted_sale";
|
|
6919
|
+
var EGHL_HOST = "securepay.e-ghl.com";
|
|
6920
|
+
var EGHL_SANDBOX_HOST = "test2pay.ghl.com";
|
|
6921
|
+
var LIVE_PATH = "/ipg/payment.aspx";
|
|
6922
|
+
var SANDBOX_PATH = "/ipgsg/payment.aspx";
|
|
6923
|
+
var MAX_URL2 = 8192;
|
|
6924
|
+
var field3 = (name, reason) => ({ ok: false, code: "hosted_form_field_refused", field: name, reason });
|
|
6925
|
+
function eghlEntry(raw) {
|
|
6926
|
+
if (typeof raw !== "string" || raw.length > MAX_URL2 || raw.includes("#"))
|
|
6927
|
+
return null;
|
|
6928
|
+
let url;
|
|
6929
|
+
try {
|
|
6930
|
+
url = new URL(raw);
|
|
6931
|
+
}
|
|
6932
|
+
catch {
|
|
6933
|
+
return null;
|
|
6934
|
+
}
|
|
6935
|
+
if (url.href !== raw || url.protocol !== "https:" || url.port || url.username || url.password || url.search.length < 2)
|
|
6936
|
+
return null;
|
|
6937
|
+
const path = url.pathname.toLowerCase();
|
|
6938
|
+
const query = url.search.slice(1);
|
|
6939
|
+
if (url.hostname === EGHL_HOST && path === LIVE_PATH)
|
|
6940
|
+
return Object.freeze({ test: false, query });
|
|
6941
|
+
if (url.hostname === EGHL_SANDBOX_HOST && path === SANDBOX_PATH)
|
|
6942
|
+
return Object.freeze({ test: true, query });
|
|
6943
|
+
return null;
|
|
6944
|
+
}
|
|
6945
|
+
function isEghlEntryUrl(raw) {
|
|
6946
|
+
return eghlEntry(raw) !== null;
|
|
6947
|
+
}
|
|
6948
|
+
var EGHL_MERCHANTS = Object.freeze([
|
|
6949
|
+
Object.freeze({ merchant: "BookXcess", serviceId: "BXS", payee: "BookXcess Sdn Bhd", returnHosts: Object.freeze(["shopify.ghl.com:11443"]), test: false })
|
|
6950
|
+
]);
|
|
6951
|
+
var SERVICE_ID2 = /^[A-Za-z0-9]{3}$/;
|
|
6952
|
+
var HOST = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+(?::[1-9]\d{0,4})?$/;
|
|
6953
|
+
function eghlMerchant(serviceId, { test = false, merchants = EGHL_MERCHANTS } = {}) {
|
|
6954
|
+
if (typeof serviceId !== "string" || !SERVICE_ID2.test(serviceId) || !Array.isArray(merchants))
|
|
6955
|
+
return null;
|
|
6956
|
+
const found = merchants.filter((row) => !!row && typeof row.merchant === "string" && row.merchant.trim() !== "" && typeof row.payee === "string" && row.payee.trim() !== "" && row.serviceId === serviceId && row.test === test && Array.isArray(row.returnHosts) && row.returnHosts.length > 0 && row.returnHosts.every((host) => typeof host === "string" && HOST.test(host)));
|
|
6957
|
+
return found.length === 1 ? found[0] : null;
|
|
6958
|
+
}
|
|
6959
|
+
var REQUIRED4 = Object.freeze([
|
|
6960
|
+
"TransactionType",
|
|
6961
|
+
"PymtMethod",
|
|
6962
|
+
"ServiceID",
|
|
6963
|
+
"PaymentID",
|
|
6964
|
+
"OrderNumber",
|
|
6965
|
+
"MerchantReturnURL",
|
|
6966
|
+
"MerchantCallBackURL",
|
|
6967
|
+
"Amount",
|
|
6968
|
+
"CurrencyCode",
|
|
6969
|
+
"HashValue"
|
|
6970
|
+
]);
|
|
6971
|
+
var CARD_KEYS18 = /* @__PURE__ */ new Set(["cardno", "cardexp", "cardcvv2", "cardholder", "param2", "param4", "cvv2", "epmonth2", "epyear2", "custocp"]);
|
|
6972
|
+
var SECRET_KEYS = /* @__PURE__ */ new Set(["password"]);
|
|
6973
|
+
var STORED_KEYS2 = /* @__PURE__ */ new Set([
|
|
6974
|
+
"tokentype",
|
|
6975
|
+
"token",
|
|
6976
|
+
"cardid",
|
|
6977
|
+
"precheckoutid",
|
|
6978
|
+
"reqtoken",
|
|
6979
|
+
"pairingtoken",
|
|
6980
|
+
"reqverifier",
|
|
6981
|
+
"pairingverifier",
|
|
6982
|
+
"checkoutresourceurl"
|
|
6983
|
+
]);
|
|
6984
|
+
var SPECIAL_KEYS = /* @__PURE__ */ new Set(["eppmonth", "promocode"]);
|
|
6985
|
+
var RESULT_KEYS = Object.freeze(["MerchantReturnURL", "MerchantCallBackURL", "MerchantApprovalURL", "MerchantUnApprovalURL"]);
|
|
6986
|
+
var CURRENCIES3 = /* @__PURE__ */ new Set(["MYR", "SGD", "USD", "PHP", "THB"]);
|
|
6987
|
+
var AMOUNT3 = /^(0|[1-9]\d{0,8})\.(\d{2})$/;
|
|
6988
|
+
function httpsUrl2(value) {
|
|
6989
|
+
let url;
|
|
6990
|
+
try {
|
|
6991
|
+
url = new URL(value);
|
|
6992
|
+
}
|
|
6993
|
+
catch {
|
|
6994
|
+
return null;
|
|
6995
|
+
}
|
|
6996
|
+
if (url.protocol !== "https:" || url.username || url.password || url.hash)
|
|
6997
|
+
return null;
|
|
6998
|
+
return url;
|
|
6999
|
+
}
|
|
7000
|
+
function entryFields(text10) {
|
|
7001
|
+
const pairs = parseRedsysForm(text10);
|
|
7002
|
+
if (!pairs)
|
|
7003
|
+
return null;
|
|
7004
|
+
return { pairs, values: new Map(pairs.map(({ key, value }) => [key.toLowerCase(), value])) };
|
|
7005
|
+
}
|
|
7006
|
+
function entryAmount2(values) {
|
|
7007
|
+
const currency = values.get("currencycode");
|
|
7008
|
+
const amount2 = AMOUNT3.exec(values.get("amount") ?? "");
|
|
7009
|
+
if (!amount2 || typeof currency !== "string" || !CURRENCIES3.has(currency))
|
|
7010
|
+
return null;
|
|
7011
|
+
const cents2 = Number(amount2[1]) * 100 + Number(amount2[2]);
|
|
7012
|
+
return cents2 > 0 && Number.isSafeInteger(cents2) ? { amountCents: cents2, currency: currency.toLowerCase() } : null;
|
|
7013
|
+
}
|
|
7014
|
+
function checkEghlEntry(body, { url = null, merchants = EGHL_MERCHANTS } = {}) {
|
|
7015
|
+
if (body !== void 0 && body !== null && body !== "")
|
|
7016
|
+
return field3("(body)", "not_an_entry");
|
|
7017
|
+
const entry = eghlEntry(url);
|
|
7018
|
+
if (!entry)
|
|
7019
|
+
return field3("(url)", "malformed_field");
|
|
7020
|
+
const fields = entryFields(entry.query);
|
|
7021
|
+
if (!fields)
|
|
7022
|
+
return field3("(query)", "malformed");
|
|
7023
|
+
const { pairs, values } = fields;
|
|
7024
|
+
for (const { key, value } of pairs) {
|
|
7025
|
+
if (value === "")
|
|
7026
|
+
continue;
|
|
7027
|
+
const folded = key.toLowerCase();
|
|
7028
|
+
if (CARD_KEYS18.has(folded))
|
|
7029
|
+
return field3(key, "card_in_entry");
|
|
7030
|
+
if (SECRET_KEYS.has(folded))
|
|
7031
|
+
return field3(key, "not_an_entry");
|
|
7032
|
+
if (STORED_KEYS2.has(folded))
|
|
7033
|
+
return field3(key, "stored_credential");
|
|
7034
|
+
if (SPECIAL_KEYS.has(folded))
|
|
7035
|
+
return field3(key, "special_flow");
|
|
7036
|
+
}
|
|
7037
|
+
const missing = REQUIRED4.filter((name) => !values.get(name.toLowerCase()));
|
|
7038
|
+
if (missing.length)
|
|
7039
|
+
return { ok: false, code: "hosted_form_template_incomplete", missing };
|
|
7040
|
+
if (values.get("transactiontype") !== "SALE")
|
|
7041
|
+
return field3("TransactionType", "not_a_sale");
|
|
7042
|
+
if (!["ANY", "CC"].includes(values.get("pymtmethod")))
|
|
7043
|
+
return field3("PymtMethod", "special_flow");
|
|
7044
|
+
if (!/^[0-9A-Fa-f]{64}$/.test(values.get("hashvalue")))
|
|
7045
|
+
return field3("HashValue", "unsigned");
|
|
7046
|
+
if (!entryAmount2(values))
|
|
7047
|
+
return field3(CURRENCIES3.has(values.get("currencycode")) ? "Amount" : "CurrencyCode", "malformed");
|
|
7048
|
+
if (!SERVICE_ID2.test(values.get("serviceid")))
|
|
7049
|
+
return field3("ServiceID", "malformed");
|
|
7050
|
+
if (!/^[A-Za-z0-9._-]{1,20}$/.test(values.get("paymentid")))
|
|
7051
|
+
return field3("PaymentID", "malformed");
|
|
7052
|
+
if (values.get("ordernumber").length > 20)
|
|
7053
|
+
return field3("OrderNumber", "malformed");
|
|
7054
|
+
const pageTimeout = values.get("pagetimeout");
|
|
7055
|
+
if (pageTimeout !== void 0 && !/^[1-9]\d{1,4}$/.test(pageTimeout))
|
|
7056
|
+
return field3("PageTimeout", "malformed");
|
|
7057
|
+
const seller = eghlMerchant(values.get("serviceid"), { test: entry.test, merchants });
|
|
7058
|
+
if (!seller)
|
|
7059
|
+
return field3("ServiceID", "seller_unreviewed");
|
|
7060
|
+
for (const name of RESULT_KEYS) {
|
|
7061
|
+
const value = values.get(name.toLowerCase());
|
|
7062
|
+
if (!value)
|
|
7063
|
+
continue;
|
|
7064
|
+
const target = httpsUrl2(value);
|
|
7065
|
+
if (!target || !seller.returnHosts.includes(target.host) || [EGHL_HOST, EGHL_SANDBOX_HOST].includes(target.hostname))
|
|
7066
|
+
return field3(name, "callback_host");
|
|
7067
|
+
}
|
|
7068
|
+
return { ok: true, pairs, gated: false, dedupe: [values.get("serviceid"), values.get("paymentid")], sandbox: entry.test, seller };
|
|
7069
|
+
}
|
|
7070
|
+
function eghlEntryAmount(body, url) {
|
|
7071
|
+
if (body !== void 0 && body !== null && body !== "")
|
|
7072
|
+
return null;
|
|
7073
|
+
const entry = eghlEntry(url);
|
|
7074
|
+
const fields = entry ? entryFields(entry.query) : null;
|
|
7075
|
+
return fields ? entryAmount2(fields.values) : null;
|
|
7076
|
+
}
|
|
7077
|
+
var MAX_PAGE4 = 1024 * 1024;
|
|
7078
|
+
var NEVER_SENT = new Set(["expressCheckoutType", "c2pRememberMeBrowser", "CustOCP", "CustRecurr", "CustAddress"].map((name) => name.toLowerCase()));
|
|
7079
|
+
var PAGE_REQUIRED = Object.freeze([
|
|
7080
|
+
"TransactionType",
|
|
7081
|
+
"ServiceID",
|
|
7082
|
+
"MerchantName",
|
|
7083
|
+
"PaymentID",
|
|
7084
|
+
"Amount",
|
|
7085
|
+
"BaseTxnAmount",
|
|
7086
|
+
"CurrencyCode",
|
|
7087
|
+
"BaseCurrencyCode",
|
|
7088
|
+
"HashValue",
|
|
7089
|
+
"Param2",
|
|
7090
|
+
"Param4",
|
|
7091
|
+
"CardExp",
|
|
7092
|
+
"CVV2",
|
|
7093
|
+
"PymtMethod"
|
|
7094
|
+
]);
|
|
7095
|
+
var EGHL_REFUSALS = Object.freeze(["eghl_failed", "eghl_cancelled"]);
|
|
7096
|
+
var MAX_ANSWER = 256 * 1024;
|
|
7097
|
+
var RESULT_FIELDS = Object.freeze(["TxnStatus", "ServiceID", "PaymentID", "Amount", "CurrencyCode"]);
|
|
7098
|
+
var eghl_default = /* @__PURE__ */ registerProcessor({
|
|
7099
|
+
psp: EGHL_PSP,
|
|
7100
|
+
definitions: [
|
|
7101
|
+
{
|
|
7102
|
+
psp: "eghl",
|
|
7103
|
+
// The merchant's entry to eGHL's payment page, as the header above reads it: a GET Document navigation whose
|
|
7104
|
+
// query names the payment and which carries no card. The cardholder's device repeats it over the end-to-end TLS
|
|
7105
|
+
// relay and pays on the page eGHL returns to it, and the runtime resolves the paused navigation with the
|
|
7106
|
+
// hosted_form notice. Only the entry is matched (isEghlEntryUrl): the card page's own card post goes to the same
|
|
7107
|
+
// path as a POST. The path is matched in any letter case, as IIS reads it; `(?![\\w/.%-])` ends it for a consumer
|
|
7108
|
+
// that tests `match` unanchored. Ships dark: served only to a client that declares `eghl_hosted_payment_page`, and
|
|
7109
|
+
// gated off for every company the operator has not allowlisted.
|
|
7110
|
+
capability: "eghl_hosted_payment_page",
|
|
7111
|
+
match: "securepay\\.e-ghl\\.com/[Ii][Pp][Gg]/[Pp][Aa][Yy][Mm][Ee][Nn][Tt]\\.[Aa][Ss][Pp][Xx](?![\\w/.%-])|test2pay\\.ghl\\.com/[Ii][Pp][Gg][Ss][Gg]/[Pp][Aa][Yy][Mm][Ee][Nn][Tt]\\.[Aa][Ss][Pp][Xx](?![\\w/.%-])",
|
|
7112
|
+
hosts: ["^securepay\\.e-ghl\\.com$", "^test2pay\\.ghl\\.com$"],
|
|
7113
|
+
sandboxHosts: ["^test2pay\\.ghl\\.com$"],
|
|
7114
|
+
hostEnvironmentPinned: true,
|
|
7115
|
+
// `encoding` describes the card page's own card post, which the device makes as the page does, since the entry
|
|
7116
|
+
// has no body. No captured header is ever replayed.
|
|
7117
|
+
encoding: "form",
|
|
7118
|
+
passthroughHeaders: [],
|
|
7119
|
+
// The paused request is the navigation itself, a GET with the payment in its query.
|
|
7120
|
+
request: { method: "GET", cardIn: "processor_page", response: "document" },
|
|
7121
|
+
mode: "hosted_form",
|
|
7122
|
+
hostedForm: {
|
|
7123
|
+
// The card goes into eGHL's page on the device, never into the entry (checkEghlEntry refuses one there). The
|
|
7124
|
+
// entry's own rules come with this registration (hostedEntry below), so no policy is named here.
|
|
7125
|
+
cardIn: "processor_page",
|
|
7126
|
+
required: ["TransactionType", "PymtMethod", "ServiceID", "PaymentID", "OrderNumber", "MerchantReturnURL", "MerchantCallBackURL", "Amount", "CurrencyCode", "HashValue"],
|
|
7127
|
+
// The card page's own inputs in its card form (frmProcessPayment, read card free on 2026-11-05): the number in
|
|
7128
|
+
// Param2, the expiry in CardExp as YYYYMM, which the page builds from its month and year selects, the code in
|
|
7129
|
+
// CVV2. The cardholder's name goes in Param4.
|
|
7130
|
+
card: { number: "Param2", expiry: "CardExp", cvc: "CVV2" },
|
|
7131
|
+
// eGHL takes one PaymentID once per merchant.
|
|
7132
|
+
dedupe: ["ServiceID", "PaymentID"]
|
|
7133
|
+
}
|
|
7134
|
+
}
|
|
7135
|
+
],
|
|
7136
|
+
// Only the cardholder's device repeats an entry, after a person approves; no reviewed list names eghl.
|
|
7137
|
+
refusedOperations: [EGHL_OPERATION],
|
|
7138
|
+
// Not surveyed: eGHL tells the merchant's server the result (MerchantCallBackURL), and its return carries a hash only
|
|
7139
|
+
// the merchant can check.
|
|
7140
|
+
settlementReadback: "not_surveyed",
|
|
7141
|
+
exactUrl: isEghlEntryUrl,
|
|
7142
|
+
amount: (template) => template && typeof template === "object" ? eghlEntryAmount(template.body, template.url) : null,
|
|
7143
|
+
hostedEntry: (body, { url = null } = {}) => checkEghlEntry(body, { url }),
|
|
7144
|
+
limitations: [
|
|
7145
|
+
"The paused request is the merchant's redirect to eGHL's payment page, a GET whose query names the payment and carries no card; the cardholder's device repeats it over the end-to-end TLS relay and pays on the page eGHL returns.",
|
|
7146
|
+
"Agentcard takes an entry only for a merchant it reviewed, by the ServiceID inside the merchant's signed entry, and the approval names that merchant and the amount the entry names.",
|
|
7147
|
+
"eGHL runs 3-D Secure on the card. A challenge ends the payment on the device with nothing charged.",
|
|
7148
|
+
"eGHL sends the buyer to the merchant's return page with a result only the merchant can verify, so the browser receives a submission notice, not the processor result."
|
|
7149
|
+
]
|
|
7150
|
+
});
|
|
7151
|
+
// src/processors/frisbii.js
|
|
7152
|
+
var FRISBII_PSP = "frisbii";
|
|
7153
|
+
var FRISBII_OPERATION = "frisbii.card_request";
|
|
7154
|
+
var FRISBII_HOSTS = /* @__PURE__ */ Object.freeze({ "card.reepay.com": "reepay", "card.frisbii.com": "frisbii" });
|
|
7155
|
+
var FRISBII_TOKEN_PATH = "/v1/token/";
|
|
7156
|
+
var FRISBII_REFUSED_PATHS = /* @__PURE__ */ Object.freeze({
|
|
7157
|
+
"/v1/token/cof/": "frisbii_stored_card_unsupported",
|
|
7158
|
+
"/v1/token/create_click_to_pay": "frisbii_click_to_pay_unsupported"
|
|
7159
|
+
});
|
|
7160
|
+
var BODY_LIMIT38 = 8192;
|
|
7161
|
+
var URL_LIMIT15 = 256;
|
|
7162
|
+
var CARD_NUMBER19 = /^[0-9]{12,19}$/;
|
|
7163
|
+
var MONTH19 = /^(?:0[1-9]|1[0-2])$/;
|
|
7164
|
+
var YEAR20 = /^[0-9]{2}$/;
|
|
7165
|
+
var SECURITY_CODE23 = /^(?:[0-9]{3,4})?$/;
|
|
7166
|
+
var IDENTIFIER2 = /^[A-Za-z0-9_-]{8,128}$/;
|
|
7167
|
+
var SCA_RULES = /* @__PURE__ */ Object.freeze([
|
|
7168
|
+
"DO_NOT_USE_SCA",
|
|
7169
|
+
"MUST_USE_SCA_AUTH",
|
|
7170
|
+
"MUST_USE_SCA_PREAUTH",
|
|
7171
|
+
"USE_SCA_IF_AVAILABLE_AUTH",
|
|
7172
|
+
"USE_SCA_IF_AVAILABLE_PREAUTH"
|
|
7173
|
+
]);
|
|
7174
|
+
var BODY_ORDER = /* @__PURE__ */ Object.freeze([
|
|
7175
|
+
"number",
|
|
7176
|
+
"month",
|
|
7177
|
+
"year",
|
|
7178
|
+
"cvv",
|
|
7179
|
+
"cardTypeOverride",
|
|
7180
|
+
"click_to_pay_encrypt",
|
|
7181
|
+
"billing_address",
|
|
7182
|
+
"pkey",
|
|
7183
|
+
"recurring",
|
|
7184
|
+
"cardholder_name",
|
|
7185
|
+
"intent",
|
|
7186
|
+
"recurringAverageAmount",
|
|
7187
|
+
"agreementFilter",
|
|
7188
|
+
"strongAuthenticationRule",
|
|
7189
|
+
"tokenStrongAuthenticationRequest"
|
|
7190
|
+
]);
|
|
7191
|
+
var BODY_REQUIRED = /* @__PURE__ */ Object.freeze(["number", "month", "year", "cvv", "pkey", "recurring", "strongAuthenticationRule"]);
|
|
7192
|
+
var BODY_REFUSED = /* @__PURE__ */ Object.freeze(["cardTypeOverride", "click_to_pay_encrypt", "billing_address"]);
|
|
7193
|
+
var SCA_ORDER = /* @__PURE__ */ Object.freeze(["amount", "currency", "orderId", "orderText", "merchantScaData", "returnUrl", "tokenBrowserInfo"]);
|
|
7194
|
+
var BROWSER_ORDER = /* @__PURE__ */ Object.freeze([
|
|
7195
|
+
"javascriptEnabled",
|
|
7196
|
+
"challengeWindowSize",
|
|
7197
|
+
"colorDepth",
|
|
7198
|
+
"javaEnabled",
|
|
7199
|
+
"screenHeight",
|
|
7200
|
+
"screenWidth",
|
|
7201
|
+
"tz"
|
|
7202
|
+
]);
|
|
7203
|
+
var LABEL = /^[A-Za-z0-9_-]{1,64}$/;
|
|
7204
|
+
var record34 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
7205
|
+
var own15 = (value, key) => Object.prototype.hasOwnProperty.call(value, key);
|
|
7206
|
+
var refuse40 = (code) => Object.freeze({ verdict: "refuse", code });
|
|
7207
|
+
var CARD40 = /* @__PURE__ */ Object.freeze({ verdict: "card" });
|
|
7208
|
+
var text9 = (value, max) => typeof value === "string" && value.length <= max;
|
|
7209
|
+
var absentOrNull = (value) => value === void 0 || value === null;
|
|
7210
|
+
var inOrder6 = (value, order) => Object.keys(value).every((key) => order.includes(key)) && Object.keys(value).join() === order.filter((key) => own15(value, key)).join();
|
|
7211
|
+
function frisbiiTokenUrl(url) {
|
|
7212
|
+
if (typeof url !== "string" || url.length > URL_LIMIT15 || url.includes("#"))
|
|
7213
|
+
return null;
|
|
7214
|
+
let parsed;
|
|
7215
|
+
try {
|
|
7216
|
+
parsed = new URL(url);
|
|
7217
|
+
}
|
|
7218
|
+
catch {
|
|
7219
|
+
return null;
|
|
7220
|
+
}
|
|
7221
|
+
if (parsed.href !== url || parsed.protocol !== "https:" || parsed.port || parsed.username || parsed.password || !own15(FRISBII_HOSTS, parsed.hostname) || parsed.pathname !== FRISBII_TOKEN_PATH)
|
|
7222
|
+
return null;
|
|
7223
|
+
const match = /^\?session=([A-Za-z0-9_-]{8,128})$/.exec(parsed.search);
|
|
7224
|
+
return match ? Object.freeze({ host: parsed.hostname, brand: FRISBII_HOSTS[parsed.hostname], session: match[1] }) : null;
|
|
7225
|
+
}
|
|
7226
|
+
var isFrisbiiTokenUrl = (url) => frisbiiTokenUrl(url) !== null;
|
|
7227
|
+
function frisbiiRefusedFlowUrl(url) {
|
|
7228
|
+
if (typeof url !== "string" || url.length > URL_LIMIT15 || url.includes("#"))
|
|
7229
|
+
return null;
|
|
7230
|
+
let parsed;
|
|
7231
|
+
try {
|
|
7232
|
+
parsed = new URL(url);
|
|
7233
|
+
}
|
|
7234
|
+
catch {
|
|
7235
|
+
return null;
|
|
7236
|
+
}
|
|
7237
|
+
if (parsed.href !== url || parsed.protocol !== "https:" || parsed.port || parsed.username || parsed.password || !own15(FRISBII_HOSTS, parsed.hostname) || !own15(FRISBII_REFUSED_PATHS, parsed.pathname))
|
|
7238
|
+
return null;
|
|
7239
|
+
return FRISBII_REFUSED_PATHS[parsed.pathname];
|
|
7240
|
+
}
|
|
7241
|
+
function luhn9(digits3) {
|
|
7242
|
+
let sum = 0;
|
|
7243
|
+
for (let at = digits3.length - 1, double = false; at >= 0; at -= 1, double = !double) {
|
|
7244
|
+
let digit = digits3.charCodeAt(at) - 48;
|
|
7245
|
+
if (double)
|
|
7246
|
+
digit = digit * 2 > 9 ? digit * 2 - 9 : digit * 2;
|
|
7247
|
+
sum += digit;
|
|
7248
|
+
}
|
|
7249
|
+
return sum % 10 === 0;
|
|
7250
|
+
}
|
|
7251
|
+
function readBody24(body) {
|
|
7252
|
+
if (typeof body !== "string" || body === "" || body.length > BODY_LIMIT38)
|
|
7253
|
+
return null;
|
|
7254
|
+
try {
|
|
7255
|
+
const value = JSON.parse(body);
|
|
7256
|
+
return record34(value) && JSON.stringify(value) === body ? value : null;
|
|
7257
|
+
}
|
|
7258
|
+
catch {
|
|
7259
|
+
return null;
|
|
7260
|
+
}
|
|
7261
|
+
}
|
|
7262
|
+
function browserInfo(info) {
|
|
7263
|
+
return record34(info) && Object.keys(info).join() === BROWSER_ORDER.join() && info.javascriptEnabled === true && typeof info.javaEnabled === "boolean" && /^size_[0-9]{3}x[0-9]{3}$/.test(info.challengeWindowSize) && [info.colorDepth, info.screenHeight, info.screenWidth].every((n) => Number.isSafeInteger(n) && n >= 0 && n <= 1e5) && Number.isSafeInteger(info.tz) && Math.abs(info.tz) <= 1440;
|
|
7264
|
+
}
|
|
7265
|
+
function scaBlock(block, target) {
|
|
7266
|
+
if (!record34(block) || !inOrder6(block, SCA_ORDER) || !own15(block, "returnUrl") || !own15(block, "tokenBrowserInfo"))
|
|
7267
|
+
return false;
|
|
7268
|
+
if (!Number.isSafeInteger(block.amount) || block.amount < 0 || typeof block.currency !== "string" || !/^[A-Z]{3}$/.test(block.currency))
|
|
7269
|
+
return false;
|
|
7270
|
+
if (!(absentOrNull(block.orderId) || text9(block.orderId, 128)) || !(absentOrNull(block.orderText) || text9(block.orderText, 512)))
|
|
7271
|
+
return false;
|
|
7272
|
+
if (!(absentOrNull(block.merchantScaData) || record34(block.merchantScaData)))
|
|
7273
|
+
return false;
|
|
7274
|
+
if (!text9(block.returnUrl, 2048) || !browserInfo(block.tokenBrowserInfo))
|
|
7275
|
+
return false;
|
|
7276
|
+
const back = /^https:\/\/checkout\.(reepay|frisbii)\.com\/return\.001\.html\?id=([A-Za-z0-9_-]{8,128})(?:&[A-Za-z0-9_.~%=+/-]*)*$/.exec(block.returnUrl);
|
|
7277
|
+
return back !== null && (target === null || back[1] === target.brand && back[2] === target.session);
|
|
7278
|
+
}
|
|
7279
|
+
function frisbiiBodyVerdict(body, url) {
|
|
7280
|
+
const value = readBody24(body);
|
|
7281
|
+
if (value === null || !inOrder6(value, BODY_ORDER) || !BODY_REQUIRED.every((key) => own15(value, key)) || BODY_REFUSED.some((key) => own15(value, key)))
|
|
7282
|
+
return refuse40("frisbii_body_unsupported");
|
|
7283
|
+
if (value.recurring === true || value.intent === "CHARGE_AND_STORE")
|
|
7284
|
+
return refuse40("frisbii_card_on_file");
|
|
7285
|
+
const target = url === void 0 ? null : frisbiiTokenUrl(url);
|
|
7286
|
+
if (url !== void 0 && target === null)
|
|
7287
|
+
return refuse40("frisbii_body_unsupported");
|
|
7288
|
+
const sound = typeof value.number === "string" && CARD_NUMBER19.test(value.number) && luhn9(value.number) && typeof value.month === "string" && MONTH19.test(value.month) && typeof value.year === "string" && YEAR20.test(value.year) && typeof value.cvv === "string" && SECURITY_CODE23.test(value.cvv) && typeof value.pkey === "string" && IDENTIFIER2.test(value.pkey) && value.recurring === false && (value.cardholder_name === void 0 || text9(value.cardholder_name, 64)) && (value.intent === void 0 || value.intent === "CHARGE") && (absentOrNull(value.recurringAverageAmount) || Number.isSafeInteger(value.recurringAverageAmount) && value.recurringAverageAmount >= 0) && (absentOrNull(value.agreementFilter) || typeof value.agreementFilter === "string" && LABEL.test(value.agreementFilter) || Array.isArray(value.agreementFilter) && value.agreementFilter.length <= 16 && value.agreementFilter.every((entry) => typeof entry === "string" && LABEL.test(entry))) && SCA_RULES.includes(value.strongAuthenticationRule) && (value.tokenStrongAuthenticationRequest === void 0 || scaBlock(value.tokenStrongAuthenticationRequest, target));
|
|
7289
|
+
return sound ? CARD40 : refuse40("frisbii_body_unsupported");
|
|
7290
|
+
}
|
|
7291
|
+
var frisbii_default = /* @__PURE__ */ registerProcessor({
|
|
7292
|
+
psp: FRISBII_PSP,
|
|
7293
|
+
definitions: [
|
|
7294
|
+
{
|
|
7295
|
+
psp: "frisbii",
|
|
7296
|
+
// The hosted page's card request, as the header above reads it, on both brands' card hosts. A test account
|
|
7297
|
+
// shares the live hosts, so no sandbox host is marked. The match reads the host and the path and ends with it. It
|
|
7298
|
+
// also takes the page's two other card paths, /v1/token/cof/ and /v1/token/create_click_to_pay, so the pause
|
|
7299
|
+
// decision holds them, and the body gate refuses every body there; the exact-URL rule below holds the session
|
|
7300
|
+
// query of the card request. Ships dark: served only to a client that declares `frisbii_card_token`, and only for a company
|
|
7301
|
+
// the backend's processor gate turns Frisbii on for.
|
|
7302
|
+
capability: "frisbii_card_token",
|
|
7303
|
+
match: "card\\.(?:reepay|frisbii)\\.com/v1/token/(?:cof/|create_click_to_pay)?",
|
|
7304
|
+
hosts: ["^card\\.reepay\\.com$", "^card\\.frisbii\\.com$"],
|
|
7305
|
+
encoding: "json",
|
|
7306
|
+
// The page sends no header but its content type. Origin, Referer and cookies never ride.
|
|
7307
|
+
passthroughHeaders: [],
|
|
7308
|
+
jsonCardFields: [["number"]]
|
|
7309
|
+
}
|
|
7310
|
+
],
|
|
7311
|
+
// Only the cardholder's device would send this card, after a person approves; no reviewed list names frisbii.
|
|
7312
|
+
refusedOperations: [FRISBII_OPERATION],
|
|
7313
|
+
// Not surveyed: the card request mints a token and moves no money, and the page then charges the session with it
|
|
7314
|
+
// in a card-free request. Whether the session's own read (checkout-api /v1/checkout/<session>) can confirm that
|
|
7315
|
+
// charge was not read.
|
|
7316
|
+
settlementReadback: "not_surveyed",
|
|
7317
|
+
exactUrl: (url) => isFrisbiiTokenUrl(url) || frisbiiRefusedFlowUrl(url) !== null,
|
|
7318
|
+
// A stored card's token and Click to Pay are refused whatever their body; the card request is judged by its body.
|
|
7319
|
+
bodyGate: (url, body) => {
|
|
7320
|
+
if (url === void 0)
|
|
7321
|
+
return frisbiiBodyVerdict(body);
|
|
7322
|
+
const flow = frisbiiRefusedFlowUrl(url);
|
|
7323
|
+
if (flow !== null)
|
|
7324
|
+
return refuse40(flow);
|
|
7325
|
+
return isFrisbiiTokenUrl(url) ? frisbiiBodyVerdict(body, url) : refuse40("frisbii_url_refused");
|
|
7326
|
+
},
|
|
7327
|
+
limitations: ["A live Frisbii card goes only to a merchant account a reviewed pin lists, and none is pinned yet."]
|
|
7328
|
+
});
|
|
7329
|
+
// src/processors/iyzico.js
|
|
7330
|
+
var IYZICO_PSP = "iyzico";
|
|
7331
|
+
var IYZICO_OPERATION = "iyzico.card_request";
|
|
7332
|
+
var PATHS = ["/payment/iyzipos/checkoutform/auth/ecom", "/payment/iyzipos/checkoutform/initialize3ds/ecom"];
|
|
7333
|
+
var IYZICO_CARD_URLS = /* @__PURE__ */ Object.freeze(["https://api.iyzipay.com", "https://sandbox-api.iyzipay.com"].flatMap((origin) => PATHS.map((path) => `${origin}${path}`)));
|
|
7334
|
+
var IYZICO_BODY_KEYS = /* @__PURE__ */ Object.freeze([
|
|
7335
|
+
"installment",
|
|
7336
|
+
"paidPrice",
|
|
7337
|
+
"paymentChannel",
|
|
7338
|
+
"paymentCard",
|
|
7339
|
+
"buyerProtected",
|
|
7340
|
+
"gsmNumber",
|
|
7341
|
+
"dccPayment",
|
|
7342
|
+
"dccQueryRrn",
|
|
7343
|
+
"pwiMetadata"
|
|
7344
|
+
]);
|
|
7345
|
+
var IYZICO_CARD_KEYS = /* @__PURE__ */ Object.freeze([
|
|
7346
|
+
"cardNumber",
|
|
7347
|
+
"cardHolderName",
|
|
7348
|
+
"expireYear",
|
|
7349
|
+
"expireMonth",
|
|
7350
|
+
"cvc",
|
|
7351
|
+
"registerConsumerCard",
|
|
7352
|
+
"registerCard"
|
|
7353
|
+
]);
|
|
7354
|
+
var BODY_LIMIT39 = 4096;
|
|
7355
|
+
var CARD_NUMBER20 = /^[0-9]{12,19}$/;
|
|
7356
|
+
var SECURITY_CODE24 = /^[0-9]{3,4}$/;
|
|
7357
|
+
var MONTH20 = /^(?:0?[1-9]|1[0-2])$/;
|
|
7358
|
+
var YEAR21 = /^(?:[0-9]{2}|20[0-9]{2})$/;
|
|
7359
|
+
var PRICE = /^([1-9][0-9]{0,8}|0)(?:\.([0-9]{1,2}))?$/;
|
|
7360
|
+
var CHANNELS = /* @__PURE__ */ Object.freeze(["WEB", "MOBILE_WEB", "MOBILE_IOS", "MOBILE_ANDROID", "MOBILE_WINDOWS"]);
|
|
7361
|
+
var METADATA_KEYS3 = /* @__PURE__ */ Object.freeze(["lightRedesign", "pwiGrowthActionDisabled"]);
|
|
7362
|
+
var FLAG = /^[A-Za-z_]{1,16}$/;
|
|
7363
|
+
var HOLDER5 = /^[^\x00-\x1f\x7f0-9]{3,100}$/u;
|
|
7364
|
+
var record35 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
7365
|
+
var own16 = (value, key) => Object.prototype.hasOwnProperty.call(value, key);
|
|
7366
|
+
var inOrder7 = (value, keys) => {
|
|
7367
|
+
let at = 0;
|
|
7368
|
+
for (const name of Object.keys(value)) {
|
|
7369
|
+
while (at < keys.length && keys[at] !== name)
|
|
7370
|
+
at += 1;
|
|
7371
|
+
if (at === keys.length)
|
|
7372
|
+
return false;
|
|
7373
|
+
at += 1;
|
|
7374
|
+
}
|
|
7375
|
+
return true;
|
|
7376
|
+
};
|
|
7377
|
+
var refuse41 = (code) => Object.freeze({ verdict: "refuse", code });
|
|
7378
|
+
var CARD41 = /* @__PURE__ */ Object.freeze({ verdict: "card" });
|
|
7379
|
+
function isIyzicoCardUrl(url) {
|
|
7380
|
+
return typeof url === "string" && IYZICO_CARD_URLS.includes(url);
|
|
7381
|
+
}
|
|
7382
|
+
function readBody25(body) {
|
|
7383
|
+
if (typeof body !== "string" || body === "" || body.length > BODY_LIMIT39)
|
|
7384
|
+
return null;
|
|
7385
|
+
try {
|
|
7386
|
+
const value = JSON.parse(body);
|
|
7387
|
+
return record35(value) && JSON.stringify(value) === body ? value : null;
|
|
7388
|
+
}
|
|
7389
|
+
catch {
|
|
7390
|
+
return null;
|
|
7391
|
+
}
|
|
7392
|
+
}
|
|
7393
|
+
function hundredths(price) {
|
|
7394
|
+
const match = typeof price === "number" && Number.isFinite(price) ? PRICE.exec(String(price)) : null;
|
|
7395
|
+
const value = match ? Number(match[1]) * 100 + Number((match[2] ?? "").padEnd(2, "0")) : 0;
|
|
7396
|
+
return value > 0 ? value : null;
|
|
7397
|
+
}
|
|
7398
|
+
var holderName2 = (name) => typeof name === "string" && HOLDER5.test(name) && name.trim().split(/\s+/).filter((word) => word.length > 1).length > 1;
|
|
7399
|
+
var metadata = (value) => record35(value) && inOrder7(value, METADATA_KEYS3) && Object.values(value).every((flag3) => Array.isArray(flag3) && flag3.length === 1 && typeof flag3[0] === "string" && FLAG.test(flag3[0]));
|
|
7400
|
+
function iyzicoBodyVerdict(body) {
|
|
7401
|
+
const value = readBody25(body);
|
|
7402
|
+
if (value === null)
|
|
7403
|
+
return refuse41("iyzico_body_unsupported");
|
|
7404
|
+
const card = value.paymentCard;
|
|
7405
|
+
if (record35(card) && (own16(card, "cardToken") || own16(card, "ucsToken") || own16(card, "consumerToken")) && !own16(card, "cardNumber"))
|
|
7406
|
+
return refuse41("iyzico_saved_card");
|
|
7407
|
+
if (own16(value, "dccPayment") || own16(value, "dccQueryRrn"))
|
|
7408
|
+
return refuse41("iyzico_dcc_refused");
|
|
7409
|
+
if (own16(value, "gsmNumber") || own16(value, "buyerProtected") && value.buyerProtected !== false || record35(card) && (own16(card, "registerCard") && card.registerCard !== 0 || own16(card, "registerConsumerCard") && card.registerConsumerCard !== false)) {
|
|
7410
|
+
return refuse41("iyzico_keeps_card");
|
|
7411
|
+
}
|
|
7412
|
+
if (Number.isSafeInteger(value.installment) && value.installment > 1)
|
|
7413
|
+
return refuse41("iyzico_installments_refused");
|
|
7414
|
+
if (!inOrder7(value, IYZICO_BODY_KEYS) || !["installment", "paidPrice", "paymentChannel", "paymentCard"].every((key) => own16(value, key)) || value.installment !== 1 || hundredths(value.paidPrice) === null || !CHANNELS.includes(value.paymentChannel) || own16(value, "pwiMetadata") && !metadata(value.pwiMetadata))
|
|
7415
|
+
return refuse41("iyzico_body_unsupported");
|
|
7416
|
+
if (!record35(card) || Object.keys(card).join() !== IYZICO_CARD_KEYS.join() || typeof card.cardNumber !== "string" || !CARD_NUMBER20.test(card.cardNumber) || !holderName2(card.cardHolderName) || typeof card.expireYear !== "string" || !YEAR21.test(card.expireYear) || typeof card.expireMonth !== "string" || !MONTH20.test(card.expireMonth) || typeof card.cvc !== "string" || !SECURITY_CODE24.test(card.cvc))
|
|
7417
|
+
return refuse41("iyzico_body_unsupported");
|
|
7418
|
+
return CARD41;
|
|
6322
7419
|
}
|
|
6323
7420
|
var iyzico_default = /* @__PURE__ */ registerProcessor({
|
|
6324
7421
|
psp: IYZICO_PSP,
|
|
@@ -6351,7 +7448,7 @@ var iyzico_default = /* @__PURE__ */ registerProcessor({
|
|
|
6351
7448
|
source: "https://docs.iyzico.com/en/payment-methods/checkoutform/cf-implementation/cf-retrieve"
|
|
6352
7449
|
},
|
|
6353
7450
|
exactUrl: isIyzicoCardUrl,
|
|
6354
|
-
bodyGate: (url, body) => url !== void 0 && !isIyzicoCardUrl(url) ?
|
|
7451
|
+
bodyGate: (url, body) => url !== void 0 && !isIyzicoCardUrl(url) ? refuse41("iyzico_url_refused") : iyzicoBodyVerdict(body)
|
|
6355
7452
|
});
|
|
6356
7453
|
// src/processors/midtrans.js
|
|
6357
7454
|
var MIDTRANS_PSP = "midtrans";
|
|
@@ -6359,15 +7456,15 @@ var MIDTRANS_OPERATION = "midtrans.card_request";
|
|
|
6359
7456
|
var MIDTRANS_TOKEN_URL = "https://api.midtrans.com/v2/token";
|
|
6360
7457
|
var MIDTRANS_SANDBOX_TOKEN_URL = "https://api.sandbox.midtrans.com/v2/token";
|
|
6361
7458
|
var MIDTRANS_TOKEN_KEYS = /* @__PURE__ */ Object.freeze(["card_cvv", "card_number", "card_exp_month", "card_exp_year", "installment_term"]);
|
|
6362
|
-
var
|
|
6363
|
-
var
|
|
6364
|
-
var
|
|
6365
|
-
var
|
|
6366
|
-
var
|
|
7459
|
+
var BODY_LIMIT40 = 4096;
|
|
7460
|
+
var CARD_NUMBER21 = /^[0-9]{12,19}$/;
|
|
7461
|
+
var SECURITY_CODE25 = /^[0-9]{3,4}$/;
|
|
7462
|
+
var MONTH21 = /^(?:0[1-9]|1[0-2])$/;
|
|
7463
|
+
var YEAR22 = /^20[0-9]{2}$/;
|
|
6367
7464
|
var TERM = /^[0-9]{1,3}$/;
|
|
6368
|
-
var
|
|
6369
|
-
var
|
|
6370
|
-
var
|
|
7465
|
+
var record36 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
7466
|
+
var own17 = (value, key) => Object.prototype.hasOwnProperty.call(value, key);
|
|
7467
|
+
var inOrder8 = (value, keys) => {
|
|
6371
7468
|
let at = 0;
|
|
6372
7469
|
for (const name of Object.keys(value)) {
|
|
6373
7470
|
while (at < keys.length && keys[at] !== name)
|
|
@@ -6378,18 +7475,18 @@ var inOrder7 = (value, keys) => {
|
|
|
6378
7475
|
}
|
|
6379
7476
|
return true;
|
|
6380
7477
|
};
|
|
6381
|
-
var
|
|
6382
|
-
var
|
|
7478
|
+
var refuse42 = (code) => Object.freeze({ verdict: "refuse", code });
|
|
7479
|
+
var CARD42 = /* @__PURE__ */ Object.freeze({ verdict: "card" });
|
|
6383
7480
|
function isMidtransTokenUrl(url) {
|
|
6384
7481
|
return url === MIDTRANS_TOKEN_URL || url === MIDTRANS_SANDBOX_TOKEN_URL;
|
|
6385
7482
|
}
|
|
6386
|
-
function
|
|
6387
|
-
if (typeof body !== "string" || body === "" || body.length >
|
|
7483
|
+
function readBody26(body) {
|
|
7484
|
+
if (typeof body !== "string" || body === "" || body.length > BODY_LIMIT40)
|
|
6388
7485
|
return null;
|
|
6389
7486
|
let value;
|
|
6390
7487
|
try {
|
|
6391
7488
|
value = JSON.parse(body);
|
|
6392
|
-
if (!
|
|
7489
|
+
if (!record36(value) || JSON.stringify(value) !== body)
|
|
6393
7490
|
return null;
|
|
6394
7491
|
}
|
|
6395
7492
|
catch {
|
|
@@ -6398,20 +7495,20 @@ function readBody23(body) {
|
|
|
6398
7495
|
return value;
|
|
6399
7496
|
}
|
|
6400
7497
|
function midtransBodyVerdict(body) {
|
|
6401
|
-
const value =
|
|
6402
|
-
if (value === null || !
|
|
6403
|
-
if (
|
|
6404
|
-
return
|
|
6405
|
-
return
|
|
7498
|
+
const value = readBody26(body);
|
|
7499
|
+
if (value === null || !inOrder8(value, MIDTRANS_TOKEN_KEYS)) {
|
|
7500
|
+
if (record36(value) && (own17(value, "token_id") || own17(value, "two_click")) && !own17(value, "card_number"))
|
|
7501
|
+
return refuse42("midtrans_saved_card");
|
|
7502
|
+
return refuse42("midtrans_body_unsupported");
|
|
6406
7503
|
}
|
|
6407
|
-
if (!
|
|
6408
|
-
return
|
|
7504
|
+
if (!own17(value, "card_cvv") || !own17(value, "card_number") || !own17(value, "card_exp_month") || !own17(value, "card_exp_year")) {
|
|
7505
|
+
return refuse42("midtrans_body_unsupported");
|
|
6409
7506
|
}
|
|
6410
|
-
if (typeof value.card_cvv !== "string" || !
|
|
6411
|
-
return
|
|
6412
|
-
if (
|
|
6413
|
-
return
|
|
6414
|
-
return
|
|
7507
|
+
if (typeof value.card_cvv !== "string" || !SECURITY_CODE25.test(value.card_cvv) || typeof value.card_number !== "string" || !CARD_NUMBER21.test(value.card_number) || typeof value.card_exp_month !== "string" || !MONTH21.test(value.card_exp_month) || typeof value.card_exp_year !== "string" || !YEAR22.test(value.card_exp_year))
|
|
7508
|
+
return refuse42("midtrans_body_unsupported");
|
|
7509
|
+
if (own17(value, "installment_term") && (typeof value.installment_term !== "string" || !TERM.test(value.installment_term)))
|
|
7510
|
+
return refuse42("midtrans_body_unsupported");
|
|
7511
|
+
return CARD42;
|
|
6415
7512
|
}
|
|
6416
7513
|
var midtrans_default = /* @__PURE__ */ registerProcessor({
|
|
6417
7514
|
psp: MIDTRANS_PSP,
|
|
@@ -6429,18 +7526,111 @@ var midtrans_default = /* @__PURE__ */ registerProcessor({
|
|
|
6429
7526
|
sandboxHosts: ["^api\\.sandbox\\.midtrans\\.com$"],
|
|
6430
7527
|
hostEnvironmentPinned: true,
|
|
6431
7528
|
encoding: "json",
|
|
6432
|
-
// Snap's own headers: the publishable client key (Authorization Basic) and X-Service. Origin, Referer and
|
|
6433
|
-
// cookies never ride.
|
|
6434
|
-
passthroughHeaders: ["^authorization$", "^x-service$"],
|
|
6435
|
-
jsonCardFields: [["card_number"]]
|
|
7529
|
+
// Snap's own headers: the publishable client key (Authorization Basic) and X-Service. Origin, Referer and
|
|
7530
|
+
// cookies never ride.
|
|
7531
|
+
passthroughHeaders: ["^authorization$", "^x-service$"],
|
|
7532
|
+
jsonCardFields: [["card_number"]]
|
|
7533
|
+
}
|
|
7534
|
+
],
|
|
7535
|
+
// Only the cardholder's device sends a token, after a person approves; no reviewed list names midtrans.
|
|
7536
|
+
refusedOperations: [MIDTRANS_OPERATION],
|
|
7537
|
+
// Not surveyed: the token moves no money, and the merchant's own charge names its status by the order id alone.
|
|
7538
|
+
settlementReadback: "not_surveyed",
|
|
7539
|
+
exactUrl: isMidtransTokenUrl,
|
|
7540
|
+
bodyGate: (url, body) => url !== void 0 && !isMidtransTokenUrl(url) ? { verdict: "refuse", code: "midtrans_url_refused" } : midtransBodyVerdict(body)
|
|
7541
|
+
});
|
|
7542
|
+
// src/processors/monei.js
|
|
7543
|
+
var MONEI_PSP = "monei";
|
|
7544
|
+
var MONEI_OPERATION = "monei.card_request";
|
|
7545
|
+
var MONEI_TOKENS_URL = "https://api.monei.com/v1/tokens";
|
|
7546
|
+
var BODY_LIMIT41 = 1024;
|
|
7547
|
+
var PAYMENT_ID = /^(?:[0-9a-f]{32}|[0-9a-f]{40})$/;
|
|
7548
|
+
var MONEI_CARD_KEYS = /* @__PURE__ */ Object.freeze(["number", "expMonth", "expYear", "cvc"]);
|
|
7549
|
+
var NUMBER9 = /^[0-9]{12,19}$/;
|
|
7550
|
+
var MONTH22 = /^(?:0[1-9]|1[0-2])$/;
|
|
7551
|
+
var YEAR23 = /^[0-9]{2}$/;
|
|
7552
|
+
var CODE8 = /^[0-9]{3,4}$/;
|
|
7553
|
+
var record37 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
7554
|
+
var keysAre2 = (value, keys) => {
|
|
7555
|
+
const found = Object.keys(value);
|
|
7556
|
+
return found.length === keys.length && found.every((key, at) => key === keys[at]);
|
|
7557
|
+
};
|
|
7558
|
+
var refuse43 = (code) => Object.freeze({ verdict: "refuse", code });
|
|
7559
|
+
var CARD43 = /* @__PURE__ */ Object.freeze({ verdict: "card" });
|
|
7560
|
+
function luhn10(digits3) {
|
|
7561
|
+
let sum = 0;
|
|
7562
|
+
for (let at = 0; at < digits3.length; at += 1) {
|
|
7563
|
+
let digit = Number(digits3[digits3.length - 1 - at]);
|
|
7564
|
+
if (at % 2 === 1) {
|
|
7565
|
+
digit *= 2;
|
|
7566
|
+
if (digit > 9)
|
|
7567
|
+
digit -= 9;
|
|
7568
|
+
}
|
|
7569
|
+
sum += digit;
|
|
7570
|
+
}
|
|
7571
|
+
return sum % 10 === 0;
|
|
7572
|
+
}
|
|
7573
|
+
function isMoneiTokensUrl(url) {
|
|
7574
|
+
return url === MONEI_TOKENS_URL;
|
|
7575
|
+
}
|
|
7576
|
+
function readBody27(body) {
|
|
7577
|
+
if (typeof body !== "string" || body === "" || body.length > BODY_LIMIT41)
|
|
7578
|
+
return null;
|
|
7579
|
+
try {
|
|
7580
|
+
const value = JSON.parse(body);
|
|
7581
|
+
return record37(value) && JSON.stringify(value) === body ? value : null;
|
|
7582
|
+
}
|
|
7583
|
+
catch {
|
|
7584
|
+
return null;
|
|
7585
|
+
}
|
|
7586
|
+
}
|
|
7587
|
+
function moneiBodyVerdict(body, url) {
|
|
7588
|
+
if (url !== void 0 && !isMoneiTokensUrl(url))
|
|
7589
|
+
return refuse43("monei_url_refused");
|
|
7590
|
+
const value = readBody27(body);
|
|
7591
|
+
if (value === null || !keysAre2(value, ["paymentId", "paymentMethod"]) || typeof value.paymentId !== "string" || !PAYMENT_ID.test(value.paymentId))
|
|
7592
|
+
return refuse43("monei_body_unsupported");
|
|
7593
|
+
const method = value.paymentMethod;
|
|
7594
|
+
if (!record37(method) || !keysAre2(method, ["card"]) || !record37(method.card) || !keysAre2(method.card, MONEI_CARD_KEYS))
|
|
7595
|
+
return refuse43("monei_body_unsupported");
|
|
7596
|
+
const { number, expMonth, expYear, cvc } = method.card;
|
|
7597
|
+
if (![number, expMonth, expYear, cvc].every((part) => typeof part === "string"))
|
|
7598
|
+
return refuse43("monei_body_unsupported");
|
|
7599
|
+
if (!NUMBER9.test(number) || !luhn10(number) || !MONTH22.test(expMonth) || !YEAR23.test(expYear) || !CODE8.test(cvc))
|
|
7600
|
+
return refuse43("monei_body_unsupported");
|
|
7601
|
+
return CARD43;
|
|
7602
|
+
}
|
|
7603
|
+
var MONEI_MERCHANT_PINS = /* @__PURE__ */ Object.freeze([
|
|
7604
|
+
Object.freeze({ merchant: "Genuins", accountIds: Object.freeze(["8d58ab4c-4ad0-4053-b18f-79d80e9ee158"]), merchantUrls: Object.freeze(["https://genuins.com/"]) })
|
|
7605
|
+
]);
|
|
7606
|
+
var monei_default = /* @__PURE__ */ registerProcessor({
|
|
7607
|
+
psp: MONEI_PSP,
|
|
7608
|
+
definitions: [
|
|
7609
|
+
{
|
|
7610
|
+
psp: "monei",
|
|
7611
|
+
// The card frame's token request, as the header above reads it. One host serves test and live payments alike,
|
|
7612
|
+
// so no sandbox host is marked: MONEI's record of the payment names its mode, and the device sends a test payment
|
|
7613
|
+
// only MONEI's documented test cards (moneiDeviceRefusal). The frame sets no deadline on the fetch, so the
|
|
7614
|
+
// cardholder approves at the shopper's Pay. `(?![\w/.%-])` ends the path for a consumer that tests `match`
|
|
7615
|
+
// unanchored, and the exact-URL rule below holds the rest. Ships dark: served only to a client that declares
|
|
7616
|
+
// `monei_card_token`, and gated off for every company until the backend's gate names one.
|
|
7617
|
+
capability: "monei_card_token",
|
|
7618
|
+
match: "api\\.monei\\.com/v1/tokens(?![\\w/.%-])",
|
|
7619
|
+
hosts: ["^api\\.monei\\.com$"],
|
|
7620
|
+
encoding: "json",
|
|
7621
|
+
// The frame's two device headers. Origin, Referer and cookies never ride.
|
|
7622
|
+
passthroughHeaders: ["^x-client-env$", "^x-client-fingerprint$"],
|
|
7623
|
+
jsonCardFields: [["paymentMethod", "card", "number"]]
|
|
6436
7624
|
}
|
|
6437
7625
|
],
|
|
6438
|
-
// Only the cardholder's device sends a
|
|
6439
|
-
refusedOperations: [
|
|
6440
|
-
// Not surveyed: the token moves no money
|
|
7626
|
+
// Only the cardholder's device sends a card, after a person approves; no reviewed list names monei.
|
|
7627
|
+
refusedOperations: [MONEI_OPERATION],
|
|
7628
|
+
// Not surveyed: the card request mints a token and moves no money; MONEI's confirm, which the page sends, charges it.
|
|
6441
7629
|
settlementReadback: "not_surveyed",
|
|
6442
|
-
exactUrl:
|
|
6443
|
-
bodyGate: (url, body) =>
|
|
7630
|
+
exactUrl: isMoneiTokensUrl,
|
|
7631
|
+
bodyGate: (url, body) => moneiBodyVerdict(body, url)
|
|
7632
|
+
// No amount reader: the request names none. MONEI's record of the payment names it, and the device holds that record
|
|
7633
|
+
// to the approved amount before it writes any card.
|
|
6444
7634
|
});
|
|
6445
7635
|
// src/processors/oceanpayment.js
|
|
6446
7636
|
var OCEANPAYMENT_PSP = "oceanpayment";
|
|
@@ -6471,10 +7661,10 @@ var OCEANPAYMENT_FORM_FIELDS = /* @__PURE__ */ Object.freeze([
|
|
|
6471
7661
|
"methods",
|
|
6472
7662
|
"reference"
|
|
6473
7663
|
]);
|
|
6474
|
-
var
|
|
6475
|
-
var
|
|
7664
|
+
var URL_LIMIT16 = 2048;
|
|
7665
|
+
var BODY_LIMIT42 = 8192;
|
|
6476
7666
|
var SEND_PAY = /^\/gateway\/sendPay;jsessionid=[A-Za-z0-9._!-]{16,128}$/;
|
|
6477
|
-
var
|
|
7667
|
+
var own18 = (value, key) => Object.prototype.hasOwnProperty.call(value, key);
|
|
6478
7668
|
var exact4 = (pattern, value) => typeof value === "string" && pattern.test(value);
|
|
6479
7669
|
var CARD_RUN = /[0-9]{12}/;
|
|
6480
7670
|
var printable5 = (max) => (value) => typeof value === "string" && value.length <= max && /^[\x20-\x7e]*$/.test(value) && !CARD_RUN.test(value);
|
|
@@ -6512,7 +7702,7 @@ var SHAPES2 = /* @__PURE__ */ new Map([
|
|
|
6512
7702
|
["button", (v) => v === ""]
|
|
6513
7703
|
]);
|
|
6514
7704
|
function oceanpaymentSendPayUrl(url) {
|
|
6515
|
-
if (typeof url !== "string" || url.length >
|
|
7705
|
+
if (typeof url !== "string" || url.length > URL_LIMIT16 || url.includes("?") || url.includes("#"))
|
|
6516
7706
|
return null;
|
|
6517
7707
|
let parsed;
|
|
6518
7708
|
try {
|
|
@@ -6521,7 +7711,7 @@ function oceanpaymentSendPayUrl(url) {
|
|
|
6521
7711
|
catch {
|
|
6522
7712
|
return null;
|
|
6523
7713
|
}
|
|
6524
|
-
if (parsed.href !== url || parsed.protocol !== "https:" || parsed.port || parsed.username || parsed.password || !
|
|
7714
|
+
if (parsed.href !== url || parsed.protocol !== "https:" || parsed.port || parsed.username || parsed.password || !own18(OCEANPAYMENT_HOSTS, parsed.hostname) || !SEND_PAY.test(parsed.pathname))
|
|
6525
7715
|
return null;
|
|
6526
7716
|
return Object.freeze({ host: parsed.hostname, environment: OCEANPAYMENT_HOSTS[parsed.hostname] });
|
|
6527
7717
|
}
|
|
@@ -6549,7 +7739,7 @@ function formDecode2(raw) {
|
|
|
6549
7739
|
return formEncode3(value) === raw ? value : null;
|
|
6550
7740
|
}
|
|
6551
7741
|
function readPairs2(body) {
|
|
6552
|
-
if (typeof body !== "string" || body === "" || body.length >
|
|
7742
|
+
if (typeof body !== "string" || body === "" || body.length > BODY_LIMIT42)
|
|
6553
7743
|
return null;
|
|
6554
7744
|
const pairs = [];
|
|
6555
7745
|
for (const chunk of body.split("&")) {
|
|
@@ -6634,7 +7824,7 @@ var PAYMENTWALL_PSP = "paymentwall";
|
|
|
6634
7824
|
var PAYMENTWALL_OPERATION = "paymentwall.card_request";
|
|
6635
7825
|
var PAYMENTWALL_TOKEN_URL = "https://pwgateway.com/api/token";
|
|
6636
7826
|
var PAYMENTWALL_SANDBOX_TOKEN_URL = "https://api.paymentwall.com/api/brick/token";
|
|
6637
|
-
var
|
|
7827
|
+
var BODY_LIMIT43 = 2048;
|
|
6638
7828
|
var KEY3 = "public_key";
|
|
6639
7829
|
var PUBLIC_KEY2 = /^(?:t_)?[A-Za-z0-9]{16,64}$/;
|
|
6640
7830
|
var SHAPES3 = /* @__PURE__ */ Object.freeze({
|
|
@@ -6644,9 +7834,9 @@ var SHAPES3 = /* @__PURE__ */ Object.freeze({
|
|
|
6644
7834
|
"card[exp_year]": /^(?:[0-9]{2}|20[0-9]{2})$/,
|
|
6645
7835
|
"card[cvv]": /^[0-9]{3,4}$/
|
|
6646
7836
|
});
|
|
6647
|
-
var
|
|
6648
|
-
var
|
|
6649
|
-
function
|
|
7837
|
+
var refuse44 = (code) => Object.freeze({ verdict: "refuse", code });
|
|
7838
|
+
var CARD44 = /* @__PURE__ */ Object.freeze({ verdict: "card" });
|
|
7839
|
+
function luhn11(digits3) {
|
|
6650
7840
|
let sum = 0;
|
|
6651
7841
|
for (let at = 0; at < digits3.length; at += 1) {
|
|
6652
7842
|
let digit = Number(digits3[digits3.length - 1 - at]);
|
|
@@ -6673,7 +7863,7 @@ function paymentwallKeyEnvironment(publicKey) {
|
|
|
6673
7863
|
return publicKey.startsWith("t_") ? "sandbox" : "production";
|
|
6674
7864
|
}
|
|
6675
7865
|
function readPairs3(body) {
|
|
6676
|
-
if (typeof body !== "string" || body === "" || body.length >
|
|
7866
|
+
if (typeof body !== "string" || body === "" || body.length > BODY_LIMIT43 || !/^[A-Za-z0-9_[\]=&]+$/.test(body))
|
|
6677
7867
|
return null;
|
|
6678
7868
|
const pairs = /* @__PURE__ */ new Map();
|
|
6679
7869
|
for (const chunk of body.split("&")) {
|
|
@@ -6689,21 +7879,21 @@ function readPairs3(body) {
|
|
|
6689
7879
|
}
|
|
6690
7880
|
function paymentwallBodyVerdict(body, url) {
|
|
6691
7881
|
if (url !== void 0 && !isPaymentwallTokenUrl(url))
|
|
6692
|
-
return
|
|
7882
|
+
return refuse44("paymentwall_url_refused");
|
|
6693
7883
|
const pairs = readPairs3(body);
|
|
6694
7884
|
if (pairs === null)
|
|
6695
|
-
return
|
|
7885
|
+
return refuse44("paymentwall_body_unsupported");
|
|
6696
7886
|
if (pairs.has("card[token]") && !pairs.has("card[number]"))
|
|
6697
|
-
return
|
|
7887
|
+
return refuse44("paymentwall_saved_card");
|
|
6698
7888
|
const keys = Object.keys(SHAPES3);
|
|
6699
7889
|
if (pairs.size !== keys.length || !keys.every((key) => pairs.has(key) && SHAPES3[key].test(pairs.get(key)))) {
|
|
6700
|
-
return
|
|
7890
|
+
return refuse44("paymentwall_body_unsupported");
|
|
6701
7891
|
}
|
|
6702
|
-
if (!
|
|
6703
|
-
return
|
|
7892
|
+
if (!luhn11(pairs.get("card[number]")))
|
|
7893
|
+
return refuse44("paymentwall_body_unsupported");
|
|
6704
7894
|
if (url !== void 0 && paymentwallKeyEnvironment(pairs.get(KEY3)) !== paymentwallUrlEnvironment(url))
|
|
6705
|
-
return
|
|
6706
|
-
return
|
|
7895
|
+
return refuse44("paymentwall_key_refused");
|
|
7896
|
+
return CARD44;
|
|
6707
7897
|
}
|
|
6708
7898
|
var paymentwall_default = /* @__PURE__ */ registerProcessor({
|
|
6709
7899
|
psp: PAYMENTWALL_PSP,
|
|
@@ -6732,112 +7922,15 @@ var paymentwall_default = /* @__PURE__ */ registerProcessor({
|
|
|
6732
7922
|
exactUrl: isPaymentwallTokenUrl,
|
|
6733
7923
|
bodyGate: (url, body) => paymentwallBodyVerdict(body, url)
|
|
6734
7924
|
});
|
|
6735
|
-
// src/processors/ekashu.js
|
|
6736
|
-
var EKASHU_HOSTS = Object.freeze(["live.ekashu.com", "test.ekashu.com"]);
|
|
6737
|
-
var EKASHU_TEST_PANS = Object.freeze(["4100000000000100", "5100000000000107"]);
|
|
6738
|
-
var EKASHU_SIGNED_FIELDS = Object.freeze([
|
|
6739
|
-
"ekashu_3d_secure_verify",
|
|
6740
|
-
"ekashu_amount",
|
|
6741
|
-
"ekashu_amount_format",
|
|
6742
|
-
"ekashu_auto_confirm",
|
|
6743
|
-
"ekashu_callback_failure_url",
|
|
6744
|
-
"ekashu_callback_include_post",
|
|
6745
|
-
"ekashu_callback_success_url",
|
|
6746
|
-
"ekashu_card_address_editable",
|
|
6747
|
-
"ekashu_card_address_required",
|
|
6748
|
-
"ekashu_card_address_verify",
|
|
6749
|
-
"ekashu_card_email_address_mandatory",
|
|
6750
|
-
"ekashu_card_phone_number_mandatory",
|
|
6751
|
-
"ekashu_card_title_mandatory",
|
|
6752
|
-
"ekashu_card_zip_code_verify",
|
|
6753
|
-
"ekashu_currency",
|
|
6754
|
-
"ekashu_delivery_address_editable",
|
|
6755
|
-
"ekashu_delivery_address_required",
|
|
6756
|
-
"ekashu_delivery_email_address_mandatory",
|
|
6757
|
-
"ekashu_delivery_phone_number_mandatory",
|
|
6758
|
-
"ekashu_delivery_title_mandatory",
|
|
6759
|
-
"ekashu_description",
|
|
6760
|
-
"ekashu_device",
|
|
6761
|
-
"ekashu_duplicate_check",
|
|
6762
|
-
"ekashu_duplicate_minutes",
|
|
6763
|
-
"ekashu_failure_return_text",
|
|
6764
|
-
"ekashu_failure_url",
|
|
6765
|
-
"ekashu_hash_code_format",
|
|
6766
|
-
"ekashu_hash_code_type",
|
|
6767
|
-
"ekashu_hash_code_version",
|
|
6768
|
-
"ekashu_include_post",
|
|
6769
|
-
"ekashu_invoice_address_editable",
|
|
6770
|
-
"ekashu_invoice_address_required",
|
|
6771
|
-
"ekashu_invoice_email_address_mandatory",
|
|
6772
|
-
"ekashu_invoice_phone_number_mandatory",
|
|
6773
|
-
"ekashu_invoice_title_mandatory",
|
|
6774
|
-
"ekashu_locale",
|
|
6775
|
-
"ekashu_payment_methods",
|
|
6776
|
-
"ekashu_reference",
|
|
6777
|
-
"ekashu_request_type",
|
|
6778
|
-
"ekashu_return_text",
|
|
6779
|
-
"ekashu_seller_address",
|
|
6780
|
-
"ekashu_seller_email_address",
|
|
6781
|
-
"ekashu_seller_id",
|
|
6782
|
-
"ekashu_seller_key",
|
|
6783
|
-
"ekashu_seller_name",
|
|
6784
|
-
"ekashu_shortcut_icon",
|
|
6785
|
-
"ekashu_style_sheet",
|
|
6786
|
-
"ekashu_success_url",
|
|
6787
|
-
"ekashu_title",
|
|
6788
|
-
"ekashu_verification_value_mask",
|
|
6789
|
-
"ekashu_verification_value_verify",
|
|
6790
|
-
"ekashu_viewport"
|
|
6791
|
-
]);
|
|
6792
|
-
var REQUIRED = Object.freeze([
|
|
6793
|
-
"ekashu_seller_id",
|
|
6794
|
-
"ekashu_seller_key",
|
|
6795
|
-
"ekashu_amount",
|
|
6796
|
-
"ekashu_currency",
|
|
6797
|
-
"ekashu_reference",
|
|
6798
|
-
"ekashu_hash_code",
|
|
6799
|
-
"ekashu_hash_code_type",
|
|
6800
|
-
"ekashu_hash_code_version",
|
|
6801
|
-
"ekashu_success_url",
|
|
6802
|
-
"ekashu_failure_url",
|
|
6803
|
-
"ekashu_callback_success_url"
|
|
6804
|
-
]);
|
|
6805
|
-
var CARD_KEYS16 = Object.freeze([
|
|
6806
|
-
"ekashu_card_number",
|
|
6807
|
-
"ekashu_expires_end_month",
|
|
6808
|
-
"ekashu_expires_end_year",
|
|
6809
|
-
"ekashu_verification_value",
|
|
6810
|
-
"ekashu_valid_from_month",
|
|
6811
|
-
"ekashu_valid_from_year",
|
|
6812
|
-
"ekashu_issue_number"
|
|
6813
|
-
]);
|
|
6814
|
-
var PAGE_KEYS = Object.freeze(["ekashu_stage", "ekashu_context", "ekashu_submission_id"]);
|
|
6815
|
-
var STORED_KEYS = Object.freeze(["ekashu_card_hash", "ekashu_card_reference", "ekashu_cof_initiated_by", "ekashu_cof_reason", "ekashu_cof_id"]);
|
|
6816
|
-
var REDIRECT_KEYS = Object.freeze(["ekashu_success_url", "ekashu_failure_url", "ekashu_return_url"]);
|
|
6817
|
-
var CALLBACK_KEYS = Object.freeze(["ekashu_callback_success_url", "ekashu_callback_failure_url"]);
|
|
6818
|
-
var MAX_ENTRY = 16 * 1024;
|
|
6819
|
-
var MAX_PAGE = 256 * 1024;
|
|
6820
|
-
var EKASHU_SELLERS = Object.freeze([
|
|
6821
|
-
Object.freeze({ sellerId: "25060100", merchant: "Heathrow Drop-off", entryHost: "heathrowdropoff.apcoa.com", callbackHost: "incomingapi.apcoa.co.uk" })
|
|
6822
|
-
]);
|
|
6823
|
-
var CARD_FIELDS = Object.freeze({
|
|
6824
|
-
number: "ekashu_card_number",
|
|
6825
|
-
month: "ekashu_expires_end_month",
|
|
6826
|
-
year: "ekashu_expires_end_year",
|
|
6827
|
-
cvc: "ekashu_verification_value"
|
|
6828
|
-
});
|
|
6829
|
-
var NAME_FIELDS = Object.freeze({ first: "ekashu_card_first_name", last: "ekashu_card_last_name" });
|
|
6830
|
-
var LEFT_EMPTY = Object.freeze(["ekashu_card_title", "ekashu_valid_from_month", "ekashu_valid_from_year", "ekashu_issue_number"]);
|
|
6831
|
-
var VISIBLE = /* @__PURE__ */ new Set([...Object.values(CARD_FIELDS), ...Object.values(NAME_FIELDS), ...LEFT_EMPTY]);
|
|
6832
7925
|
// src/processors/payplug.js
|
|
6833
7926
|
var PAYPLUG_PSP = "payplug";
|
|
6834
7927
|
var PAYPLUG_OPERATION = "payplug.hosted_sale";
|
|
6835
7928
|
var PAYPLUG_HOST = "secure.payplug.com";
|
|
6836
7929
|
var ENTRY_PATH = /^\/pay\/(?:(test)\/)?([A-Za-z0-9]{22})$/;
|
|
6837
|
-
var
|
|
6838
|
-
var
|
|
7930
|
+
var MAX_URL3 = 256;
|
|
7931
|
+
var field4 = (name, reason) => ({ ok: false, code: "hosted_form_field_refused", field: name, reason });
|
|
6839
7932
|
function payplugEntry(raw) {
|
|
6840
|
-
if (typeof raw !== "string" || raw.length >
|
|
7933
|
+
if (typeof raw !== "string" || raw.length > MAX_URL3 || raw.includes("?") || raw.includes("#"))
|
|
6841
7934
|
return null;
|
|
6842
7935
|
let url;
|
|
6843
7936
|
try {
|
|
@@ -6859,7 +7952,7 @@ var PAYPLUG_MERCHANTS = Object.freeze([
|
|
|
6859
7952
|
]);
|
|
6860
7953
|
var ACCOUNT_ID = /^[A-Za-z0-9-]{1,64}$/;
|
|
6861
7954
|
function payplugMerchant(checkoutOrigin, merchants = PAYPLUG_MERCHANTS) {
|
|
6862
|
-
if (typeof checkoutOrigin !== "string" || checkoutOrigin.length >
|
|
7955
|
+
if (typeof checkoutOrigin !== "string" || checkoutOrigin.length > MAX_URL3 || !Array.isArray(merchants))
|
|
6863
7956
|
return null;
|
|
6864
7957
|
let url;
|
|
6865
7958
|
try {
|
|
@@ -6875,16 +7968,16 @@ function payplugMerchant(checkoutOrigin, merchants = PAYPLUG_MERCHANTS) {
|
|
|
6875
7968
|
}
|
|
6876
7969
|
function checkPayplugEntry(body, { url = null, checkoutOrigin = null, merchants = PAYPLUG_MERCHANTS } = {}) {
|
|
6877
7970
|
if (body !== void 0 && body !== null && body !== "")
|
|
6878
|
-
return
|
|
7971
|
+
return field4("(body)", "not_an_entry");
|
|
6879
7972
|
const entry = payplugEntry(url);
|
|
6880
7973
|
if (!entry)
|
|
6881
|
-
return
|
|
7974
|
+
return field4("(url)", "malformed_field");
|
|
6882
7975
|
const seller = payplugMerchant(checkoutOrigin, merchants);
|
|
6883
7976
|
if (!seller)
|
|
6884
|
-
return
|
|
7977
|
+
return field4("(checkout_origin)", "seller_unreviewed");
|
|
6885
7978
|
return { ok: true, pairs: [], gated: false, dedupe: [entry.id], paymentId: entry.id, sandbox: entry.test, seller };
|
|
6886
7979
|
}
|
|
6887
|
-
var
|
|
7980
|
+
var MAX_PAGE5 = 512 * 1024;
|
|
6888
7981
|
var PAYPLUG_REFUSALS = Object.freeze(["payplug_failed", "payplug_expired", "payplug_cancelled"]);
|
|
6889
7982
|
var payplug_default = /* @__PURE__ */ registerProcessor({
|
|
6890
7983
|
psp: PAYPLUG_PSP,
|
|
@@ -6934,11 +8027,129 @@ var payplug_default = /* @__PURE__ */ registerProcessor({
|
|
|
6934
8027
|
"PayPlug sends the buyer to the merchant's return page whether the payment succeeded or not, so the browser receives a submission notice, not the processor result."
|
|
6935
8028
|
]
|
|
6936
8029
|
});
|
|
8030
|
+
// src/processors/paystack.js
|
|
8031
|
+
var PAYSTACK_PSP = "paystack";
|
|
8032
|
+
var PAYSTACK_OPERATION = "paystack.card_request";
|
|
8033
|
+
var PAYSTACK_CHARGE_URL = "https://standard.paystack.co/charge/";
|
|
8034
|
+
var PAYSTACK_BODY_KEYS = /* @__PURE__ */ Object.freeze([
|
|
8035
|
+
"clientdata",
|
|
8036
|
+
"last4",
|
|
8037
|
+
"trans",
|
|
8038
|
+
"access_code",
|
|
8039
|
+
"device",
|
|
8040
|
+
"offset",
|
|
8041
|
+
"remember_card",
|
|
8042
|
+
"card_holder_name",
|
|
8043
|
+
"transaction_type"
|
|
8044
|
+
]);
|
|
8045
|
+
var OPTIONAL = /* @__PURE__ */ new Set(["access_code", "card_holder_name", "transaction_type"]);
|
|
8046
|
+
var BODY_LIMIT44 = 4096;
|
|
8047
|
+
var CIPHERTEXT_BYTES2 = [62, 63, 64];
|
|
8048
|
+
var BASE646 = /^[A-Za-z0-9+/]+={0,2}$/;
|
|
8049
|
+
var SHAPES4 = /* @__PURE__ */ Object.freeze({
|
|
8050
|
+
last4: /^[0-9]{4}$/,
|
|
8051
|
+
trans: /^[0-9]{1,20}$/,
|
|
8052
|
+
access_code: /^[A-Za-z0-9]{1,64}$/,
|
|
8053
|
+
device: /^[\x21-\x7e]{1,512}$/,
|
|
8054
|
+
offset: /^-?[0-9]{1,3}$/,
|
|
8055
|
+
remember_card: /^false$/,
|
|
8056
|
+
// A name carries no digit, so no card number can ride in it.
|
|
8057
|
+
card_holder_name: /^[^\x00-\x1f\x7f0-9]{1,128}$/u,
|
|
8058
|
+
transaction_type: /^[a-z_]{1,32}$/
|
|
8059
|
+
});
|
|
8060
|
+
var own19 = (value, key) => Object.prototype.hasOwnProperty.call(value, key);
|
|
8061
|
+
var refuse45 = (code) => Object.freeze({ verdict: "refuse", code });
|
|
8062
|
+
function paystackFormValue(value) {
|
|
8063
|
+
return encodeURIComponent(String(value)).replace(/%20/g, "+").replace(/[!'()*~]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`);
|
|
8064
|
+
}
|
|
8065
|
+
function paystackFormBody(entries) {
|
|
8066
|
+
return entries.map(([key, value]) => `${paystackFormValue(key)}=${paystackFormValue(value)}`).join("&");
|
|
8067
|
+
}
|
|
8068
|
+
function isPaystackChargeUrl(url) {
|
|
8069
|
+
return url === PAYSTACK_CHARGE_URL;
|
|
8070
|
+
}
|
|
8071
|
+
function isCiphertext2(value) {
|
|
8072
|
+
if (value.length % 4 !== 0 || !BASE646.test(value))
|
|
8073
|
+
return false;
|
|
8074
|
+
let binary;
|
|
8075
|
+
try {
|
|
8076
|
+
binary = atob(value);
|
|
8077
|
+
}
|
|
8078
|
+
catch {
|
|
8079
|
+
return false;
|
|
8080
|
+
}
|
|
8081
|
+
return btoa(binary) === value && CIPHERTEXT_BYTES2.includes(binary.length);
|
|
8082
|
+
}
|
|
8083
|
+
function readForm3(body) {
|
|
8084
|
+
if (typeof body !== "string" || body === "" || body.length > BODY_LIMIT44)
|
|
8085
|
+
return null;
|
|
8086
|
+
const entries = [];
|
|
8087
|
+
for (const part of body.split("&")) {
|
|
8088
|
+
const at = part.indexOf("=");
|
|
8089
|
+
if (at <= 0)
|
|
8090
|
+
return null;
|
|
8091
|
+
try {
|
|
8092
|
+
entries.push([decodeURIComponent(part.slice(0, at).replace(/\+/g, " ")), decodeURIComponent(part.slice(at + 1).replace(/\+/g, " "))]);
|
|
8093
|
+
}
|
|
8094
|
+
catch {
|
|
8095
|
+
return null;
|
|
8096
|
+
}
|
|
8097
|
+
}
|
|
8098
|
+
return paystackFormBody(entries) === body ? entries : null;
|
|
8099
|
+
}
|
|
8100
|
+
function paystackBodyVerdict(body) {
|
|
8101
|
+
const entries = readForm3(body);
|
|
8102
|
+
if (entries === null)
|
|
8103
|
+
return refuse45("paystack_body_unsupported");
|
|
8104
|
+
const keys = entries.map(([key]) => key);
|
|
8105
|
+
if (keys.includes("subscription"))
|
|
8106
|
+
return refuse45("paystack_subscription");
|
|
8107
|
+
if (keys.includes("remember_card") && entries.find(([key]) => key === "remember_card")[1] !== "false")
|
|
8108
|
+
return refuse45("paystack_saved_card");
|
|
8109
|
+
const expected = PAYSTACK_BODY_KEYS.filter((key) => !OPTIONAL.has(key) || keys.includes(key));
|
|
8110
|
+
if (keys.length !== expected.length || keys.some((key, i) => key !== expected[i]))
|
|
8111
|
+
return refuse45("paystack_body_unsupported");
|
|
8112
|
+
const fields = Object.fromEntries(entries);
|
|
8113
|
+
if (!isCiphertext2(fields.clientdata))
|
|
8114
|
+
return refuse45("paystack_body_unsupported");
|
|
8115
|
+
for (const [key, shape] of Object.entries(SHAPES4)) {
|
|
8116
|
+
if (own19(fields, key) && !shape.test(fields[key]))
|
|
8117
|
+
return refuse45("paystack_body_unsupported");
|
|
8118
|
+
}
|
|
8119
|
+
return Object.freeze({ verdict: "card", fields: Object.freeze(fields) });
|
|
8120
|
+
}
|
|
8121
|
+
var paystack_default = /* @__PURE__ */ registerProcessor({
|
|
8122
|
+
psp: PAYSTACK_PSP,
|
|
8123
|
+
definitions: [
|
|
8124
|
+
{
|
|
8125
|
+
psp: "paystack",
|
|
8126
|
+
// The card page's charge, as the header above reads it. Live and test transactions share standard.paystack.co,
|
|
8127
|
+
// so no sandbox host is listed and no environment is pinned. Ships dark: served only to a client that declares
|
|
8128
|
+
// `paystack_pinned_key`, and only for a company the backend's processor gate turns Paystack on for.
|
|
8129
|
+
// `(?![\w/.%?#-])` ends the path for a consumer that tests `match` unanchored; the exact-URL rule takes no query.
|
|
8130
|
+
capability: "paystack_pinned_key",
|
|
8131
|
+
match: "standard\\.paystack\\.co/charge/(?![\\w/.%?#-])",
|
|
8132
|
+
hosts: ["^standard\\.paystack\\.co$"],
|
|
8133
|
+
encoding: "form",
|
|
8134
|
+
// The browser's language rides as the page sent it; Origin, Referer and cookies never do (the page sends no cookie).
|
|
8135
|
+
passthroughHeaders: ["^accept-language$"],
|
|
8136
|
+
cardFields: ["clientdata"]
|
|
8137
|
+
}
|
|
8138
|
+
],
|
|
8139
|
+
// Only the cardholder's device sends this charge, after a person approves; no reviewed list names paystack.
|
|
8140
|
+
refusedOperations: [PAYSTACK_OPERATION],
|
|
8141
|
+
// Not surveyed: reading a charge back takes the merchant's secret key, which Agentcard never holds.
|
|
8142
|
+
settlementReadback: "not_surveyed",
|
|
8143
|
+
exactUrl: isPaystackChargeUrl,
|
|
8144
|
+
bodyGate: (url, body) => url !== void 0 && !isPaystackChargeUrl(url) ? refuse45("paystack_url_refused") : paystackBodyVerdict(body),
|
|
8145
|
+
// No amount reader: the charge names none, so the agent's pair is the figure the cardholder approves.
|
|
8146
|
+
limitations: ["The charge names no merchant and no amount: Paystack's transaction binds both, so the cardholder approves the agent's figure for whichever Paystack merchant opened the checkout."]
|
|
8147
|
+
});
|
|
6937
8148
|
// src/processors/processout.js
|
|
6938
8149
|
var PROCESSOUT_PSP = "processout";
|
|
6939
8150
|
var PROCESSOUT_OPERATION = "processout.card_request";
|
|
6940
|
-
var
|
|
6941
|
-
var
|
|
8151
|
+
var URL_LIMIT17 = 512;
|
|
8152
|
+
var BODY_LIMIT45 = 4096;
|
|
6942
8153
|
var CARD_URL2 = /^https:\/\/api\.processout\.com\/cards\?legacyrequest=true&project_id=((?:test-)?proj_[A-Za-z0-9]{16,64})&x-Content-Type=application\/json&x-API-Version=1\.3\.0\.0&x-Authorization=Basic%20([A-Za-z0-9+/]{4,256}={0,2})$/;
|
|
6943
8154
|
var PAGE_KEYS2 = /* @__PURE__ */ Object.freeze(["name", "contact", "preferred_scheme"]);
|
|
6944
8155
|
var CONTACT_KEYS = /* @__PURE__ */ Object.freeze(["address1", "address2", "city", "state", "country_code", "zip"]);
|
|
@@ -6953,31 +8164,31 @@ var DEVICE_KEYS4 = /* @__PURE__ */ Object.freeze([
|
|
|
6953
8164
|
]);
|
|
6954
8165
|
var PROCESSOUT_CARD_KEYS = /* @__PURE__ */ Object.freeze(["number", "exp_month", "exp_year", "cvc2"]);
|
|
6955
8166
|
var BODY_KEYS3 = /* @__PURE__ */ new Set([...PAGE_KEYS2, "device", ...DEVICE_KEYS4, ...PROCESSOUT_CARD_KEYS]);
|
|
6956
|
-
var
|
|
6957
|
-
var
|
|
6958
|
-
var
|
|
6959
|
-
var
|
|
8167
|
+
var NUMBER10 = /^[0-9]{12,19}$/;
|
|
8168
|
+
var MONTH23 = /^(?:[1-9]|1[0-2])$/;
|
|
8169
|
+
var YEAR24 = /^20[0-9]{2}$/;
|
|
8170
|
+
var CODE9 = /^[0-9]{3,4}$/;
|
|
6960
8171
|
var TEXT_LIMIT14 = 256;
|
|
6961
8172
|
var SCHEME = /^[A-Za-z][A-Za-z0-9 _-]{0,31}$/;
|
|
6962
8173
|
var LANGUAGE5 = /^[A-Za-z]{1,8}(?:-[A-Za-z0-9]{1,8}){0,4}$/;
|
|
6963
8174
|
var PAN_LIKE7 = /(?:[0-9][^0-9A-Za-z]*){12,}/;
|
|
6964
|
-
var
|
|
6965
|
-
var
|
|
6966
|
-
var
|
|
6967
|
-
var
|
|
6968
|
-
var
|
|
6969
|
-
function base64Of(
|
|
8175
|
+
var record38 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
8176
|
+
var own20 = (value, key) => Object.prototype.hasOwnProperty.call(value, key);
|
|
8177
|
+
var refuse46 = (code) => Object.freeze({ verdict: "refuse", code });
|
|
8178
|
+
var CARD45 = /* @__PURE__ */ Object.freeze({ verdict: "card" });
|
|
8179
|
+
var BASE647 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
8180
|
+
function base64Of(text10) {
|
|
6970
8181
|
let out = "";
|
|
6971
|
-
for (let at = 0; at <
|
|
6972
|
-
const a =
|
|
6973
|
-
const b = at + 1 <
|
|
6974
|
-
const c = at + 2 <
|
|
6975
|
-
out +=
|
|
8182
|
+
for (let at = 0; at < text10.length; at += 3) {
|
|
8183
|
+
const a = text10.charCodeAt(at);
|
|
8184
|
+
const b = at + 1 < text10.length ? text10.charCodeAt(at + 1) : NaN;
|
|
8185
|
+
const c = at + 2 < text10.length ? text10.charCodeAt(at + 2) : NaN;
|
|
8186
|
+
out += BASE647[a >> 2] + BASE647[(a & 3) << 4 | (Number.isNaN(b) ? 0 : b >> 4)] + (Number.isNaN(b) ? "=" : BASE647[(b & 15) << 2 | (Number.isNaN(c) ? 0 : c >> 6)]) + (Number.isNaN(c) ? "=" : BASE647[c & 63]);
|
|
6976
8187
|
}
|
|
6977
8188
|
return out;
|
|
6978
8189
|
}
|
|
6979
8190
|
var basicOf = (projectId) => base64Of(`${projectId}:`);
|
|
6980
|
-
function
|
|
8191
|
+
function luhn12(digits3) {
|
|
6981
8192
|
let sum = 0;
|
|
6982
8193
|
for (let at = 0; at < digits3.length; at += 1) {
|
|
6983
8194
|
let digit = Number(digits3[digits3.length - 1 - at]);
|
|
@@ -6991,7 +8202,7 @@ function luhn10(digits3) {
|
|
|
6991
8202
|
return sum % 10 === 0;
|
|
6992
8203
|
}
|
|
6993
8204
|
function processoutCardTarget(url) {
|
|
6994
|
-
if (typeof url !== "string" || url.length >
|
|
8205
|
+
if (typeof url !== "string" || url.length > URL_LIMIT17)
|
|
6995
8206
|
return null;
|
|
6996
8207
|
const match = CARD_URL2.exec(url);
|
|
6997
8208
|
if (!match || match[2] !== basicOf(match[1]))
|
|
@@ -7001,12 +8212,12 @@ function processoutCardTarget(url) {
|
|
|
7001
8212
|
function isProcessoutCardUrl(url) {
|
|
7002
8213
|
return processoutCardTarget(url) !== null;
|
|
7003
8214
|
}
|
|
7004
|
-
function
|
|
7005
|
-
if (typeof body !== "string" || body === "" || body.length >
|
|
8215
|
+
function readBody28(body) {
|
|
8216
|
+
if (typeof body !== "string" || body === "" || body.length > BODY_LIMIT45)
|
|
7006
8217
|
return null;
|
|
7007
8218
|
try {
|
|
7008
8219
|
const value = JSON.parse(body);
|
|
7009
|
-
return
|
|
8220
|
+
return record38(value) && JSON.stringify(value) === body ? value : null;
|
|
7010
8221
|
}
|
|
7011
8222
|
catch {
|
|
7012
8223
|
return null;
|
|
@@ -7024,31 +8235,31 @@ var DEVICE_RULES = /* @__PURE__ */ Object.freeze({
|
|
|
7024
8235
|
});
|
|
7025
8236
|
function soundDevice3(value) {
|
|
7026
8237
|
const device = value.device;
|
|
7027
|
-
if (!
|
|
8238
|
+
if (!record38(device) || !own20(device, "request_origin") || !own20(device, "app_timezone_offset"))
|
|
7028
8239
|
return false;
|
|
7029
|
-
return DEVICE_KEYS4.every((key) =>
|
|
8240
|
+
return DEVICE_KEYS4.every((key) => own20(device, key) ? DEVICE_RULES[key](device[key]) && own20(value, key) && value[key] === device[key] : !own20(value, key)) && Object.keys(device).every((key) => DEVICE_KEYS4.includes(key));
|
|
7030
8241
|
}
|
|
7031
8242
|
function soundPageData(value) {
|
|
7032
|
-
if (
|
|
8243
|
+
if (own20(value, "name") && !pageText2(value.name))
|
|
7033
8244
|
return false;
|
|
7034
|
-
if (
|
|
8245
|
+
if (own20(value, "preferred_scheme") && !(value.preferred_scheme === null || typeof value.preferred_scheme === "string" && SCHEME.test(value.preferred_scheme)))
|
|
7035
8246
|
return false;
|
|
7036
8247
|
const contact = value.contact;
|
|
7037
|
-
return
|
|
8248
|
+
return record38(contact) && Object.keys(contact).every((key) => CONTACT_KEYS.includes(key) && pageText2(contact[key]));
|
|
7038
8249
|
}
|
|
7039
8250
|
function processoutBodyVerdict(body, url) {
|
|
7040
8251
|
if (url !== void 0 && processoutCardTarget(url) === null)
|
|
7041
|
-
return
|
|
7042
|
-
const value =
|
|
8252
|
+
return refuse46("processout_url_refused");
|
|
8253
|
+
const value = readBody28(body);
|
|
7043
8254
|
if (value === null || !Object.keys(value).every((key) => BODY_KEYS3.has(key)))
|
|
7044
|
-
return
|
|
8255
|
+
return refuse46("processout_body_unsupported");
|
|
7045
8256
|
if (!PROCESSOUT_CARD_KEYS.every((key) => typeof value[key] === "string"))
|
|
7046
|
-
return
|
|
7047
|
-
if (!
|
|
7048
|
-
return
|
|
8257
|
+
return refuse46("processout_body_unsupported");
|
|
8258
|
+
if (!NUMBER10.test(value.number) || !luhn12(value.number) || !MONTH23.test(value.exp_month) || !YEAR24.test(value.exp_year) || !CODE9.test(value.cvc2))
|
|
8259
|
+
return refuse46("processout_body_unsupported");
|
|
7049
8260
|
if (!soundPageData(value) || !soundDevice3(value))
|
|
7050
|
-
return
|
|
7051
|
-
return
|
|
8261
|
+
return refuse46("processout_body_unsupported");
|
|
8262
|
+
return CARD45;
|
|
7052
8263
|
}
|
|
7053
8264
|
var processout_default = /* @__PURE__ */ registerProcessor({
|
|
7054
8265
|
psp: PROCESSOUT_PSP,
|
|
@@ -7091,17 +8302,17 @@ var USAEPAY_HOSTS = /* @__PURE__ */ Object.freeze({
|
|
|
7091
8302
|
"sandbox.usaepay.com": "sandbox"
|
|
7092
8303
|
});
|
|
7093
8304
|
var USAEPAY_PAYMENT_KEYS_PATH = "/api/v2/pub/payment_keys";
|
|
7094
|
-
var
|
|
7095
|
-
var
|
|
7096
|
-
var
|
|
8305
|
+
var BODY_LIMIT46 = 512;
|
|
8306
|
+
var URL_LIMIT18 = 256;
|
|
8307
|
+
var CARD_NUMBER22 = /^[0-9]{13,19}$/;
|
|
7097
8308
|
var EXPIRATION2 = /^(?:0[1-9]|1[0-2])[0-9]{2}$/;
|
|
7098
|
-
var
|
|
7099
|
-
var
|
|
7100
|
-
var
|
|
7101
|
-
var
|
|
7102
|
-
var
|
|
8309
|
+
var SECURITY_CODE26 = /^(?:[0-9]{3,4})?$/;
|
|
8310
|
+
var record39 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
8311
|
+
var own21 = (value, key) => Object.prototype.hasOwnProperty.call(value, key);
|
|
8312
|
+
var refuse47 = (code) => Object.freeze({ verdict: "refuse", code });
|
|
8313
|
+
var CARD46 = /* @__PURE__ */ Object.freeze({ verdict: "card" });
|
|
7103
8314
|
function usaepayPaymentKeysUrl(url) {
|
|
7104
|
-
if (typeof url !== "string" || url.length >
|
|
8315
|
+
if (typeof url !== "string" || url.length > URL_LIMIT18 || url.includes("?") || url.includes("#"))
|
|
7105
8316
|
return null;
|
|
7106
8317
|
let parsed;
|
|
7107
8318
|
try {
|
|
@@ -7110,12 +8321,12 @@ function usaepayPaymentKeysUrl(url) {
|
|
|
7110
8321
|
catch {
|
|
7111
8322
|
return null;
|
|
7112
8323
|
}
|
|
7113
|
-
if (parsed.href !== url || parsed.protocol !== "https:" || parsed.port || parsed.username || parsed.password || !
|
|
8324
|
+
if (parsed.href !== url || parsed.protocol !== "https:" || parsed.port || parsed.username || parsed.password || !own21(USAEPAY_HOSTS, parsed.hostname) || parsed.pathname !== USAEPAY_PAYMENT_KEYS_PATH)
|
|
7114
8325
|
return null;
|
|
7115
8326
|
return Object.freeze({ host: parsed.hostname, environment: USAEPAY_HOSTS[parsed.hostname] });
|
|
7116
8327
|
}
|
|
7117
8328
|
var isUsaepayPaymentKeysUrl = (url) => usaepayPaymentKeysUrl(url) !== null;
|
|
7118
|
-
function
|
|
8329
|
+
function luhn13(digits3) {
|
|
7119
8330
|
let sum = 0;
|
|
7120
8331
|
for (let at = digits3.length - 1, double = false; at >= 0; at -= 1, double = !double) {
|
|
7121
8332
|
let digit = digits3.charCodeAt(at) - 48;
|
|
@@ -7125,23 +8336,23 @@ function luhn11(digits3) {
|
|
|
7125
8336
|
}
|
|
7126
8337
|
return sum % 10 === 0;
|
|
7127
8338
|
}
|
|
7128
|
-
function
|
|
7129
|
-
if (typeof body !== "string" || body === "" || body.length >
|
|
8339
|
+
function readBody29(body) {
|
|
8340
|
+
if (typeof body !== "string" || body === "" || body.length > BODY_LIMIT46)
|
|
7130
8341
|
return null;
|
|
7131
8342
|
try {
|
|
7132
8343
|
const value = JSON.parse(body);
|
|
7133
|
-
return
|
|
8344
|
+
return record39(value) && JSON.stringify(value) === body ? value : null;
|
|
7134
8345
|
}
|
|
7135
8346
|
catch {
|
|
7136
8347
|
return null;
|
|
7137
8348
|
}
|
|
7138
8349
|
}
|
|
7139
8350
|
function usaepayBodyVerdict(body) {
|
|
7140
|
-
const value =
|
|
8351
|
+
const value = readBody29(body);
|
|
7141
8352
|
const card = value === null ? null : value.creditcard;
|
|
7142
|
-
if (value === null || Object.keys(value).join() !== "creditcard" || !
|
|
7143
|
-
return
|
|
7144
|
-
return
|
|
8353
|
+
if (value === null || Object.keys(value).join() !== "creditcard" || !record39(card) || Object.keys(card).join() !== "number,expiration,cvc" || typeof card.number !== "string" || !CARD_NUMBER22.test(card.number) || !luhn13(card.number) || typeof card.expiration !== "string" || !EXPIRATION2.test(card.expiration) || typeof card.cvc !== "string" || !SECURITY_CODE26.test(card.cvc))
|
|
8354
|
+
return refuse47("usaepay_body_unsupported");
|
|
8355
|
+
return CARD46;
|
|
7145
8356
|
}
|
|
7146
8357
|
var usaepay_default = /* @__PURE__ */ registerProcessor({
|
|
7147
8358
|
psp: USAEPAY_PSP,
|
|
@@ -7173,9 +8384,204 @@ var usaepay_default = /* @__PURE__ */ registerProcessor({
|
|
|
7173
8384
|
source: "https://help.usaepay.info/developer/payjs-v2/ , https://help.usaepay.info/api/rest/"
|
|
7174
8385
|
},
|
|
7175
8386
|
exactUrl: isUsaepayPaymentKeysUrl,
|
|
7176
|
-
bodyGate: (url, body) => url !== void 0 && !isUsaepayPaymentKeysUrl(url) ?
|
|
8387
|
+
bodyGate: (url, body) => url !== void 0 && !isUsaepayPaymentKeysUrl(url) ? refuse47("usaepay_url_refused") : usaepayBodyVerdict(body)
|
|
7177
8388
|
// No amount reader: the request names none, so the agent's pair is the figure the cardholder approves.
|
|
7178
8389
|
});
|
|
8390
|
+
// src/processors/viva_wallet.js
|
|
8391
|
+
var VIVA_WALLET_PSP = "viva_wallet";
|
|
8392
|
+
var VIVA_WALLET_OPERATION = "viva_wallet.card_request";
|
|
8393
|
+
var VIVA_WALLET_HOSTS = /* @__PURE__ */ Object.freeze({ "www.vivapayments.com": "production", "demo.vivapayments.com": "sandbox" });
|
|
8394
|
+
var VIVA_WALLET_CHARGE_TOKENS_PATH = "/web2/checkout/v2/chargetokens";
|
|
8395
|
+
var VIVA_WALLET_BODY_KEYS = /* @__PURE__ */ Object.freeze([
|
|
8396
|
+
"orderCode",
|
|
8397
|
+
"amount",
|
|
8398
|
+
"currencyCode",
|
|
8399
|
+
"holderName",
|
|
8400
|
+
"holderMail",
|
|
8401
|
+
"cvc",
|
|
8402
|
+
"number",
|
|
8403
|
+
"expirationMonth",
|
|
8404
|
+
"expirationYear",
|
|
8405
|
+
"installments",
|
|
8406
|
+
"customer",
|
|
8407
|
+
"rememberCard",
|
|
8408
|
+
"friendlyName",
|
|
8409
|
+
"maskedNumber",
|
|
8410
|
+
"bankId",
|
|
8411
|
+
"selectedBrand",
|
|
8412
|
+
"cardholderBrandSelection",
|
|
8413
|
+
"dccOptions",
|
|
8414
|
+
"dccAccepted",
|
|
8415
|
+
"offerCodes",
|
|
8416
|
+
"loyaltySupported",
|
|
8417
|
+
"redeemedAmount",
|
|
8418
|
+
"retrievalReferenceNumber",
|
|
8419
|
+
"scaRequestedTransactionId",
|
|
8420
|
+
"merchantTrns",
|
|
8421
|
+
"captchaToken"
|
|
8422
|
+
]);
|
|
8423
|
+
var BODY_LIMIT47 = 16384;
|
|
8424
|
+
var URL_LIMIT19 = 256;
|
|
8425
|
+
var ORDER_CODE = /^[0-9]{16}$/;
|
|
8426
|
+
var CARD_NUMBER23 = /^[0-9]{13,19}$/;
|
|
8427
|
+
var MONTH24 = /^(?:0[1-9]|1[0-2])$/;
|
|
8428
|
+
var YEAR25 = /^[0-9]{2}$/;
|
|
8429
|
+
var SECURITY_CODE27 = /^[0-9]{3,4}$/;
|
|
8430
|
+
var CAPTCHA_TOKEN = /^[A-Za-z0-9_.-]{20,8192}$/;
|
|
8431
|
+
var MEMBER_NAME = /^[A-Za-z][A-Za-z0-9]{0,31}$/;
|
|
8432
|
+
var SHORT_ID = /^[A-Za-z0-9_-]{1,64}$/;
|
|
8433
|
+
var TEXT4 = /^[^\u0000-\u001f\u007f]{0,200}$/;
|
|
8434
|
+
var CARD_DIGITS2 = /[0-9]{12,}/;
|
|
8435
|
+
var record40 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
8436
|
+
var own22 = (value, key) => Object.prototype.hasOwnProperty.call(value, key);
|
|
8437
|
+
var refuse48 = (code) => Object.freeze({ verdict: "refuse", code });
|
|
8438
|
+
var CARD47 = /* @__PURE__ */ Object.freeze({ verdict: "card" });
|
|
8439
|
+
var inOrder9 = (value, keys) => {
|
|
8440
|
+
let at = 0;
|
|
8441
|
+
for (const name of Object.keys(value)) {
|
|
8442
|
+
while (at < keys.length && keys[at] !== name)
|
|
8443
|
+
at += 1;
|
|
8444
|
+
if (at === keys.length)
|
|
8445
|
+
return false;
|
|
8446
|
+
at += 1;
|
|
8447
|
+
}
|
|
8448
|
+
return true;
|
|
8449
|
+
};
|
|
8450
|
+
var cardDigits2 = (text10) => CARD_DIGITS2.test(text10.replace(/[^0-9A-Za-z]/g, ""));
|
|
8451
|
+
var plainText8 = (value) => typeof value === "string" && TEXT4.test(value) && !cardDigits2(value);
|
|
8452
|
+
var scalar = (value) => value === null || typeof value === "boolean" || Number.isSafeInteger(value) && Math.abs(value) < 1e9 || plainText8(value);
|
|
8453
|
+
var flatRecord = (value, limit) => record40(value) && Object.keys(value).length <= limit && Object.entries(value).every(([key, item]) => MEMBER_NAME.test(key) && scalar(item));
|
|
8454
|
+
function vivaWalletChargeTokensUrl(url) {
|
|
8455
|
+
if (typeof url !== "string" || url.length > URL_LIMIT19 || url.includes("?") || url.includes("#"))
|
|
8456
|
+
return null;
|
|
8457
|
+
let parsed;
|
|
8458
|
+
try {
|
|
8459
|
+
parsed = new URL(url);
|
|
8460
|
+
}
|
|
8461
|
+
catch {
|
|
8462
|
+
return null;
|
|
8463
|
+
}
|
|
8464
|
+
if (parsed.href !== url || parsed.protocol !== "https:" || parsed.port || parsed.username || parsed.password || !own22(VIVA_WALLET_HOSTS, parsed.hostname) || parsed.pathname !== VIVA_WALLET_CHARGE_TOKENS_PATH)
|
|
8465
|
+
return null;
|
|
8466
|
+
return Object.freeze({ host: parsed.hostname, environment: VIVA_WALLET_HOSTS[parsed.hostname] });
|
|
8467
|
+
}
|
|
8468
|
+
var isVivaWalletChargeTokensUrl = (url) => vivaWalletChargeTokensUrl(url) !== null;
|
|
8469
|
+
function luhn14(digits3) {
|
|
8470
|
+
let sum = 0;
|
|
8471
|
+
for (let at = digits3.length - 1, double = false; at >= 0; at -= 1, double = !double) {
|
|
8472
|
+
let digit = digits3.charCodeAt(at) - 48;
|
|
8473
|
+
if (double)
|
|
8474
|
+
digit = digit * 2 > 9 ? digit * 2 - 9 : digit * 2;
|
|
8475
|
+
sum += digit;
|
|
8476
|
+
}
|
|
8477
|
+
return sum % 10 === 0;
|
|
8478
|
+
}
|
|
8479
|
+
function vivaWalletMaskedNumber(number) {
|
|
8480
|
+
return `${number.slice(0, 6)}${"X".repeat(Math.max(0, number.length - 10))}${number.slice(-4)}`;
|
|
8481
|
+
}
|
|
8482
|
+
function readBody30(body) {
|
|
8483
|
+
if (typeof body !== "string" || body === "" || body.length > BODY_LIMIT47)
|
|
8484
|
+
return null;
|
|
8485
|
+
try {
|
|
8486
|
+
const value = JSON.parse(body);
|
|
8487
|
+
return record40(value) && JSON.stringify(value) === body ? value : null;
|
|
8488
|
+
}
|
|
8489
|
+
catch {
|
|
8490
|
+
return null;
|
|
8491
|
+
}
|
|
8492
|
+
}
|
|
8493
|
+
function currencyNumber(value) {
|
|
8494
|
+
if (Number.isSafeInteger(value) && value > 0 && value < 1e3)
|
|
8495
|
+
return value;
|
|
8496
|
+
return typeof value === "string" && /^[0-9]{3}$/.test(value) ? Number(value) : null;
|
|
8497
|
+
}
|
|
8498
|
+
function vivaWalletBodyVerdict(body) {
|
|
8499
|
+
const value = readBody30(body);
|
|
8500
|
+
if (value === null || !Object.keys(value).every((key) => VIVA_WALLET_BODY_KEYS.includes(key))) {
|
|
8501
|
+
return value !== null && (own22(value, "creditCardId") || own22(value, "token")) ? refuse48("viva_wallet_stored_card") : refuse48("viva_wallet_body_unsupported");
|
|
8502
|
+
}
|
|
8503
|
+
if (value.rememberCard !== false)
|
|
8504
|
+
return refuse48(value.rememberCard === true ? "viva_wallet_keep_on_file" : "viva_wallet_body_unsupported");
|
|
8505
|
+
if (value.dccAccepted === true)
|
|
8506
|
+
return refuse48("viva_wallet_currency_conversion");
|
|
8507
|
+
if (own22(value, "dccAccepted") && value.dccAccepted !== false)
|
|
8508
|
+
return refuse48("viva_wallet_body_unsupported");
|
|
8509
|
+
if (own22(value, "scaRequestedTransactionId"))
|
|
8510
|
+
return refuse48("viva_wallet_retry_refused");
|
|
8511
|
+
if (!(value.installments === 0 || value.installments === 1)) {
|
|
8512
|
+
return refuse48(Number.isSafeInteger(value.installments) && value.installments > 1 ? "viva_wallet_installments" : "viva_wallet_body_unsupported");
|
|
8513
|
+
}
|
|
8514
|
+
if (!inOrder9(value, VIVA_WALLET_BODY_KEYS) || ["offerCodes", "loyaltySupported", "redeemedAmount", "retrievalReferenceNumber", "merchantTrns"].some((key) => own22(value, key)))
|
|
8515
|
+
return refuse48("viva_wallet_body_unsupported");
|
|
8516
|
+
const number = value.number;
|
|
8517
|
+
const sound = typeof value.orderCode === "string" && ORDER_CODE.test(value.orderCode) && Number.isSafeInteger(value.amount) && value.amount > 0 && currencyNumber(value.currencyCode) !== null && plainText8(value.holderName) && value.holderName.trim() !== "" && plainText8(value.holderMail) && (value.cvc === null || typeof value.cvc === "string" && SECURITY_CODE27.test(value.cvc)) && typeof number === "string" && CARD_NUMBER23.test(number) && luhn14(number) && typeof value.expirationMonth === "string" && MONTH24.test(value.expirationMonth) && typeof value.expirationYear === "string" && YEAR25.test(value.expirationYear) && flatRecord(value.customer, 12) && (!own22(value, "friendlyName") || plainText8(value.friendlyName)) && value.maskedNumber === vivaWalletMaskedNumber(number) && (!own22(value, "bankId") || typeof value.bankId === "string" && SHORT_ID.test(value.bankId) || Number.isSafeInteger(value.bankId) && value.bankId >= 0) && (!own22(value, "selectedBrand") || value.selectedBrand === null || flatRecord(value.selectedBrand, 16)) && (!own22(value, "cardholderBrandSelection") || typeof value.cardholderBrandSelection === "boolean") && (!own22(value, "dccOptions") || flatRecord(value.dccOptions, 16)) && (!own22(value, "captchaToken") || typeof value.captchaToken === "string" && CAPTCHA_TOKEN.test(value.captchaToken));
|
|
8518
|
+
return sound ? CARD47 : refuse48("viva_wallet_body_unsupported");
|
|
8519
|
+
}
|
|
8520
|
+
var VIVA_WALLET_CURRENCIES = /* @__PURE__ */ Object.freeze({
|
|
8521
|
+
978: "eur",
|
|
8522
|
+
826: "gbp",
|
|
8523
|
+
946: "ron",
|
|
8524
|
+
985: "pln",
|
|
8525
|
+
203: "czk",
|
|
8526
|
+
348: "huf",
|
|
8527
|
+
752: "sek",
|
|
8528
|
+
208: "dkk"
|
|
8529
|
+
});
|
|
8530
|
+
function vivaWalletAmount(body) {
|
|
8531
|
+
if (vivaWalletBodyVerdict(body).verdict !== "card")
|
|
8532
|
+
return null;
|
|
8533
|
+
const value = JSON.parse(body);
|
|
8534
|
+
const currency = VIVA_WALLET_CURRENCIES[currencyNumber(value.currencyCode)];
|
|
8535
|
+
return currency ? { amountCents: value.amount, currency } : null;
|
|
8536
|
+
}
|
|
8537
|
+
var VIVA_WALLET_MERCHANT_PINS = /* @__PURE__ */ Object.freeze([
|
|
8538
|
+
Object.freeze({
|
|
8539
|
+
id: "klimaka_donation",
|
|
8540
|
+
merchant: "Klimaka",
|
|
8541
|
+
tradeName: "ΚΛΙΜΑΚΑ ΑΜΚΕ",
|
|
8542
|
+
orderCodes: Object.freeze(["7871752880772607"]),
|
|
8543
|
+
origin: "https://www.vivapayments.com",
|
|
8544
|
+
currencyCode: 978
|
|
8545
|
+
}),
|
|
8546
|
+
Object.freeze({
|
|
8547
|
+
id: "desmos_donation",
|
|
8548
|
+
merchant: "Desmos",
|
|
8549
|
+
tradeName: "DESMOS",
|
|
8550
|
+
orderCodes: Object.freeze(["8156257435672606"]),
|
|
8551
|
+
origin: "https://www.vivapayments.com",
|
|
8552
|
+
currencyCode: 978
|
|
8553
|
+
})
|
|
8554
|
+
]);
|
|
8555
|
+
var CARD_MEMBERS = Object.freeze(["cvc", "number", "expirationMonth", "expirationYear", "maskedNumber"]);
|
|
8556
|
+
var viva_wallet_default = /* @__PURE__ */ registerProcessor({
|
|
8557
|
+
psp: VIVA_WALLET_PSP,
|
|
8558
|
+
definitions: [
|
|
8559
|
+
{
|
|
8560
|
+
psp: "viva_wallet",
|
|
8561
|
+
// The page's card request, as the header above reads it. demo.vivapayments.com is Viva's sandbox, pinned to test
|
|
8562
|
+
// rows, which send only Viva's documented test cards (hostEnvironmentPinned, device-replay.js S7).
|
|
8563
|
+
// Ships dark: served only to a client that declares `viva_smart_checkout_chargetoken`, and only for a company the
|
|
8564
|
+
// backend's processor gate turns Viva Wallet on for. `(?![\w/.%-])` ends the path for a consumer that tests `match`
|
|
8565
|
+
// unanchored.
|
|
8566
|
+
capability: "viva_smart_checkout_chargetoken",
|
|
8567
|
+
match: "(?:www|demo)\\.vivapayments\\.com/web2/checkout/v2/chargetokens(?![\\w/.%-])",
|
|
8568
|
+
hosts: ["^www\\.vivapayments\\.com$", "^demo\\.vivapayments\\.com$"],
|
|
8569
|
+
sandboxHosts: ["^demo\\.vivapayments\\.com$"],
|
|
8570
|
+
hostEnvironmentPinned: true,
|
|
8571
|
+
encoding: "json",
|
|
8572
|
+
// The page sends no Authorization; Origin, Referer, cookies and the reCAPTCHA state never ride.
|
|
8573
|
+
passthroughHeaders: [],
|
|
8574
|
+
jsonCardFields: [["number"]]
|
|
8575
|
+
}
|
|
8576
|
+
],
|
|
8577
|
+
// Only the cardholder's device sends this card, after a person approves; no reviewed list names viva_wallet.
|
|
8578
|
+
refusedOperations: [VIVA_WALLET_OPERATION],
|
|
8579
|
+
settlementReadback: "not_surveyed",
|
|
8580
|
+
exactUrl: isVivaWalletChargeTokensUrl,
|
|
8581
|
+
bodyGate: (url, body) => url !== void 0 && !isVivaWalletChargeTokensUrl(url) ? refuse48("viva_wallet_url_refused") : vivaWalletBodyVerdict(body),
|
|
8582
|
+
// The body names the order's amount in cents and its numeric currency, which the page's card-free charge repeats.
|
|
8583
|
+
amount: (template) => record40(template) && isVivaWalletChargeTokensUrl(template.url) ? vivaWalletAmount(template.body) : null
|
|
8584
|
+
});
|
|
7179
8585
|
// src/processors/vtex_payments.js
|
|
7180
8586
|
var VTEX_PAYMENTS_PSP = "vtex_payments";
|
|
7181
8587
|
var VTEX_PAYMENTS_OPERATION = "vtex_payments.card_request";
|
|
@@ -7224,27 +8630,27 @@ var VTEX_PAYMENTS_MERCHANT_PINS = /* @__PURE__ */ Object.freeze([
|
|
|
7224
8630
|
Object.freeze({ account: "alssports", origin: "https://www.als.com", merchant: "Al's Sporting Goods", currency: "USD" }),
|
|
7225
8631
|
Object.freeze({ account: "roadrunnersports", origin: "https://www.roadrunnersports.com", merchant: "Road Runner Sports", currency: "USD" })
|
|
7226
8632
|
]);
|
|
7227
|
-
var
|
|
8633
|
+
var BODY_LIMIT48 = 16384;
|
|
7228
8634
|
var ACCOUNT_HOST = /^([a-z0-9]{1,63})\.vtexvault\.com$/;
|
|
7229
8635
|
var PATH = /^\/api\/payments\/transactions\/([0-9A-Fa-f]{32})\/payments$/;
|
|
7230
8636
|
var ORDER_GROUP = /^[0-9]{6,24}$/;
|
|
7231
|
-
var
|
|
7232
|
-
var
|
|
7233
|
-
var
|
|
8637
|
+
var BASE648 = /^[A-Za-z0-9+/]{4,1020}={0,2}$/;
|
|
8638
|
+
var CARD_NUMBER24 = /^[0-9]{12,19}$/;
|
|
8639
|
+
var SECURITY_CODE28 = /^[0-9]{3,4}$/;
|
|
7234
8640
|
var DUE_DATE = /^(?:0[1-9]|1[0-2])\/[0-9]{2}$/;
|
|
7235
|
-
var
|
|
8641
|
+
var CURRENCY7 = /^[A-Z]{3}$/;
|
|
7236
8642
|
var TRANSACTION_ID = /^[0-9A-Fa-f]{32}$/;
|
|
7237
8643
|
var MERCHANT_NAME = /^[A-Za-z0-9_.-]{1,64}$/;
|
|
7238
|
-
var
|
|
8644
|
+
var SHORT_ID2 = /^[A-Za-z0-9_-]{1,64}$/;
|
|
7239
8645
|
var FINGERPRINT4 = /^[A-Za-z0-9_.:=+/-]{1,256}$/;
|
|
7240
|
-
var
|
|
7241
|
-
var
|
|
8646
|
+
var TEXT5 = /^[^\u0000-\u001f\u007f]{1,200}$/;
|
|
8647
|
+
var CARD_DIGITS3 = /[0-9]{12,}/;
|
|
7242
8648
|
var DEVICE_INFO_KEYS = Object.freeze(["sw", "sh", "cd", "tz", "lang", "java", "sourceApplication"]);
|
|
7243
|
-
var
|
|
7244
|
-
var
|
|
7245
|
-
var
|
|
7246
|
-
var
|
|
7247
|
-
var
|
|
8649
|
+
var record41 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
8650
|
+
var own23 = (value, key) => Object.prototype.hasOwnProperty.call(value, key);
|
|
8651
|
+
var refuse49 = (code) => Object.freeze({ verdict: "refuse", code });
|
|
8652
|
+
var CARD48 = /* @__PURE__ */ Object.freeze({ verdict: "card" });
|
|
8653
|
+
var inOrder10 = (value, keys) => {
|
|
7248
8654
|
let at = 0;
|
|
7249
8655
|
for (const name of Object.keys(value)) {
|
|
7250
8656
|
while (at < keys.length && keys[at] !== name)
|
|
@@ -7255,8 +8661,8 @@ var inOrder8 = (value, keys) => {
|
|
|
7255
8661
|
}
|
|
7256
8662
|
return true;
|
|
7257
8663
|
};
|
|
7258
|
-
var
|
|
7259
|
-
var
|
|
8664
|
+
var cardDigits3 = (text10) => CARD_DIGITS3.test(text10.replace(/[^0-9A-Za-z]/g, ""));
|
|
8665
|
+
var plainText9 = (value) => typeof value === "string" && TEXT5.test(value) && !cardDigits3(value);
|
|
7260
8666
|
var count = (value) => Number.isSafeInteger(value) && value >= 0;
|
|
7261
8667
|
var BASE64_ALPHABET2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
7262
8668
|
function base64Text2(input) {
|
|
@@ -7280,10 +8686,10 @@ function base64Text2(input) {
|
|
|
7280
8686
|
}
|
|
7281
8687
|
return out;
|
|
7282
8688
|
}
|
|
7283
|
-
function deviceInfoSound(
|
|
7284
|
-
if (typeof
|
|
8689
|
+
function deviceInfoSound(text10) {
|
|
8690
|
+
if (typeof text10 !== "string" || !BASE648.test(text10))
|
|
7285
8691
|
return false;
|
|
7286
|
-
const decoded = base64Text2(
|
|
8692
|
+
const decoded = base64Text2(text10);
|
|
7287
8693
|
if (decoded === null)
|
|
7288
8694
|
return false;
|
|
7289
8695
|
let info;
|
|
@@ -7293,18 +8699,18 @@ function deviceInfoSound(text9) {
|
|
|
7293
8699
|
catch {
|
|
7294
8700
|
return false;
|
|
7295
8701
|
}
|
|
7296
|
-
if (!
|
|
8702
|
+
if (!record41(info) || !Object.keys(info).every((key) => DEVICE_INFO_KEYS.includes(key)))
|
|
7297
8703
|
return false;
|
|
7298
8704
|
for (const key of ["sw", "sh", "cd"])
|
|
7299
|
-
if (
|
|
8705
|
+
if (own23(info, key) && !(count(info[key]) && info[key] <= 1e5))
|
|
7300
8706
|
return false;
|
|
7301
|
-
if (
|
|
8707
|
+
if (own23(info, "tz") && !(Number.isSafeInteger(info.tz) && Math.abs(info.tz) <= 1440))
|
|
7302
8708
|
return false;
|
|
7303
|
-
if (
|
|
8709
|
+
if (own23(info, "lang") && !(typeof info.lang === "string" && /^[A-Za-z]{0,8}$/.test(info.lang)))
|
|
7304
8710
|
return false;
|
|
7305
|
-
if (
|
|
8711
|
+
if (own23(info, "java") && typeof info.java !== "boolean")
|
|
7306
8712
|
return false;
|
|
7307
|
-
return !
|
|
8713
|
+
return !own23(info, "sourceApplication") || typeof info.sourceApplication === "string" && /^[A-Za-z0-9_.-]{1,32}$/.test(info.sourceApplication);
|
|
7308
8714
|
}
|
|
7309
8715
|
function vtexPaymentsCardTarget(url) {
|
|
7310
8716
|
if (typeof url !== "string" || url.length > 8192)
|
|
@@ -7350,8 +8756,8 @@ function isVtexPaymentsCardUrl(url) {
|
|
|
7350
8756
|
const target = vtexPaymentsCardTarget(url);
|
|
7351
8757
|
return target !== null && !target.fallback;
|
|
7352
8758
|
}
|
|
7353
|
-
function
|
|
7354
|
-
if (typeof body !== "string" || body === "" || body.length >
|
|
8759
|
+
function readBody31(body) {
|
|
8760
|
+
if (typeof body !== "string" || body === "" || body.length > BODY_LIMIT48)
|
|
7355
8761
|
return null;
|
|
7356
8762
|
let value;
|
|
7357
8763
|
try {
|
|
@@ -7365,13 +8771,13 @@ function readBody26(body) {
|
|
|
7365
8771
|
return value;
|
|
7366
8772
|
}
|
|
7367
8773
|
function cardLine(line) {
|
|
7368
|
-
if (!
|
|
8774
|
+
if (!record41(line))
|
|
7369
8775
|
return false;
|
|
7370
|
-
const fields =
|
|
7371
|
-
return line.groupName === "creditCardPaymentGroup" || line.groupName === "debitCardPaymentGroup" ||
|
|
8776
|
+
const fields = record41(line.fields) ? line.fields : {};
|
|
8777
|
+
return line.groupName === "creditCardPaymentGroup" || line.groupName === "debitCardPaymentGroup" || own23(line, "accountId") || own23(fields, "accountId") || own23(fields, "cardNumber") || own23(fields, "validationCode") || own23(fields, "dueDate");
|
|
7372
8778
|
}
|
|
7373
8779
|
function addressSound(address2) {
|
|
7374
|
-
if (!
|
|
8780
|
+
if (!record41(address2) || !inOrder10(address2, VTEX_PAYMENTS_ADDRESS_KEYS))
|
|
7375
8781
|
return false;
|
|
7376
8782
|
for (const [key, value] of Object.entries(address2)) {
|
|
7377
8783
|
if (key === "addressType") {
|
|
@@ -7380,60 +8786,60 @@ function addressSound(address2) {
|
|
|
7380
8786
|
continue;
|
|
7381
8787
|
}
|
|
7382
8788
|
if (key === "addressId") {
|
|
7383
|
-
if (!(typeof value === "string" &&
|
|
8789
|
+
if (!(typeof value === "string" && SHORT_ID2.test(value)))
|
|
7384
8790
|
return false;
|
|
7385
8791
|
continue;
|
|
7386
8792
|
}
|
|
7387
8793
|
if (value === null && (key === "complement" || key === "reference"))
|
|
7388
8794
|
continue;
|
|
7389
|
-
if (!(value === "" ||
|
|
8795
|
+
if (!(value === "" || plainText9(value)))
|
|
7390
8796
|
return false;
|
|
7391
8797
|
}
|
|
7392
8798
|
return true;
|
|
7393
8799
|
}
|
|
7394
8800
|
function fieldsSound(fields) {
|
|
7395
|
-
if (!
|
|
8801
|
+
if (!record41(fields) || !inOrder10(fields, VTEX_PAYMENTS_FIELD_KEYS) || own23(fields, "metadata"))
|
|
7396
8802
|
return false;
|
|
7397
|
-
if (!(typeof fields.cardNumber === "string" &&
|
|
8803
|
+
if (!(typeof fields.cardNumber === "string" && CARD_NUMBER24.test(fields.cardNumber)))
|
|
7398
8804
|
return false;
|
|
7399
|
-
if (!(typeof fields.validationCode === "string" &&
|
|
8805
|
+
if (!(typeof fields.validationCode === "string" && SECURITY_CODE28.test(fields.validationCode)))
|
|
7400
8806
|
return false;
|
|
7401
8807
|
if (!(typeof fields.dueDate === "string" && DUE_DATE.test(fields.dueDate)))
|
|
7402
8808
|
return false;
|
|
7403
|
-
if (!
|
|
8809
|
+
if (!plainText9(fields.holderName))
|
|
7404
8810
|
return false;
|
|
7405
|
-
if (
|
|
8811
|
+
if (own23(fields, "document") && !(fields.document === "" || plainText9(fields.document) && fields.document.length <= 32))
|
|
7406
8812
|
return false;
|
|
7407
|
-
if (
|
|
8813
|
+
if (own23(fields, "address") && !addressSound(fields.address))
|
|
7408
8814
|
return false;
|
|
7409
|
-
if (
|
|
8815
|
+
if (own23(fields, "deviceFingerprint") && !(typeof fields.deviceFingerprint === "string" && FINGERPRINT4.test(fields.deviceFingerprint)))
|
|
7410
8816
|
return false;
|
|
7411
|
-
return !
|
|
8817
|
+
return !own23(fields, "addressId") || typeof fields.addressId === "string" && SHORT_ID2.test(fields.addressId);
|
|
7412
8818
|
}
|
|
7413
8819
|
function vtexPaymentsBodyVerdict(body, target) {
|
|
7414
|
-
const lines =
|
|
7415
|
-
if (lines === null || lines.length === 0 || !lines.every(
|
|
7416
|
-
return
|
|
8820
|
+
const lines = readBody31(body);
|
|
8821
|
+
if (lines === null || lines.length === 0 || !lines.every(record41))
|
|
8822
|
+
return refuse49("vtex_payments_body_unsupported");
|
|
7417
8823
|
const cards = lines.filter(cardLine);
|
|
7418
|
-
if (cards.some((line2) =>
|
|
7419
|
-
return
|
|
8824
|
+
if (cards.some((line2) => own23(line2, "accountId") || own23(line2.fields ?? {}, "accountId")))
|
|
8825
|
+
return refuse49("vtex_payments_saved_card");
|
|
7420
8826
|
if (cards.length === 0)
|
|
7421
|
-
return
|
|
7422
|
-
if (lines.length !== 1 ||
|
|
7423
|
-
return
|
|
8827
|
+
return refuse49("vtex_payments_body_unsupported");
|
|
8828
|
+
if (lines.length !== 1 || own23(lines[0], "id"))
|
|
8829
|
+
return refuse49("vtex_payments_split_payment");
|
|
7424
8830
|
const line = lines[0];
|
|
7425
|
-
if (!
|
|
7426
|
-
return
|
|
7427
|
-
if (!(typeof line.currencyCode === "string" &&
|
|
7428
|
-
return
|
|
7429
|
-
if (line.installments !== 1 || line.referenceValue !== line.value ||
|
|
7430
|
-
return
|
|
8831
|
+
if (!inOrder10(line, VTEX_PAYMENTS_LINE_KEYS) || line.groupName !== "creditCardPaymentGroup")
|
|
8832
|
+
return refuse49("vtex_payments_body_unsupported");
|
|
8833
|
+
if (!(typeof line.currencyCode === "string" && CURRENCY7.test(line.currencyCode)) || !own23(VTEX_PAYMENTS_NETWORKS, line.paymentSystem) || !Number.isSafeInteger(line.paymentSystem) || !(count(line.value) && line.value > 0))
|
|
8834
|
+
return refuse49("vtex_payments_body_unsupported");
|
|
8835
|
+
if (line.installments !== 1 || line.referenceValue !== line.value || own23(line, "installmentsInterestRate") && line.installmentsInterestRate !== 0 || own23(line, "installmentsValue") && line.installmentsValue !== line.value)
|
|
8836
|
+
return refuse49("vtex_payments_installments");
|
|
7431
8837
|
const transaction = line.transaction;
|
|
7432
|
-
if (!
|
|
7433
|
-
return
|
|
8838
|
+
if (!record41(transaction) || Object.keys(transaction).join() !== "id,merchantName" || !(typeof transaction.id === "string" && TRANSACTION_ID.test(transaction.id)) || !(typeof transaction.merchantName === "string" && MERCHANT_NAME.test(transaction.merchantName)))
|
|
8839
|
+
return refuse49("vtex_payments_body_unsupported");
|
|
7434
8840
|
if (target && transaction.id.toUpperCase() !== target.transactionId.toUpperCase())
|
|
7435
|
-
return
|
|
7436
|
-
return fieldsSound(line.fields) ?
|
|
8841
|
+
return refuse49("vtex_payments_split_payment");
|
|
8842
|
+
return fieldsSound(line.fields) ? CARD48 : refuse49("vtex_payments_body_unsupported");
|
|
7437
8843
|
}
|
|
7438
8844
|
function vtexPaymentsAmount(body) {
|
|
7439
8845
|
if (vtexPaymentsBodyVerdict(body).verdict !== "card")
|
|
@@ -7478,21 +8884,29 @@ var vtex_payments_default = /* @__PURE__ */ registerProcessor({
|
|
|
7478
8884
|
return vtexPaymentsBodyVerdict(body);
|
|
7479
8885
|
const target = vtexPaymentsCardTarget(url);
|
|
7480
8886
|
if (target === null)
|
|
7481
|
-
return
|
|
7482
|
-
return target.fallback ?
|
|
8887
|
+
return refuse49("vtex_payments_url_refused");
|
|
8888
|
+
return target.fallback ? refuse49("vtex_payments_fallback_refused") : vtexPaymentsBodyVerdict(body, target);
|
|
7483
8889
|
},
|
|
7484
|
-
amount: (template) =>
|
|
8890
|
+
amount: (template) => record41(template) && isVtexPaymentsCardUrl(template.url) ? vtexPaymentsAmount(template.body) : null
|
|
7485
8891
|
});
|
|
7486
8892
|
// src/processors/index.generated.js
|
|
7487
8893
|
var REGISTERED_MODULES = Object.freeze({
|
|
8894
|
+
aurus: aurus_default,
|
|
8895
|
+
bigcommerce: bigcommerce_default,
|
|
7488
8896
|
bluesnap: bluesnap_default,
|
|
8897
|
+
cardlink_vpos: cardlink_vpos_default,
|
|
8898
|
+
eghl: eghl_default,
|
|
8899
|
+
frisbii: frisbii_default,
|
|
7489
8900
|
iyzico: iyzico_default,
|
|
7490
8901
|
midtrans: midtrans_default,
|
|
8902
|
+
monei: monei_default,
|
|
7491
8903
|
oceanpayment: oceanpayment_default,
|
|
7492
8904
|
paymentwall: paymentwall_default,
|
|
7493
8905
|
payplug: payplug_default,
|
|
8906
|
+
paystack: paystack_default,
|
|
7494
8907
|
processout: processout_default,
|
|
7495
8908
|
usaepay: usaepay_default,
|
|
8909
|
+
viva_wallet: viva_wallet_default,
|
|
7496
8910
|
vtex_payments: vtex_payments_default
|
|
7497
8911
|
});
|
|
7498
8912
|
// src/registry.js
|
|
@@ -7681,7 +9095,7 @@ function carriesCardFields(recognizer, body) {
|
|
|
7681
9095
|
if (typeof body !== "string" || body === "")
|
|
7682
9096
|
return false;
|
|
7683
9097
|
const anyCase = recognizer.caseInsensitiveFormKeys === true;
|
|
7684
|
-
const wanted = anyCase ? fields.map((
|
|
9098
|
+
const wanted = anyCase ? fields.map((field5) => String(field5).toLowerCase()) : fields;
|
|
7685
9099
|
for (const chunk of body.split("&")) {
|
|
7686
9100
|
const eq = chunk.indexOf("=");
|
|
7687
9101
|
if (eq <= 0 || eq === chunk.length - 1)
|
|
@@ -7773,12 +9187,12 @@ function splitCardLeg(recognizer, body) {
|
|
|
7773
9187
|
const absorb = list(split.absorb);
|
|
7774
9188
|
const pass = list(split.pass);
|
|
7775
9189
|
const sibling = list(split.siblingKeys);
|
|
7776
|
-
const
|
|
7777
|
-
if (
|
|
9190
|
+
const own24 = keys.filter((key) => !sibling.includes(key));
|
|
9191
|
+
if (own24.length === 0)
|
|
7778
9192
|
return null;
|
|
7779
|
-
if (
|
|
9193
|
+
if (own24.every((key) => absorb.includes(key)))
|
|
7780
9194
|
return "absorb";
|
|
7781
|
-
if (
|
|
9195
|
+
if (own24.every((key) => pass.includes(key)))
|
|
7782
9196
|
return "pass";
|
|
7783
9197
|
return null;
|
|
7784
9198
|
}
|