@agent-cards/sdk 0.23.20 → 0.23.22
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 +55 -2
- package/PREFLIGHT.md +6 -0
- package/README.md +169 -5
- package/dist/amadeus-checkout.generated.d.ts +6 -1
- package/dist/amadeus-checkout.generated.js +26 -2
- package/dist/card-fields.generated.js +2341 -127
- package/dist/cdp.js +199 -28
- package/dist/client.d.ts +177 -9
- package/dist/client.js +387 -37
- package/dist/comgate.d.ts +50 -0
- package/dist/comgate.js +80 -0
- package/dist/creditguard.generated.js +4 -2
- package/dist/cse-body.js +11 -0
- package/dist/cybersource-secure-acceptance.generated.d.ts +1 -1
- package/dist/ebanx.d.ts +1 -1
- package/dist/ebanx.js +1 -1
- package/dist/eprotect.generated.d.ts +1 -1
- package/dist/eximbay.d.ts +46 -0
- package/dist/eximbay.js +69 -0
- package/dist/gmo.generated.js +7 -3
- package/dist/hipay.generated.d.ts +5 -5
- package/dist/hipay.generated.js +5 -2
- package/dist/hold.d.ts +1 -1
- package/dist/hold.js +10 -4
- package/dist/hosted-entry.d.ts +4 -0
- package/dist/hosted-entry.js +32 -0
- package/dist/index.d.ts +1 -0
- package/dist/lifecycle.d.ts +9 -4
- package/dist/lifecycle.js +16 -4
- package/dist/paddle-tokenex.generated.js +7 -3
- package/dist/paygent.generated.d.ts +60 -0
- package/dist/paygent.generated.js +425 -0
- package/dist/payrails.generated.js +7 -3
- package/dist/payrexx.d.ts +91 -0
- package/dist/payrexx.generated.d.ts +91 -0
- package/dist/payrexx.generated.js +536 -0
- package/dist/payrexx.js +141 -0
- package/dist/pre-claim.d.ts +30 -1
- package/dist/pre-claim.js +257 -39
- package/dist/preflight-catalog.json +58 -0
- package/dist/preflight-schemas.json +4 -0
- package/dist/preflight.generated.js +26 -2
- package/dist/prepared-processor.d.ts +7 -2
- package/dist/prepared-processor.js +16 -2
- package/dist/primer.generated.js +2469 -255
- package/dist/przelewy24.d.ts +47 -0
- package/dist/przelewy24.js +88 -0
- package/dist/registry.d.ts +6 -5
- package/dist/registry.js +27 -7
- package/dist/shiji-sts.generated.js +7 -3
- package/dist/stripe-checkout.generated.js +896 -19
- package/dist/toast-seal.generated.d.ts +37 -0
- package/dist/toast-seal.generated.js +625 -0
- package/dist/toast.generated.d.ts +41 -0
- package/dist/toast.generated.js +113 -0
- package/dist/tokenex-iframe.d.ts +93 -0
- package/dist/tokenex-iframe.generated.d.ts +81 -0
- package/dist/tokenex-iframe.generated.js +403 -0
- package/dist/tokenex-iframe.js +195 -0
- package/dist/transbank.d.ts +45 -0
- package/dist/transbank.js +73 -0
- package/dist/twoc2p.generated.js +7 -3
- package/examples/preflight/kernel-native/inventory.json +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
declare var PAYREXX_PSP: string;
|
|
2
|
+
declare var PAYREXX_CAPABILITY: string;
|
|
3
|
+
declare var PAYREXX_OPERATION: string;
|
|
4
|
+
declare var PAYREXX_FRAME_HOST: string;
|
|
5
|
+
declare var PAYREXX_PAY_PSP_ID: string;
|
|
6
|
+
declare var PAYREXX_BODY_KEYS: readonly string[];
|
|
7
|
+
declare var PAYREXX_REFUSAL_CODES: readonly string[];
|
|
8
|
+
declare function payrexxFrameTarget(url: any): Readonly<{
|
|
9
|
+
pspId: string;
|
|
10
|
+
lang: string;
|
|
11
|
+
}> | null;
|
|
12
|
+
declare function isPayrexxFrameUrl(url: any): boolean;
|
|
13
|
+
declare function payrexxBodyVerdict(body: any): Readonly<{
|
|
14
|
+
verdict: "refuse";
|
|
15
|
+
code: any;
|
|
16
|
+
}> | Readonly<{
|
|
17
|
+
verdict: "continue";
|
|
18
|
+
}> | Readonly<{
|
|
19
|
+
verdict: "card";
|
|
20
|
+
}>;
|
|
21
|
+
declare function payrexxGateVerdict(url: any, body: any): Readonly<{
|
|
22
|
+
verdict: "refuse";
|
|
23
|
+
code: any;
|
|
24
|
+
}> | Readonly<{
|
|
25
|
+
verdict: "continue";
|
|
26
|
+
}> | Readonly<{
|
|
27
|
+
verdict: "card";
|
|
28
|
+
}>;
|
|
29
|
+
declare function payrexxRequestRefusal(request: any): any;
|
|
30
|
+
declare function isPayrexxDeviceRequest(template: any, body: any): boolean;
|
|
31
|
+
declare function payrexxInstance(body: any): any;
|
|
32
|
+
declare var PAYREXX_REVIEWED_INSTANCES: readonly string[];
|
|
33
|
+
declare function payrexxInstanceRefusal(instance: any, instances?: readonly string[]): "payrexx_instance_unreviewed" | null;
|
|
34
|
+
declare function payrexxRequestAmount(body: any): Readonly<{
|
|
35
|
+
amountCents: number;
|
|
36
|
+
currency: any;
|
|
37
|
+
}> | null;
|
|
38
|
+
declare function injectPayrexxCard(body: any, card: any): {
|
|
39
|
+
body: string;
|
|
40
|
+
where: any[];
|
|
41
|
+
};
|
|
42
|
+
declare function payrexxAnswerOutcome(status: any, text: any, card: any): {
|
|
43
|
+
outcome: string;
|
|
44
|
+
code: string;
|
|
45
|
+
reason?: undefined;
|
|
46
|
+
body?: undefined;
|
|
47
|
+
pending?: undefined;
|
|
48
|
+
} | {
|
|
49
|
+
outcome: string;
|
|
50
|
+
reason: string;
|
|
51
|
+
code?: undefined;
|
|
52
|
+
body?: undefined;
|
|
53
|
+
pending?: undefined;
|
|
54
|
+
} | {
|
|
55
|
+
outcome: string;
|
|
56
|
+
body: string;
|
|
57
|
+
code?: undefined;
|
|
58
|
+
reason?: undefined;
|
|
59
|
+
pending?: undefined;
|
|
60
|
+
} | {
|
|
61
|
+
outcome: string;
|
|
62
|
+
body: string;
|
|
63
|
+
pending: string;
|
|
64
|
+
code?: undefined;
|
|
65
|
+
reason?: undefined;
|
|
66
|
+
};
|
|
67
|
+
declare function payrexxRefusalCode(text: any): "payrexx_declined" | "payrexx_three_ds_error" | "payrexx_three_ds_declined" | null;
|
|
68
|
+
declare var PAYREXX_FOLLOW_UP_KINDS: readonly string[];
|
|
69
|
+
declare var PAYREXX_FOLLOW_UP_LIMITS: Readonly<{
|
|
70
|
+
authentication: 1;
|
|
71
|
+
post_authentication: 1;
|
|
72
|
+
}>;
|
|
73
|
+
declare var PAYREXX_FOLLOW_UP_MAX: number;
|
|
74
|
+
declare var PAYREXX_FOLLOW_UP_WINDOW_MS: number;
|
|
75
|
+
declare var PAYREXX_FOLLOW_UP_IDLE_MS: number;
|
|
76
|
+
declare var PAYREXX_FOLLOW_UP_CHALLENGE_MS: number;
|
|
77
|
+
declare var PAYREXX_FOLLOW_UP_BODY_LIMIT: number;
|
|
78
|
+
declare var PAYREXX_FOLLOW_UP_ANSWER_LIMIT: number;
|
|
79
|
+
declare var PAYREXX_FOLLOW_UP_REFUSALS: readonly string[];
|
|
80
|
+
declare function payrexxFollowUpVerdict(input: any): Readonly<{
|
|
81
|
+
ok: false;
|
|
82
|
+
refusal: any;
|
|
83
|
+
}> | Readonly<{
|
|
84
|
+
ok: true;
|
|
85
|
+
kind: string | undefined;
|
|
86
|
+
slot: 1;
|
|
87
|
+
}>;
|
|
88
|
+
declare function payrexxFollowUpIdleMs(kind: any, answerText: any): number;
|
|
89
|
+
declare function payrexxFollowUpAnswerRefusal(answerText: any): "answer_unreadable" | "card_in_answer" | null;
|
|
90
|
+
declare function payrexxRefusalMessage(code: any): any;
|
|
91
|
+
export { PAYREXX_BODY_KEYS, PAYREXX_CAPABILITY, PAYREXX_FOLLOW_UP_ANSWER_LIMIT, PAYREXX_FOLLOW_UP_BODY_LIMIT, PAYREXX_FOLLOW_UP_CHALLENGE_MS, PAYREXX_FOLLOW_UP_IDLE_MS, PAYREXX_FOLLOW_UP_KINDS, PAYREXX_FOLLOW_UP_LIMITS, PAYREXX_FOLLOW_UP_MAX, PAYREXX_FOLLOW_UP_REFUSALS, PAYREXX_FOLLOW_UP_WINDOW_MS, PAYREXX_FRAME_HOST, PAYREXX_OPERATION, PAYREXX_PAY_PSP_ID, PAYREXX_PSP, PAYREXX_REFUSAL_CODES, PAYREXX_REVIEWED_INSTANCES, injectPayrexxCard, isPayrexxDeviceRequest, isPayrexxFrameUrl, payrexxAnswerOutcome, payrexxBodyVerdict, payrexxFollowUpAnswerRefusal, payrexxFollowUpIdleMs, payrexxFollowUpVerdict, payrexxFrameTarget, payrexxGateVerdict, payrexxInstance, payrexxInstanceRefusal, payrexxRefusalCode, payrexxRefusalMessage, payrexxRequestAmount, payrexxRequestRefusal };
|
|
@@ -0,0 +1,536 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
// Generated from @agent-cards/payment-core. Do not edit.
|
|
3
|
+
// artifact-sha256: 12336c60151bbdaa63f9d3e665fb53c8e3407ba942140bef2928e7ce3a8b3e2c
|
|
4
|
+
// src/payrexx.js
|
|
5
|
+
var PAYREXX_PSP = "payrexx";
|
|
6
|
+
var PAYREXX_CAPABILITY = "payrexx_card_frame";
|
|
7
|
+
var PAYREXX_OPERATION = "payrexx.card_request";
|
|
8
|
+
var PAYREXX_FRAME_HOST = "checkout.payrexx.com";
|
|
9
|
+
var PAYREXX_PAY_PSP_ID = "44";
|
|
10
|
+
var PAYREXX_BODY_KEYS = /* @__PURE__ */ Object.freeze([
|
|
11
|
+
"instance",
|
|
12
|
+
"pspId",
|
|
13
|
+
"card[number]",
|
|
14
|
+
"card[cardholder]",
|
|
15
|
+
"card[exp_month]",
|
|
16
|
+
"card[exp_year]",
|
|
17
|
+
"card[cvc]",
|
|
18
|
+
"card[brand]",
|
|
19
|
+
"amount",
|
|
20
|
+
"currency",
|
|
21
|
+
"isTokenization",
|
|
22
|
+
"isSubscription",
|
|
23
|
+
"isPreAuthorization",
|
|
24
|
+
"isMoto",
|
|
25
|
+
"email"
|
|
26
|
+
]);
|
|
27
|
+
var PAYREXX_REFUSAL_CODES = /* @__PURE__ */ Object.freeze([
|
|
28
|
+
"payrexx_url_refused",
|
|
29
|
+
"payrexx_headers_refused",
|
|
30
|
+
"payrexx_other_provider",
|
|
31
|
+
"payrexx_wallet_card",
|
|
32
|
+
"payrexx_three_ds_resend",
|
|
33
|
+
"payrexx_keep_on_file",
|
|
34
|
+
"payrexx_not_a_sale",
|
|
35
|
+
"payrexx_body_unsupported"
|
|
36
|
+
]);
|
|
37
|
+
var BODY_LIMIT = 16384;
|
|
38
|
+
var URL_LIMIT = 128;
|
|
39
|
+
var FRAME_QUERY = /^\?pspId=([1-9][0-9]{0,3})&lang=([a-z]{2})$/;
|
|
40
|
+
var GROUPED = /^[0-9]{4} [0-9]{4} [0-9]{4} [0-9]{4}$/;
|
|
41
|
+
var VISA = /^4[0-9]{15}$/;
|
|
42
|
+
var MASTERCARD = /^(?:5[1-5][0-9]{14}|2(?:2(?:2[1-9]|[3-9][0-9])|[3-6][0-9]{2}|7(?:[01][0-9]|20))[0-9]{12})$/;
|
|
43
|
+
var SECURITY_CODE = /^[0-9]{3}$/;
|
|
44
|
+
var MONTH = /^(?:0[1-9]|1[0-2])$/;
|
|
45
|
+
var YEAR = /^20[0-9]{2}$/;
|
|
46
|
+
var HOLDER = /^[\p{L}\p{M}][\p{L}\p{M} '.-]{0,44}$/u;
|
|
47
|
+
var INSTANCE = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/;
|
|
48
|
+
var AMOUNT = /^[1-9][0-9]{0,8}$/;
|
|
49
|
+
var CURRENCY = /^[A-Z]{3}$/;
|
|
50
|
+
var EMAIL = /^[^\s@]{1,64}@[^\s@]{1,189}$/;
|
|
51
|
+
var FLAGS = /* @__PURE__ */ Object.freeze(["isTokenization", "isSubscription", "isPreAuthorization", "isMoto"]);
|
|
52
|
+
var CARD_DIGITS = /[0-9](?:[ -]?[0-9]){11}/;
|
|
53
|
+
var THREE_DS_KEY = /^(?:threeDSServerTransID|threeDSVersion|postAuth|authData\[[A-Za-z]{1,32}\])$/;
|
|
54
|
+
var FORM_CONTENT_TYPE = /^application\/x-www-form-urlencoded(?:; ?charset=utf-8)?$/i;
|
|
55
|
+
var ACCEPT = /^[\x20-\x7e]{1,256}$/;
|
|
56
|
+
var record = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
57
|
+
var refuse = (code) => Object.freeze({ verdict: "refuse", code });
|
|
58
|
+
var CARD = /* @__PURE__ */ Object.freeze({ verdict: "card" });
|
|
59
|
+
var CONTINUE = /* @__PURE__ */ Object.freeze({ verdict: "continue" });
|
|
60
|
+
function payrexxFrameTarget(url) {
|
|
61
|
+
if (typeof url !== "string" || url.length > URL_LIMIT || url.includes("#"))
|
|
62
|
+
return null;
|
|
63
|
+
let parsed;
|
|
64
|
+
try {
|
|
65
|
+
parsed = new URL(url);
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
if (parsed.href !== url || parsed.protocol !== "https:" || parsed.port || parsed.username || parsed.password || parsed.hostname !== PAYREXX_FRAME_HOST || parsed.pathname !== "/")
|
|
71
|
+
return null;
|
|
72
|
+
const query = FRAME_QUERY.exec(parsed.search);
|
|
73
|
+
return query ? Object.freeze({ pspId: query[1], lang: query[2] }) : null;
|
|
74
|
+
}
|
|
75
|
+
function isPayrexxFrameUrl(url) {
|
|
76
|
+
return payrexxFrameTarget(url) !== null;
|
|
77
|
+
}
|
|
78
|
+
function readForm(body) {
|
|
79
|
+
if (typeof body !== "string" || body === "" || body.length > BODY_LIMIT)
|
|
80
|
+
return null;
|
|
81
|
+
try {
|
|
82
|
+
const pairs = body.split("&").map((chunk) => {
|
|
83
|
+
const eq = chunk.indexOf("=");
|
|
84
|
+
if (eq <= 0)
|
|
85
|
+
throw new URIError("not a form pair");
|
|
86
|
+
return [decodeURIComponent(chunk.slice(0, eq)), decodeURIComponent(chunk.slice(eq + 1))];
|
|
87
|
+
});
|
|
88
|
+
return pairs.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`).join("&") === body ? pairs : null;
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
function cardNetwork(digits2) {
|
|
95
|
+
if (VISA.test(digits2))
|
|
96
|
+
return "visa";
|
|
97
|
+
return MASTERCARD.test(digits2) ? "mastercard" : null;
|
|
98
|
+
}
|
|
99
|
+
function judgeBody(body) {
|
|
100
|
+
const pairs = readForm(body);
|
|
101
|
+
if (pairs === null)
|
|
102
|
+
return { verdict: refuse("payrexx_body_unsupported"), pairs: null };
|
|
103
|
+
const keys = pairs.map(([key]) => key);
|
|
104
|
+
const value = Object.fromEntries(pairs);
|
|
105
|
+
if (!pairs.some(([key, entry]) => key.startsWith("card[") && key !== "card[brand]" && entry !== "")) {
|
|
106
|
+
return pairs.some(([key, entry]) => key !== "encryptedCard" && CARD_DIGITS.test(entry)) ? { verdict: refuse("payrexx_body_unsupported"), pairs: null } : { verdict: CONTINUE, pairs: null };
|
|
107
|
+
}
|
|
108
|
+
if (new Set(keys).size !== keys.length)
|
|
109
|
+
return { verdict: refuse("payrexx_body_unsupported"), pairs: null };
|
|
110
|
+
if (keys.includes("encryptedCard"))
|
|
111
|
+
return { verdict: refuse("payrexx_wallet_card"), pairs: null };
|
|
112
|
+
if (keys.some((key) => THREE_DS_KEY.test(key)))
|
|
113
|
+
return { verdict: refuse("payrexx_three_ds_resend"), pairs: null };
|
|
114
|
+
if (value.pspId !== PAYREXX_PAY_PSP_ID)
|
|
115
|
+
return { verdict: refuse("payrexx_other_provider"), pairs: null };
|
|
116
|
+
if (keys.length !== PAYREXX_BODY_KEYS.length || !keys.every((key, at) => key === PAYREXX_BODY_KEYS[at])) {
|
|
117
|
+
return { verdict: refuse("payrexx_body_unsupported"), pairs: null };
|
|
118
|
+
}
|
|
119
|
+
const number = value["card[number]"];
|
|
120
|
+
const network = GROUPED.test(number) ? cardNetwork(number.replace(/ /g, "")) : null;
|
|
121
|
+
if (network === null || value["card[brand]"] !== network || !SECURITY_CODE.test(value["card[cvc]"]) || !MONTH.test(value["card[exp_month]"]) || !YEAR.test(value["card[exp_year]"]) || !HOLDER.test(value["card[cardholder]"]) || !INSTANCE.test(value.instance) || !AMOUNT.test(value.amount) || !CURRENCY.test(value.currency) || !(value.email === "" || value.email.length <= 254 && EMAIL.test(value.email)) || !FLAGS.every((flag) => value[flag] === "true" || value[flag] === "false")) {
|
|
122
|
+
return { verdict: refuse("payrexx_body_unsupported"), pairs: null };
|
|
123
|
+
}
|
|
124
|
+
if (value.isTokenization === "true" || value.isSubscription === "true")
|
|
125
|
+
return { verdict: refuse("payrexx_keep_on_file"), pairs: null };
|
|
126
|
+
if (value.isPreAuthorization === "true" || value.isMoto === "true")
|
|
127
|
+
return { verdict: refuse("payrexx_not_a_sale"), pairs: null };
|
|
128
|
+
return { verdict: CARD, pairs };
|
|
129
|
+
}
|
|
130
|
+
function payrexxBodyVerdict(body) {
|
|
131
|
+
return judgeBody(body).verdict;
|
|
132
|
+
}
|
|
133
|
+
function payrexxGateVerdict(url, body) {
|
|
134
|
+
const target = payrexxFrameTarget(url);
|
|
135
|
+
if (target === null)
|
|
136
|
+
return refuse("payrexx_url_refused");
|
|
137
|
+
const verdict = payrexxBodyVerdict(body);
|
|
138
|
+
return verdict.verdict === "card" && target.pspId !== PAYREXX_PAY_PSP_ID ? refuse("payrexx_other_provider") : verdict;
|
|
139
|
+
}
|
|
140
|
+
function payrexxRequestRefusal(request) {
|
|
141
|
+
if (!record(request) || typeof request.method !== "string" || request.method.toUpperCase() !== "POST" || !isPayrexxFrameUrl(request.url))
|
|
142
|
+
return "payrexx_url_refused";
|
|
143
|
+
const headers = /* @__PURE__ */ new Map();
|
|
144
|
+
for (const [name, value] of Object.entries(record(request.headers) ? request.headers : {})) {
|
|
145
|
+
const lower = name.toLowerCase();
|
|
146
|
+
if (headers.has(lower) || typeof value !== "string")
|
|
147
|
+
return "payrexx_headers_refused";
|
|
148
|
+
headers.set(lower, value);
|
|
149
|
+
}
|
|
150
|
+
const contentType = headers.get("content-type");
|
|
151
|
+
if (contentType === void 0 || !FORM_CONTENT_TYPE.test(contentType) || headers.get("x-requested-with") !== "XMLHttpRequest" || headers.has("accept") && !ACCEPT.test(headers.get("accept")))
|
|
152
|
+
return "payrexx_headers_refused";
|
|
153
|
+
const verdict = payrexxGateVerdict(request.url, request.body);
|
|
154
|
+
if (verdict.verdict === "card")
|
|
155
|
+
return null;
|
|
156
|
+
return verdict.verdict === "refuse" ? verdict.code : "payrexx_body_unsupported";
|
|
157
|
+
}
|
|
158
|
+
var DEVICE_WRITTEN = /* @__PURE__ */ Object.freeze(["card[number]", "card[cardholder]", "card[exp_month]", "card[exp_year]", "card[cvc]"]);
|
|
159
|
+
function isPayrexxDeviceRequest(template, body) {
|
|
160
|
+
const before = readForm(template);
|
|
161
|
+
const after = readForm(body);
|
|
162
|
+
const size = PAYREXX_BODY_KEYS.length;
|
|
163
|
+
if (!before || !after || before.length !== after.length || before.length < size)
|
|
164
|
+
return false;
|
|
165
|
+
for (let at = 0; at < before.length; at += 1) {
|
|
166
|
+
if (before[at][0] !== after[at][0] || at >= size && !THREE_DS_KEY.test(before[at][0]))
|
|
167
|
+
return false;
|
|
168
|
+
if (!DEVICE_WRITTEN.includes(before[at][0]) && before[at][1] !== after[at][1])
|
|
169
|
+
return false;
|
|
170
|
+
}
|
|
171
|
+
const head = (text) => text.split("&").slice(0, size).join("&");
|
|
172
|
+
return judgeBody(head(template)).verdict.verdict === "card" && judgeBody(head(body)).verdict.verdict === "card";
|
|
173
|
+
}
|
|
174
|
+
function payrexxInstance(body) {
|
|
175
|
+
const { verdict, pairs } = judgeBody(body);
|
|
176
|
+
return verdict.verdict === "card" ? Object.fromEntries(pairs).instance : null;
|
|
177
|
+
}
|
|
178
|
+
var PAYREXX_REVIEWED_INSTANCES = /* @__PURE__ */ Object.freeze(["wwfost"]);
|
|
179
|
+
function payrexxInstanceRefusal(instance, instances = PAYREXX_REVIEWED_INSTANCES) {
|
|
180
|
+
return typeof instance === "string" && Array.isArray(instances) && instances.includes(instance) ? null : "payrexx_instance_unreviewed";
|
|
181
|
+
}
|
|
182
|
+
function payrexxRequestAmount(body) {
|
|
183
|
+
const { verdict, pairs } = judgeBody(body);
|
|
184
|
+
if (verdict.verdict !== "card")
|
|
185
|
+
return null;
|
|
186
|
+
const value = Object.fromEntries(pairs);
|
|
187
|
+
return Object.freeze({ amountCents: Number(value.amount), currency: value.currency.toLowerCase() });
|
|
188
|
+
}
|
|
189
|
+
var digits = (value, min, max) => typeof value === "string" && value.length >= min && value.length <= max && !/[^0-9]/.test(value);
|
|
190
|
+
var whole = (value, min, max) => {
|
|
191
|
+
if (Number.isSafeInteger(value) && value >= 0)
|
|
192
|
+
return value;
|
|
193
|
+
return digits(value, min, max) ? Number(value) : NaN;
|
|
194
|
+
};
|
|
195
|
+
var cardYear = (year) => year >= 0 && year <= 99 || year >= 2e3 && year <= 2099;
|
|
196
|
+
var FILL_FAILED = "Could not fill the card fields for Payrexx. Nothing was sent.";
|
|
197
|
+
var CARD_NETWORK_REFUSAL = "Refusing to pay: this card network is not supported on this payment page. Nothing was sent.";
|
|
198
|
+
var BRAND_MISMATCH_REFUSAL = "Refusing to pay: this Payrexx payment names a card network that is not your card's. Nothing was sent.";
|
|
199
|
+
function injectPayrexxCard(body, card) {
|
|
200
|
+
const { verdict, pairs } = judgeBody(body);
|
|
201
|
+
if (verdict.verdict !== "card") {
|
|
202
|
+
throw new Error(payrexxRefusalMessage(verdict.verdict === "refuse" ? verdict.code : "payrexx_body_unsupported"));
|
|
203
|
+
}
|
|
204
|
+
const month = card ? whole(card.month, 1, 2) : NaN;
|
|
205
|
+
const year = card ? whole(card.year, 2, 4) : NaN;
|
|
206
|
+
if (!card || !digits(card.number, 12, 19) || !digits(card.cvc, 3, 4) || !(month >= 1 && month <= 12) || !cardYear(year)) {
|
|
207
|
+
throw new Error(FILL_FAILED);
|
|
208
|
+
}
|
|
209
|
+
const network = cardNetwork(card.number);
|
|
210
|
+
if (network === null)
|
|
211
|
+
throw new Error(CARD_NETWORK_REFUSAL);
|
|
212
|
+
if (!digits(card.cvc, 3, 3))
|
|
213
|
+
throw new Error(FILL_FAILED);
|
|
214
|
+
if (Object.fromEntries(pairs)["card[brand]"] !== network)
|
|
215
|
+
throw new Error(BRAND_MISMATCH_REFUSAL);
|
|
216
|
+
const written = {
|
|
217
|
+
"card[number]": card.number.replace(/([0-9]{4})(?=[0-9])/g, "$1 "),
|
|
218
|
+
"card[exp_month]": String(month).padStart(2, "0"),
|
|
219
|
+
"card[exp_year]": String(2e3 + year % 100),
|
|
220
|
+
"card[cvc]": card.cvc
|
|
221
|
+
};
|
|
222
|
+
if (typeof card.name === "string" && HOLDER.test(card.name))
|
|
223
|
+
written["card[cardholder]"] = card.name;
|
|
224
|
+
const where = [];
|
|
225
|
+
const filled = pairs.map(([key, value]) => {
|
|
226
|
+
if (!Object.prototype.hasOwnProperty.call(written, key))
|
|
227
|
+
return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
|
|
228
|
+
where.push(key);
|
|
229
|
+
return `${encodeURIComponent(key)}=${encodeURIComponent(written[key])}`;
|
|
230
|
+
});
|
|
231
|
+
return { body: filled.join("&"), where };
|
|
232
|
+
}
|
|
233
|
+
var TOKEN = /^[\x21-\x7e]{1,512}$/;
|
|
234
|
+
var ANSWER_LIMIT = 65536;
|
|
235
|
+
var SEPARATORS = /[\s.-]/g;
|
|
236
|
+
function answerCarriesCard(text, answer, number) {
|
|
237
|
+
if (text.replace(SEPARATORS, "").includes(number))
|
|
238
|
+
return true;
|
|
239
|
+
const pending = [answer];
|
|
240
|
+
while (pending.length > 0) {
|
|
241
|
+
const value = pending.pop();
|
|
242
|
+
if (typeof value === "string") {
|
|
243
|
+
if (value.replace(SEPARATORS, "").includes(number))
|
|
244
|
+
return true;
|
|
245
|
+
}
|
|
246
|
+
else if (Array.isArray(value)) {
|
|
247
|
+
for (const entry of value)
|
|
248
|
+
pending.push(entry);
|
|
249
|
+
}
|
|
250
|
+
else if (value !== null && typeof value === "object") {
|
|
251
|
+
for (const [key, entry] of Object.entries(value))
|
|
252
|
+
pending.push(key, entry);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
return false;
|
|
256
|
+
}
|
|
257
|
+
function payrexxAnswerOutcome(status, text, card) {
|
|
258
|
+
if (!(status >= 200 && status < 300)) {
|
|
259
|
+
return status >= 400 && status < 500 ? { outcome: "refused", code: `http_${status}` } : { outcome: "unknown", reason: "server_error" };
|
|
260
|
+
}
|
|
261
|
+
if (typeof text !== "string" || text.length > ANSWER_LIMIT)
|
|
262
|
+
return { outcome: "unknown", reason: "payrexx_answer_unreadable" };
|
|
263
|
+
let answer;
|
|
264
|
+
try {
|
|
265
|
+
answer = JSON.parse(text);
|
|
266
|
+
}
|
|
267
|
+
catch {
|
|
268
|
+
return { outcome: "unknown", reason: "payrexx_answer_unreadable" };
|
|
269
|
+
}
|
|
270
|
+
if (!record(answer))
|
|
271
|
+
return { outcome: "unknown", reason: "payrexx_answer_unreadable" };
|
|
272
|
+
if (card && digits(card.number, 12, 19) && answerCarriesCard(text, answer, card.number)) {
|
|
273
|
+
return { outcome: "unknown", reason: "payrexx_card_in_answer" };
|
|
274
|
+
}
|
|
275
|
+
if (answer.error)
|
|
276
|
+
return { outcome: "refused", code: "payrexx_declined" };
|
|
277
|
+
if (record(answer.additional) && answer.additional.threeDSecureError)
|
|
278
|
+
return { outcome: "refused", code: "payrexx_three_ds_error" };
|
|
279
|
+
if (answer.acs_url !== void 0 || answer.pareq !== void 0 || answer.encryptedCard !== void 0) {
|
|
280
|
+
return { outcome: "unknown", reason: "payrexx_answer_unconfirmed" };
|
|
281
|
+
}
|
|
282
|
+
if (typeof answer.token === "string" && TOKEN.test(answer.token))
|
|
283
|
+
return { outcome: "approved", body: text };
|
|
284
|
+
if (!answer.token && typeof answer.threeDSServerTransID === "string" && TOKEN.test(answer.threeDSServerTransID)) {
|
|
285
|
+
const step = threeDsStep(answer.transStatus);
|
|
286
|
+
if (step === "declined")
|
|
287
|
+
return { outcome: "refused", code: "payrexx_three_ds_declined" };
|
|
288
|
+
if (step === "tokenless")
|
|
289
|
+
return { outcome: "refused", code: "payrexx_three_ds_error" };
|
|
290
|
+
if (step !== null)
|
|
291
|
+
return { outcome: "approved", body: text, pending: "three_ds" };
|
|
292
|
+
}
|
|
293
|
+
return { outcome: "unknown", reason: "payrexx_answer_unconfirmed" };
|
|
294
|
+
}
|
|
295
|
+
function threeDsStep(transStatus) {
|
|
296
|
+
if (transStatus === void 0)
|
|
297
|
+
return "method";
|
|
298
|
+
if (transStatus === "C")
|
|
299
|
+
return "challenge";
|
|
300
|
+
if (transStatus === "N" || transStatus === "R" || transStatus === "U")
|
|
301
|
+
return "declined";
|
|
302
|
+
return transStatus === "Y" || transStatus === "A" ? "tokenless" : null;
|
|
303
|
+
}
|
|
304
|
+
function payrexxRefusalCode(text) {
|
|
305
|
+
let answer;
|
|
306
|
+
try {
|
|
307
|
+
answer = typeof text === "string" && text.length <= ANSWER_LIMIT ? JSON.parse(text) : null;
|
|
308
|
+
}
|
|
309
|
+
catch {
|
|
310
|
+
return null;
|
|
311
|
+
}
|
|
312
|
+
if (!record(answer))
|
|
313
|
+
return null;
|
|
314
|
+
if (answer.error)
|
|
315
|
+
return "payrexx_declined";
|
|
316
|
+
if (record(answer.additional) && answer.additional.threeDSecureError)
|
|
317
|
+
return "payrexx_three_ds_error";
|
|
318
|
+
if (answer.token || typeof answer.threeDSServerTransID !== "string" || !TOKEN.test(answer.threeDSServerTransID))
|
|
319
|
+
return null;
|
|
320
|
+
const step = threeDsStep(answer.transStatus);
|
|
321
|
+
return step === "declined" ? "payrexx_three_ds_declined" : step === "tokenless" ? "payrexx_three_ds_error" : null;
|
|
322
|
+
}
|
|
323
|
+
var PAYREXX_FOLLOW_UP_KINDS = /* @__PURE__ */ Object.freeze(["authentication", "post_authentication"]);
|
|
324
|
+
var PAYREXX_FOLLOW_UP_LIMITS = /* @__PURE__ */ Object.freeze({ authentication: 1, post_authentication: 1 });
|
|
325
|
+
var PAYREXX_FOLLOW_UP_MAX = 2;
|
|
326
|
+
var PAYREXX_FOLLOW_UP_WINDOW_MS = 15 * 60 * 1e3;
|
|
327
|
+
var PAYREXX_FOLLOW_UP_IDLE_MS = 60 * 1e3;
|
|
328
|
+
var PAYREXX_FOLLOW_UP_CHALLENGE_MS = 11 * 60 * 1e3;
|
|
329
|
+
var PAYREXX_FOLLOW_UP_BODY_LIMIT = BODY_LIMIT;
|
|
330
|
+
var PAYREXX_FOLLOW_UP_ANSWER_LIMIT = ANSWER_LIMIT;
|
|
331
|
+
var PAYREXX_FOLLOW_UP_REFUSALS = /* @__PURE__ */ Object.freeze([
|
|
332
|
+
"not_a_follow_up",
|
|
333
|
+
"parent_unreadable",
|
|
334
|
+
"follow_up_closed",
|
|
335
|
+
"follow_up_in_flight",
|
|
336
|
+
"follow_up_limit",
|
|
337
|
+
"out_of_order",
|
|
338
|
+
"unreadable",
|
|
339
|
+
"shape",
|
|
340
|
+
"card_mismatch",
|
|
341
|
+
"session_mismatch"
|
|
342
|
+
]);
|
|
343
|
+
var AUTH_DATA_KEYS = /* @__PURE__ */ Object.freeze([
|
|
344
|
+
"indicator",
|
|
345
|
+
"colorDepth",
|
|
346
|
+
"browserLanguage",
|
|
347
|
+
"browserJavaEnabled",
|
|
348
|
+
"browserJavascriptEnabled",
|
|
349
|
+
"browserScreenHeight",
|
|
350
|
+
"browserScreenWidth",
|
|
351
|
+
"browserTZ",
|
|
352
|
+
"notificationURL",
|
|
353
|
+
"threeDSRequestorURL"
|
|
354
|
+
]);
|
|
355
|
+
var NOTIFICATION_URL = "https://dispatcher.payrexx.com/auth/threeDSecureV2.php";
|
|
356
|
+
var AUTH_DATA_VALUE = /* @__PURE__ */ Object.freeze({
|
|
357
|
+
indicator: /^[YNU]$/,
|
|
358
|
+
colorDepth: /^[0-9]{1,2}$/,
|
|
359
|
+
browserLanguage: /^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{1,8}){0,3}$/,
|
|
360
|
+
browserJavaEnabled: /^(?:true|false)$/,
|
|
361
|
+
browserJavascriptEnabled: /^true$/,
|
|
362
|
+
browserScreenHeight: /^[0-9]{1,5}$/,
|
|
363
|
+
browserScreenWidth: /^[0-9]{1,5}$/,
|
|
364
|
+
browserTZ: /^-?[0-9]{1,4}$/
|
|
365
|
+
});
|
|
366
|
+
var CARD_VALUE_KEYS = /* @__PURE__ */ Object.freeze(["card[number]", "card[cardholder]", "card[exp_month]", "card[exp_year]", "card[cvc]", "card[brand]"]);
|
|
367
|
+
var followUpRefused = (refusal) => Object.freeze({ ok: false, refusal });
|
|
368
|
+
function answerObject(answer) {
|
|
369
|
+
if (!record(answer) || !(answer.status >= 200 && answer.status < 300) || typeof answer.text !== "string" || answer.text.length > ANSWER_LIMIT)
|
|
370
|
+
return null;
|
|
371
|
+
try {
|
|
372
|
+
const parsed = JSON.parse(answer.text);
|
|
373
|
+
return record(parsed) ? parsed : null;
|
|
374
|
+
}
|
|
375
|
+
catch {
|
|
376
|
+
return null;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
function threeDsRun(answer) {
|
|
380
|
+
if (!answer || answer.error || record(answer.additional) && answer.additional.threeDSecureError || answer.token)
|
|
381
|
+
return null;
|
|
382
|
+
if (typeof answer.threeDSServerTransID !== "string" || !TOKEN.test(answer.threeDSServerTransID))
|
|
383
|
+
return null;
|
|
384
|
+
if (answer.threeDSVersion !== void 0 && (typeof answer.threeDSVersion !== "string" || !TOKEN.test(answer.threeDSVersion)))
|
|
385
|
+
return null;
|
|
386
|
+
const step = threeDsStep(answer.transStatus);
|
|
387
|
+
return step === "method" || step === "challenge" ? { transId: answer.threeDSServerTransID, version: answer.threeDSVersion, step } : null;
|
|
388
|
+
}
|
|
389
|
+
function endsRun(answer) {
|
|
390
|
+
if (!answer)
|
|
391
|
+
return false;
|
|
392
|
+
if (answer.token || answer.error || record(answer.additional) && answer.additional.threeDSecureError)
|
|
393
|
+
return true;
|
|
394
|
+
const step = threeDsStep(answer.transStatus);
|
|
395
|
+
return step === "declined" || step === "tokenless";
|
|
396
|
+
}
|
|
397
|
+
function sentSends(sent) {
|
|
398
|
+
if (!Array.isArray(sent))
|
|
399
|
+
return null;
|
|
400
|
+
const out = [];
|
|
401
|
+
for (const item of sent) {
|
|
402
|
+
if (!record(item) || !PAYREXX_FOLLOW_UP_KINDS.includes(item.kind) || !["pending", "answered", "failed"].includes(item.state))
|
|
403
|
+
return null;
|
|
404
|
+
out.push({ kind: item.kind, state: item.state, answer: item.state === "answered" ? answerObject(item.answer) : null });
|
|
405
|
+
}
|
|
406
|
+
return out;
|
|
407
|
+
}
|
|
408
|
+
function followUpStep(extra, run, instance) {
|
|
409
|
+
const keys = extra.map(([key]) => key);
|
|
410
|
+
const value = Object.fromEntries(extra);
|
|
411
|
+
if (keys[0] !== "threeDSServerTransID")
|
|
412
|
+
return { refusal: "shape" };
|
|
413
|
+
if (keys.length === 2 && keys[1] === "postAuth") {
|
|
414
|
+
if (value.postAuth !== "true")
|
|
415
|
+
return { refusal: "shape" };
|
|
416
|
+
return value.threeDSServerTransID === run.transId ? { kind: "post_authentication" } : { refusal: "session_mismatch" };
|
|
417
|
+
}
|
|
418
|
+
const versioned = keys[1] === "threeDSVersion";
|
|
419
|
+
const auth = keys.slice(versioned ? 2 : 1);
|
|
420
|
+
if (auth.length !== AUTH_DATA_KEYS.length || !auth.every((key, at) => key === `authData[${AUTH_DATA_KEYS[at]}]`))
|
|
421
|
+
return { refusal: "shape" };
|
|
422
|
+
for (const name of AUTH_DATA_KEYS) {
|
|
423
|
+
const entry = value[`authData[${name}]`];
|
|
424
|
+
const sound = name === "notificationURL" ? entry === NOTIFICATION_URL : name === "threeDSRequestorURL" ? entry === `https://${instance}.payrexx.com` : AUTH_DATA_VALUE[name].test(entry);
|
|
425
|
+
if (!sound)
|
|
426
|
+
return { refusal: "shape" };
|
|
427
|
+
}
|
|
428
|
+
if (value.threeDSServerTransID !== run.transId || (versioned ? value.threeDSVersion !== run.version : run.version !== void 0)) {
|
|
429
|
+
return { refusal: "session_mismatch" };
|
|
430
|
+
}
|
|
431
|
+
return { kind: "authentication" };
|
|
432
|
+
}
|
|
433
|
+
function payrexxFollowUpVerdict(input) {
|
|
434
|
+
if (!record(input) || !record(input.request))
|
|
435
|
+
return followUpRefused("not_a_follow_up");
|
|
436
|
+
const { request } = input;
|
|
437
|
+
const parent = record(input.parent) ? input.parent : null;
|
|
438
|
+
if (String(request.method ?? "").toUpperCase() !== "POST" || !isPayrexxFrameUrl(request.url))
|
|
439
|
+
return followUpRefused("not_a_follow_up");
|
|
440
|
+
const judged = parent ? judgeBody(parent.body) : null;
|
|
441
|
+
if (!parent || !isPayrexxFrameUrl(parent.url) || judged.verdict.verdict !== "card")
|
|
442
|
+
return followUpRefused("parent_unreadable");
|
|
443
|
+
if (request.url !== parent.url)
|
|
444
|
+
return followUpRefused("not_a_follow_up");
|
|
445
|
+
const parentAnswer = answerObject(parent.answer);
|
|
446
|
+
const run = threeDsRun(parentAnswer);
|
|
447
|
+
if (!run)
|
|
448
|
+
return followUpRefused(endsRun(parentAnswer) ? "follow_up_closed" : "parent_unreadable");
|
|
449
|
+
const sent = sentSends(input.sent ?? []);
|
|
450
|
+
if (!sent)
|
|
451
|
+
return followUpRefused("parent_unreadable");
|
|
452
|
+
if (sent.some((item) => item.state === "failed" || item.state === "answered" && !threeDsRun(item.answer)))
|
|
453
|
+
return followUpRefused("follow_up_closed");
|
|
454
|
+
if (sent.some((item) => item.state === "pending"))
|
|
455
|
+
return followUpRefused("follow_up_in_flight");
|
|
456
|
+
if (sent.length >= PAYREXX_FOLLOW_UP_MAX)
|
|
457
|
+
return followUpRefused("follow_up_limit");
|
|
458
|
+
const pairs = readForm(request.body);
|
|
459
|
+
if (pairs === null)
|
|
460
|
+
return followUpRefused("unreadable");
|
|
461
|
+
const base = pairs.slice(0, PAYREXX_BODY_KEYS.length);
|
|
462
|
+
for (let at = 0; at < judged.pairs.length; at += 1) {
|
|
463
|
+
const [key, value] = judged.pairs[at];
|
|
464
|
+
if (!base[at] || base[at][0] !== key)
|
|
465
|
+
return followUpRefused("shape");
|
|
466
|
+
if (base[at][1] !== value)
|
|
467
|
+
return followUpRefused(CARD_VALUE_KEYS.includes(key) ? "card_mismatch" : "shape");
|
|
468
|
+
}
|
|
469
|
+
const step = followUpStep(pairs.slice(PAYREXX_BODY_KEYS.length), run, Object.fromEntries(judged.pairs).instance);
|
|
470
|
+
if (step.refusal)
|
|
471
|
+
return followUpRefused(step.refusal);
|
|
472
|
+
if (sent.some((item) => item.kind === step.kind))
|
|
473
|
+
return followUpRefused("follow_up_limit");
|
|
474
|
+
if (step.kind === "authentication" && (run.step !== "method" || sent.length > 0))
|
|
475
|
+
return followUpRefused("out_of_order");
|
|
476
|
+
if (step.kind === "post_authentication") {
|
|
477
|
+
const latest = sent.length === 0 ? run : threeDsRun(sent[sent.length - 1].answer);
|
|
478
|
+
if (!latest || latest.step !== "challenge" || latest.transId !== run.transId)
|
|
479
|
+
return followUpRefused("out_of_order");
|
|
480
|
+
}
|
|
481
|
+
return Object.freeze({ ok: true, kind: step.kind, slot: 1 });
|
|
482
|
+
}
|
|
483
|
+
function payrexxFollowUpIdleMs(kind, answerText) {
|
|
484
|
+
if (kind === "post_authentication")
|
|
485
|
+
return 0;
|
|
486
|
+
const run = threeDsRun(answerObject({ status: 200, text: answerText }));
|
|
487
|
+
if (!run)
|
|
488
|
+
return 0;
|
|
489
|
+
return run.step === "challenge" ? PAYREXX_FOLLOW_UP_CHALLENGE_MS : PAYREXX_FOLLOW_UP_IDLE_MS;
|
|
490
|
+
}
|
|
491
|
+
var NUMBER_ANSWER_KEY = /^(?:card)?(?:number|pan|no)$/;
|
|
492
|
+
var CODE_ANSWER_KEY = /^(?:card)?(?:cvc|cvv|cvv2|securitycode)$/;
|
|
493
|
+
function payrexxFollowUpAnswerRefusal(answerText) {
|
|
494
|
+
const body = answerObject({ status: 200, text: answerText });
|
|
495
|
+
if (!body)
|
|
496
|
+
return "answer_unreadable";
|
|
497
|
+
let visits = 0;
|
|
498
|
+
const pending = [[body, 0]];
|
|
499
|
+
while (pending.length > 0) {
|
|
500
|
+
const [value, depth] = pending.pop();
|
|
501
|
+
if (depth > 16 || ++visits > 6e3)
|
|
502
|
+
return "answer_unreadable";
|
|
503
|
+
if (Array.isArray(value)) {
|
|
504
|
+
for (const item of value)
|
|
505
|
+
pending.push([item, depth + 1]);
|
|
506
|
+
}
|
|
507
|
+
else if (record(value)) {
|
|
508
|
+
for (const [key, child] of Object.entries(value)) {
|
|
509
|
+
const name = key.toLowerCase().replace(/[-_ ]/g, "");
|
|
510
|
+
if (typeof child === "string" || typeof child === "number") {
|
|
511
|
+
const flat = String(child).replace(SEPARATORS, "");
|
|
512
|
+
if (NUMBER_ANSWER_KEY.test(name) && /[0-9]{12}/.test(flat))
|
|
513
|
+
return "card_in_answer";
|
|
514
|
+
if (CODE_ANSWER_KEY.test(name) && /^[0-9]{3,4}$/.test(flat))
|
|
515
|
+
return "card_in_answer";
|
|
516
|
+
}
|
|
517
|
+
pending.push([child, depth + 1]);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
return null;
|
|
522
|
+
}
|
|
523
|
+
var REFUSAL_MESSAGES = /* @__PURE__ */ Object.freeze({
|
|
524
|
+
payrexx_url_refused: "Refusing to pay: this Payrexx card request does not go to Payrexx's card form exactly as the page sends it. Nothing was sent.",
|
|
525
|
+
payrexx_headers_refused: "Refusing to pay: this Payrexx card request does not carry the card form's own headers. Nothing was sent.",
|
|
526
|
+
payrexx_other_provider: "Refusing to pay: this Payrexx page sends the card to another payment provider, which the Vault does not pay yet. Nothing was sent.",
|
|
527
|
+
payrexx_wallet_card: "Refusing to pay: this Payrexx payment uses a wallet card, not a card from your Vault. Nothing was sent.",
|
|
528
|
+
payrexx_three_ds_resend: "Refusing to pay: this Payrexx payment sends the card again for 3-D Secure, and your approval does not cover this send. Nothing was sent.",
|
|
529
|
+
payrexx_keep_on_file: "Refusing to pay: this Payrexx payment would keep the card on file without your consent. Nothing was sent.",
|
|
530
|
+
payrexx_not_a_sale: "Refusing to pay: this Payrexx payment is a hold or a mail order, not a one-time payment. Nothing was sent.",
|
|
531
|
+
payrexx_body_unsupported: "Refusing to pay: this is not the card request of Payrexx's card form. Nothing was sent."
|
|
532
|
+
});
|
|
533
|
+
function payrexxRefusalMessage(code) {
|
|
534
|
+
return Object.prototype.hasOwnProperty.call(REFUSAL_MESSAGES, code) ? REFUSAL_MESSAGES[code] : REFUSAL_MESSAGES.payrexx_body_unsupported;
|
|
535
|
+
}
|
|
536
|
+
export { PAYREXX_BODY_KEYS, PAYREXX_CAPABILITY, PAYREXX_FOLLOW_UP_ANSWER_LIMIT, PAYREXX_FOLLOW_UP_BODY_LIMIT, PAYREXX_FOLLOW_UP_CHALLENGE_MS, PAYREXX_FOLLOW_UP_IDLE_MS, PAYREXX_FOLLOW_UP_KINDS, PAYREXX_FOLLOW_UP_LIMITS, PAYREXX_FOLLOW_UP_MAX, PAYREXX_FOLLOW_UP_REFUSALS, PAYREXX_FOLLOW_UP_WINDOW_MS, PAYREXX_FRAME_HOST, PAYREXX_OPERATION, PAYREXX_PAY_PSP_ID, PAYREXX_PSP, PAYREXX_REFUSAL_CODES, PAYREXX_REVIEWED_INSTANCES, injectPayrexxCard, isPayrexxDeviceRequest, isPayrexxFrameUrl, payrexxAnswerOutcome, payrexxBodyVerdict, payrexxFollowUpAnswerRefusal, payrexxFollowUpIdleMs, payrexxFollowUpVerdict, payrexxFrameTarget, payrexxGateVerdict, payrexxInstance, payrexxInstanceRefusal, payrexxRefusalCode, payrexxRefusalMessage, payrexxRequestAmount, payrexxRequestRefusal };
|