@agent-cards/sdk 0.23.22 → 0.23.23
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 +22 -0
- package/README.md +27 -4
- package/dist/aci.generated.js +3 -3
- package/dist/agent-amount.generated.d.ts +7 -0
- package/dist/agent-amount.generated.js +3 -0
- package/dist/capabilities.generated.d.ts +2 -0
- package/dist/capabilities.generated.js +3 -0
- package/dist/card-fields.generated.js +1125 -24
- package/dist/cdp.js +50 -11
- package/dist/client.d.ts +59 -5
- package/dist/client.js +165 -116
- package/dist/hosted-entry.js +2 -1
- package/dist/hosted-form.d.ts +5 -0
- package/dist/hosted-form.js +5 -0
- package/dist/paytrail.d.ts +58 -0
- package/dist/paytrail.js +98 -0
- package/dist/pre-claim.d.ts +4 -0
- package/dist/pre-claim.js +46 -2
- package/dist/primer.generated.js +1153 -52
- package/dist/registry.d.ts +4 -3
- package/dist/registry.js +12 -4
- package/dist/sbps.d.ts +57 -0
- package/dist/sbps.generated.d.ts +96 -0
- package/dist/sbps.generated.js +427 -0
- package/dist/sbps.js +90 -0
- package/dist/stripe-checkout.generated.js +456 -7
- package/dist/transbank.d.ts +33 -0
- package/dist/transbank.js +62 -0
- package/dist/url-mask-parts.d.ts +24 -0
- package/dist/url-mask-parts.js +22 -0
- package/dist/url-masks.generated.d.ts +3 -0
- package/dist/url-masks.generated.js +2 -0
- package/package.json +4 -4
package/dist/sbps.js
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// SB Payment Service (SBPS): the adapters' side of its one-time token request.
|
|
2
|
+
//
|
|
3
|
+
// SBPS's token script (com_sbps_system_token.js) encrypts the card in the merchant's page and sends it
|
|
4
|
+
// as ONE JSONP <script> GET to /token/generateToken on token.sps-system.com (stbtoken.sps-system.com
|
|
5
|
+
// for SBPS's test environment); the answer is JavaScript that calls the request's own callback with
|
|
6
|
+
// {"tokenRes": {...}}. The rules that judge that request (the exact URL the browser writes for the
|
|
7
|
+
// script's <script>, the merchant pins, the answer judge) live in payment-core and reach this SDK as
|
|
8
|
+
// sbps.generated.ts. This module holds only what an attachment decides from them:
|
|
9
|
+
// - which request on SBPS's token hosts is the card token request to pause for the vault;
|
|
10
|
+
// - which is a variant of it this SDK does not complete (aborted, so the placeholder's ciphertext
|
|
11
|
+
// never reaches SBPS);
|
|
12
|
+
// - the script answer the paused request gets once the cardholder's device sent the real card: the
|
|
13
|
+
// token Agentcard stored, wrapped in the callback the paused URL named.
|
|
14
|
+
// The 3-D Secure info request on the same host (/token/generateTds2Token: the buyer's name, phone and
|
|
15
|
+
// email, no card) and the scripts continue untouched.
|
|
16
|
+
import { SBPS_ANSWER_CONTENT_TYPE, SBPS_TOKEN_HOSTS, SBPS_TOKEN_PATH, isSbpsRequest, isSbpsTokenRequest, sbpsJsonp, sbpsOutcome, sbpsRequestFacts } from './sbps.generated.js';
|
|
17
|
+
/** The processor id, as the registry and the API name it. */
|
|
18
|
+
export const SBPS_PSP = 'sb_payment_service';
|
|
19
|
+
/** The dark-launch capability the API serves the SBPS recognizer behind (payment-core definitions.js). */
|
|
20
|
+
export const SBPS_CAPABILITY = 'sbps_token_jsonp';
|
|
21
|
+
/** What the paused <script> is answered with. */
|
|
22
|
+
export { SBPS_ANSWER_CONTENT_TYPE };
|
|
23
|
+
const SBPS_HOSTNAMES = [SBPS_TOKEN_HOSTS.production, SBPS_TOKEN_HOSTS.sandbox];
|
|
24
|
+
/** Which SBPS request this is, or null for a URL that is not on one of SBPS's token hosts. */
|
|
25
|
+
export function classifySbpsRequest(url, method) {
|
|
26
|
+
let parsed;
|
|
27
|
+
try {
|
|
28
|
+
parsed = new URL(url);
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
if (parsed.protocol !== 'https:' || parsed.port || parsed.username || parsed.password
|
|
34
|
+
|| !SBPS_HOSTNAMES.includes(parsed.hostname.toLowerCase().replace(/\.$/, '')))
|
|
35
|
+
return null;
|
|
36
|
+
// Every spelling of the token path belongs to the token request family: the exact request carries the
|
|
37
|
+
// card, and any neighbour of it is nothing this SDK completes. generateTds2Token is not a neighbour.
|
|
38
|
+
if (parsed.pathname.toLowerCase().startsWith(SBPS_TOKEN_PATH.toLowerCase())) {
|
|
39
|
+
return typeof method === 'string' && isSbpsTokenRequest(url, method.toUpperCase()) ? { kind: 'token_request' } : { kind: 'unsupported' };
|
|
40
|
+
}
|
|
41
|
+
return { kind: 'sibling' };
|
|
42
|
+
}
|
|
43
|
+
/** The token request GET exactly as payment-core admits it: its URL alone, with no body. */
|
|
44
|
+
export function isSbpsTokenGet(request) {
|
|
45
|
+
return (request.method ?? 'POST').toUpperCase() === 'GET' && isSbpsRequest({ url: request.url, method: 'GET', body: request.body ?? '' });
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The answer a paused token request gets, or null when the stored answer is not one to hand the page:
|
|
49
|
+
* SBPS's own shape, `<callback>(<tokenRes>)` under a script type, with the callback the paused URL
|
|
50
|
+
* named. The answer must be one payment-core's judge accepts for that exact URL (result OK and the
|
|
51
|
+
* five token fields), byte for byte what the API stored after running the same judge.
|
|
52
|
+
*/
|
|
53
|
+
export function sbpsScriptAnswer(templateUrl, response) {
|
|
54
|
+
const facts = sbpsRequestFacts(templateUrl);
|
|
55
|
+
if (!facts || response.status !== 200 || typeof response.body !== 'string')
|
|
56
|
+
return null;
|
|
57
|
+
let body;
|
|
58
|
+
try {
|
|
59
|
+
body = sbpsJsonp(facts.callback, response.body);
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
const verdict = sbpsOutcome(200, body, templateUrl, undefined);
|
|
65
|
+
if (verdict.outcome !== 'token' || verdict.sanitizedJson !== response.body)
|
|
66
|
+
return null;
|
|
67
|
+
return { status: 200, headers: { 'content-type': SBPS_ANSWER_CONTENT_TYPE }, body };
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* One attachment's view of SBPS's token hosts. Inert (classify returns null) until the registry serves
|
|
71
|
+
* SBPS, which a client reaches only by syncing with the capability for an org the API enabled, so a
|
|
72
|
+
* build, an org or an API that never served it leaves every SBPS request exactly as before.
|
|
73
|
+
*/
|
|
74
|
+
export class SbpsGate {
|
|
75
|
+
vault;
|
|
76
|
+
constructor(vault) {
|
|
77
|
+
this.vault = vault;
|
|
78
|
+
}
|
|
79
|
+
/** What this request is, when the registry serves SBPS and the URL is on its token hosts; null leaves it to the other gates. */
|
|
80
|
+
classify(url, method) {
|
|
81
|
+
if (typeof this.vault?.recognizesProcessor !== 'function' || !this.vault.recognizesProcessor(SBPS_PSP))
|
|
82
|
+
return null;
|
|
83
|
+
return classifySbpsRequest(url, method);
|
|
84
|
+
}
|
|
85
|
+
/** Playwright's route predicate sees only the URL: route the token request family, never the scripts or the 3-D Secure info request. */
|
|
86
|
+
matches(url) {
|
|
87
|
+
const request = this.classify(url, 'GET');
|
|
88
|
+
return request !== null && request.kind !== 'sibling';
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -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: 7d433d016a6cb47bb9d1cf22ab63bf41d3d67091d68a23e2d3c8885dbfa98b43
|
|
4
4
|
// src/deep-freeze.js
|
|
5
5
|
function deepFreeze(value) {
|
|
6
6
|
if (value && typeof value === "object" && !Object.isFrozen(value)) {
|
|
@@ -10,6 +10,158 @@ function deepFreeze(value) {
|
|
|
10
10
|
}
|
|
11
11
|
return value;
|
|
12
12
|
}
|
|
13
|
+
// src/registration.js
|
|
14
|
+
var PARTS = { psp: "id", definitions: "list", refusedOperations: "list", settlementReadback: "any", exactUrl: "rule", bodyGate: "rule", amount: "rule" };
|
|
15
|
+
var PSP_ID = /^[a-z][a-z0-9_]*$/;
|
|
16
|
+
var registrationProblems = (spec) => problemsOf(spec, PARTS);
|
|
17
|
+
function problemsOf(spec, parts) {
|
|
18
|
+
if (!spec || typeof spec !== "object")
|
|
19
|
+
return ["a registration is an object"];
|
|
20
|
+
const psp = spec.psp;
|
|
21
|
+
if (typeof psp !== "string" || !PSP_ID.test(psp))
|
|
22
|
+
return [`${JSON.stringify(psp)} is not a processor id`];
|
|
23
|
+
const problems2 = Object.keys(spec).filter((key) => !(key in parts)).map((key) => `${psp}: ${key} is no registration part`);
|
|
24
|
+
for (const [key, kind] of Object.entries(parts)) {
|
|
25
|
+
const value = spec[key];
|
|
26
|
+
if (value === void 0)
|
|
27
|
+
continue;
|
|
28
|
+
if (kind === "rule" && typeof value !== "function")
|
|
29
|
+
problems2.push(`${psp}: ${key} is not a function`);
|
|
30
|
+
if (kind === "numbers" && !((Array.isArray(value) || value instanceof Set) && [...value].every((n) => typeof n === "string" && /^\d{12,19}$/.test(n)))) {
|
|
31
|
+
problems2.push(`${psp}: ${key} is not a list of card numbers`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if ("definitions" in parts) {
|
|
35
|
+
if (!Array.isArray(spec.definitions) || spec.definitions.length === 0)
|
|
36
|
+
problems2.push(`${psp}: names no definition`);
|
|
37
|
+
else if (spec.definitions.some((definition) => definition?.psp !== psp))
|
|
38
|
+
problems2.push(`${psp}: a definition names another processor`);
|
|
39
|
+
for (const id of spec.refusedOperations ?? []) {
|
|
40
|
+
if (typeof id !== "string" || !id.startsWith(`${psp}.`))
|
|
41
|
+
problems2.push(`${psp}: ${JSON.stringify(id)} is not one of its operations`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return problems2;
|
|
45
|
+
}
|
|
46
|
+
function registered(spec, parts) {
|
|
47
|
+
const problems2 = problemsOf(spec, parts);
|
|
48
|
+
if (problems2.length)
|
|
49
|
+
throw new Error(`payment-core registration refused: ${problems2.join("; ")}`);
|
|
50
|
+
return deepFreeze({ ...spec });
|
|
51
|
+
}
|
|
52
|
+
function registerProcessor(spec) {
|
|
53
|
+
return registered(spec, PARTS);
|
|
54
|
+
}
|
|
55
|
+
// src/processors/midtrans.js
|
|
56
|
+
var MIDTRANS_PSP = "midtrans";
|
|
57
|
+
var MIDTRANS_OPERATION = "midtrans.card_request";
|
|
58
|
+
var MIDTRANS_TOKEN_URL = "https://api.midtrans.com/v2/token";
|
|
59
|
+
var MIDTRANS_SANDBOX_TOKEN_URL = "https://api.sandbox.midtrans.com/v2/token";
|
|
60
|
+
var MIDTRANS_TOKEN_KEYS = /* @__PURE__ */ Object.freeze(["card_cvv", "card_number", "card_exp_month", "card_exp_year", "installment_term"]);
|
|
61
|
+
var BODY_LIMIT = 4096;
|
|
62
|
+
var CARD_NUMBER = /^[0-9]{12,19}$/;
|
|
63
|
+
var SECURITY_CODE = /^[0-9]{3,4}$/;
|
|
64
|
+
var MONTH = /^(?:0[1-9]|1[0-2])$/;
|
|
65
|
+
var YEAR = /^20[0-9]{2}$/;
|
|
66
|
+
var TERM = /^[0-9]{1,3}$/;
|
|
67
|
+
var record = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
68
|
+
var own = (value, key) => Object.prototype.hasOwnProperty.call(value, key);
|
|
69
|
+
var inOrder = (value, keys) => {
|
|
70
|
+
let at = 0;
|
|
71
|
+
for (const name of Object.keys(value)) {
|
|
72
|
+
while (at < keys.length && keys[at] !== name)
|
|
73
|
+
at += 1;
|
|
74
|
+
if (at === keys.length)
|
|
75
|
+
return false;
|
|
76
|
+
at += 1;
|
|
77
|
+
}
|
|
78
|
+
return true;
|
|
79
|
+
};
|
|
80
|
+
var refuse = (code) => Object.freeze({ verdict: "refuse", code });
|
|
81
|
+
var CARD = /* @__PURE__ */ Object.freeze({ verdict: "card" });
|
|
82
|
+
function isMidtransTokenUrl(url) {
|
|
83
|
+
return url === MIDTRANS_TOKEN_URL || url === MIDTRANS_SANDBOX_TOKEN_URL;
|
|
84
|
+
}
|
|
85
|
+
function readBody(body) {
|
|
86
|
+
if (typeof body !== "string" || body === "" || body.length > BODY_LIMIT)
|
|
87
|
+
return null;
|
|
88
|
+
let value;
|
|
89
|
+
try {
|
|
90
|
+
value = JSON.parse(body);
|
|
91
|
+
if (!record(value) || JSON.stringify(value) !== body)
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
return value;
|
|
98
|
+
}
|
|
99
|
+
function midtransBodyVerdict(body) {
|
|
100
|
+
const value = readBody(body);
|
|
101
|
+
if (value === null || !inOrder(value, MIDTRANS_TOKEN_KEYS)) {
|
|
102
|
+
if (record(value) && (own(value, "token_id") || own(value, "two_click")) && !own(value, "card_number"))
|
|
103
|
+
return refuse("midtrans_saved_card");
|
|
104
|
+
return refuse("midtrans_body_unsupported");
|
|
105
|
+
}
|
|
106
|
+
if (!own(value, "card_cvv") || !own(value, "card_number") || !own(value, "card_exp_month") || !own(value, "card_exp_year")) {
|
|
107
|
+
return refuse("midtrans_body_unsupported");
|
|
108
|
+
}
|
|
109
|
+
if (typeof value.card_cvv !== "string" || !SECURITY_CODE.test(value.card_cvv) || typeof value.card_number !== "string" || !CARD_NUMBER.test(value.card_number) || typeof value.card_exp_month !== "string" || !MONTH.test(value.card_exp_month) || typeof value.card_exp_year !== "string" || !YEAR.test(value.card_exp_year))
|
|
110
|
+
return refuse("midtrans_body_unsupported");
|
|
111
|
+
if (own(value, "installment_term") && (typeof value.installment_term !== "string" || !TERM.test(value.installment_term)))
|
|
112
|
+
return refuse("midtrans_body_unsupported");
|
|
113
|
+
return CARD;
|
|
114
|
+
}
|
|
115
|
+
var midtrans_default = /* @__PURE__ */ registerProcessor({
|
|
116
|
+
psp: MIDTRANS_PSP,
|
|
117
|
+
definitions: [
|
|
118
|
+
{
|
|
119
|
+
psp: "midtrans",
|
|
120
|
+
// Snap's token request, as the header above reads it. Sandbox has its own host, so the device sends a
|
|
121
|
+
// test-mode request only Midtrans' documented test cards (hostEnvironmentPinned, device-replay.js S7).
|
|
122
|
+
// Ships dark: served only to a client that declares `midtrans_card_token`, gated off for every org until an
|
|
123
|
+
// operator lists one (`midtrans:<org>`), and the backend's gate serves only Agentcard's own company until the
|
|
124
|
+
// token's publishable key is bound to the merchant (backend config.ts MIDTRANS_KEY_BOUND_TO_MERCHANT).
|
|
125
|
+
capability: "midtrans_card_token",
|
|
126
|
+
match: "api\\.(?:sandbox\\.)?midtrans\\.com/v2/token",
|
|
127
|
+
hosts: ["^api\\.midtrans\\.com$", "^api\\.sandbox\\.midtrans\\.com$"],
|
|
128
|
+
sandboxHosts: ["^api\\.sandbox\\.midtrans\\.com$"],
|
|
129
|
+
hostEnvironmentPinned: true,
|
|
130
|
+
encoding: "json",
|
|
131
|
+
// Snap's own headers: the publishable client key (Authorization Basic) and X-Service. Origin, Referer and
|
|
132
|
+
// cookies never ride.
|
|
133
|
+
passthroughHeaders: ["^authorization$", "^x-service$"],
|
|
134
|
+
jsonCardFields: [["card_number"]]
|
|
135
|
+
}
|
|
136
|
+
],
|
|
137
|
+
// Only the cardholder's device sends a token, after a person approves; no reviewed list names midtrans.
|
|
138
|
+
refusedOperations: [MIDTRANS_OPERATION],
|
|
139
|
+
// Not surveyed: the token moves no money, and the merchant's own charge names its status by the order id alone.
|
|
140
|
+
settlementReadback: "not_surveyed",
|
|
141
|
+
exactUrl: isMidtransTokenUrl,
|
|
142
|
+
bodyGate: (url, body) => url !== void 0 && !isMidtransTokenUrl(url) ? { verdict: "refuse", code: "midtrans_url_refused" } : midtransBodyVerdict(body)
|
|
143
|
+
});
|
|
144
|
+
// src/processors/index.generated.js
|
|
145
|
+
var REGISTERED_MODULES = Object.freeze({
|
|
146
|
+
midtrans: midtrans_default
|
|
147
|
+
});
|
|
148
|
+
// src/registry.js
|
|
149
|
+
var REGISTERED_PROCESSORS = Object.values(REGISTERED_MODULES);
|
|
150
|
+
var ids = REGISTERED_PROCESSORS.map((processor) => processor.psp);
|
|
151
|
+
var problems = REGISTERED_PROCESSORS.flatMap(registrationProblems);
|
|
152
|
+
for (const [name, processor] of Object.entries(REGISTERED_MODULES)) {
|
|
153
|
+
if (processor.psp !== name)
|
|
154
|
+
problems.push(`processors/${name}.js registers ${JSON.stringify(processor.psp)}`);
|
|
155
|
+
}
|
|
156
|
+
if (ids.some((id, i) => i > 0 && ids[i - 1] >= id))
|
|
157
|
+
problems.push(`registered processors out of id order: ${ids.join(", ")}`);
|
|
158
|
+
if (problems.length)
|
|
159
|
+
throw new Error(`payment-core registry refused: ${problems.join("; ")}`);
|
|
160
|
+
var BY_PSP = new Map(REGISTERED_PROCESSORS.map((processor) => [processor.psp, processor]));
|
|
161
|
+
var REGISTERED_IDS = Object.freeze(ids);
|
|
162
|
+
var REGISTERED_DEFINITIONS = Object.freeze(REGISTERED_PROCESSORS.flatMap((processor) => processor.definitions));
|
|
163
|
+
var REGISTERED_REFUSED_OPERATIONS = Object.freeze(REGISTERED_PROCESSORS.flatMap((processor) => processor.refusedOperations ?? []));
|
|
164
|
+
var REGISTERED_SETTLEMENT_READBACK = Object.freeze(REGISTERED_PROCESSORS.filter((processor) => processor.settlementReadback !== void 0).map((processor) => [processor.psp, processor.settlementReadback]));
|
|
13
165
|
// src/definitions.js
|
|
14
166
|
var PROCESSOR_DEFINITIONS = deepFreeze([
|
|
15
167
|
{
|
|
@@ -563,8 +715,9 @@ var PROCESSOR_DEFINITIONS = deepFreeze([
|
|
|
563
715
|
// posts the card there in that same session, and the runtime resolves the paused navigation with the
|
|
564
716
|
// hosted_form notice. Only the entry path is matched, exactly (processors/paytrail.js isPaytrailEntryUrl:
|
|
565
717
|
// a query would reach Paytrail's server beside the signed body). The card page and its card, wallet and
|
|
566
|
-
// card-number lookups live on Payment Highway's host, which no recognizer takes
|
|
567
|
-
//
|
|
718
|
+
// card-number lookups live on Payment Highway's host, which no recognizer takes: it is an abort host, armed in
|
|
719
|
+
// the SDK's adapters so the SDK's Paytrail gate refuses every card request the agent's browser sends there,
|
|
720
|
+
// and no dummy card reaches Payment Highway. The entry names no amount: Paytrail
|
|
568
721
|
// holds it, so the cardholder approves the agent's amount and the device holds it to the amount the card
|
|
569
722
|
// page names. Paytrail's public test merchant shares this host, so the host marks no environment. Dark:
|
|
570
723
|
// served only to a client that declares the capability, and gated off for every org the operator has not
|
|
@@ -572,6 +725,9 @@ var PROCESSOR_DEFINITIONS = deepFreeze([
|
|
|
572
725
|
capability: "paytrail_hosted_payment_page",
|
|
573
726
|
match: "services\\.paytrail\\.com/payments/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/click-to-pay/loading-and-redirect",
|
|
574
727
|
hosts: ["^services\\.paytrail\\.com$"],
|
|
728
|
+
// Payment Highway's live host (processors/paytrail.js PAYMENT_HIGHWAY_HOSTS), which no recognizer takes: an SDK that
|
|
729
|
+
// declares the capability arms it so its gate can refuse the card posts the agent's browser sends there.
|
|
730
|
+
abortHosts: ["^v1\\.api\\.paymenthighway\\.io$"],
|
|
575
731
|
encoding: "form",
|
|
576
732
|
passthroughHeaders: [],
|
|
577
733
|
mode: "hosted_form",
|
|
@@ -2752,7 +2908,127 @@ var PROCESSOR_DEFINITIONS = deepFreeze([
|
|
|
2752
2908
|
// Referer and cookies never ride.
|
|
2753
2909
|
passthroughHeaders: ["^authorization$", "^client-type$", "^client-version$", "^client-id$"],
|
|
2754
2910
|
jsonCardFields: [["card_data", "account_number"]]
|
|
2755
|
-
}
|
|
2911
|
+
},
|
|
2912
|
+
{
|
|
2913
|
+
psp: "sb_payment_service",
|
|
2914
|
+
// SB Payment Service (SBPS), SoftBank's card gateway: its one-time token script on the merchant's
|
|
2915
|
+
// page (com_sbps_system_token.js) encrypts the card in the page and sends it as ONE JSONP <script>
|
|
2916
|
+
// GET to /token/generateToken on token.sps-system.com (stbtoken.sps-system.com for SBPS's test
|
|
2917
|
+
// environment), the card in the query: val is AES-256-CBC of "number:YYYYMM:code" under a PBKDF2 key
|
|
2918
|
+
// over the merchant and service ids, and key is the salt and iv RSA-wrapped under SBPS's key in the
|
|
2919
|
+
// script. sbps.js holds the request rule the pause decision, the API's create and the device all
|
|
2920
|
+
// read: the exact URL the browser writes for the script's <script>, so the 3-D Secure info request
|
|
2921
|
+
// on the same host (/token/generateTds2Token, the buyer's details and no card) is never recognized.
|
|
2922
|
+
// Nothing can be written into the paused ciphertext: the cardholder's device rebuilds key and val
|
|
2923
|
+
// with the real card under the key payment-core pins, and sends the GET through the checkout relay,
|
|
2924
|
+
// since the host answers no browser origin and answers with JavaScript.
|
|
2925
|
+
// Ships dark: served only to a client that declares `sbps_token_jsonp`, gated off for every org until
|
|
2926
|
+
// an operator lists one (`sb_payment_service:<org>`), held to the merchants sbps.js pins per checkout
|
|
2927
|
+
// origin, and autopilot never sends this request (autopilot.js DEVICE_REPLAY_REFUSED_OPERATIONS). The
|
|
2928
|
+
// environment is pinned (S7): stbtoken only on test rows and only with documented test cards.
|
|
2929
|
+
capability: "sbps_token_jsonp",
|
|
2930
|
+
// The path has a right-edge guard for the SDK's unanchored test.
|
|
2931
|
+
match: "(?:stb)?token\\.sps-system\\.com/token/generateToken(?![\\w/.-])",
|
|
2932
|
+
hosts: ["^token\\.sps-system\\.com$", "^stbtoken\\.sps-system\\.com$"],
|
|
2933
|
+
sandboxHosts: ["^stbtoken\\.sps-system\\.com$"],
|
|
2934
|
+
hostEnvironmentPinned: true,
|
|
2935
|
+
// `encoding` describes the query, since the request has no body. No captured header is ever
|
|
2936
|
+
// replayed, and the card rides in the query of one GET whose answer is JSONP.
|
|
2937
|
+
encoding: "form",
|
|
2938
|
+
passthroughHeaders: [],
|
|
2939
|
+
request: { method: "GET", cardIn: "query", response: "jsonp" }
|
|
2940
|
+
},
|
|
2941
|
+
{
|
|
2942
|
+
psp: "tappay",
|
|
2943
|
+
// TapPay (Cherri Tech, Taiwan): TapPay Fields, the card iframes every TPDirect integration mounts from
|
|
2944
|
+
// js.tappaysdk.com (confirmed live 2026-10-17). TPDirect.card.getPrime makes TapPay's own api iframe
|
|
2945
|
+
// (js.tappaysdk.com/sdk/tpdirect/api/html/<version>) read the three field iframes and POST one request:
|
|
2946
|
+
// POST https://js.tappaysdk.com/payment/tpdirect/production/getprime
|
|
2947
|
+
// Content-Type: application/x-www-form-urlencoded, x-api-key: <the merchant's TapPay app key>
|
|
2948
|
+
// jsonString={"cardnumber":...,"cardduedate":"<YYYYMM>","appid":...,"appkey":...,"appname":...,
|
|
2949
|
+
// "url":...,"port":...,"protocol":...,"tappay_sdk_version":...,"cardholder_info":{...}[,"cardccv":...][,"device_id":...]}
|
|
2950
|
+
// The one form field jsonString holds the whole card request as the SDK's JSON.stringify. tappay.js
|
|
2951
|
+
// holds the request rule, the pause decision, the device fill and the answer judge; the card sits at
|
|
2952
|
+
// cardnumber, cardduedate (TapPay's "20"+YY+MM, so YYYYMM) and the optional cardccv. The request names no
|
|
2953
|
+
// amount and mints a prime (one-time token, 90-second TTL) the merchant's server charges with Pay by
|
|
2954
|
+
// Prime, where 3-D Secure runs (three_domain_secure), never in this request. The api iframe posts same
|
|
2955
|
+
// origin, so a replay from the Vault's origin is cross-origin and its x-api-key preflight is refused
|
|
2956
|
+
// (OPTIONS to getprime drew 403 with no Access-Control-Allow-Origin, 2026-10-17), so the card leaves the
|
|
2957
|
+
// cardholder's device only through the checkout relay, and tappayAnswerOutcome judges the answer, since
|
|
2958
|
+
// TapPay reports a refusal inside HTTP 200 with a non-zero status. One host serves every merchant, so a
|
|
2959
|
+
// live card is tokenized only for a checkout origin a reviewed pin lists (tappay.js tappayMerchantRefusal)
|
|
2960
|
+
// and the approval names that merchant. TapPay's sandbox is the same host with the /sandbox/ path and so
|
|
2961
|
+
// cannot be told from production by host (hostEnvironment is host based): this lane recognizes production
|
|
2962
|
+
// only, as Wix Payments does, and a sandbox test run is a later change.
|
|
2963
|
+
// Ships dark: served only to a client that declares `tappay_prime`, gated off for every org until an
|
|
2964
|
+
// operator lists one (`tappay:<org>`), and autopilot never sends this request (autopilot.js
|
|
2965
|
+
// DEVICE_REPLAY_REFUSED_OPERATIONS).
|
|
2966
|
+
capability: "tappay_prime",
|
|
2967
|
+
match: "js\\.tappaysdk\\.com/payment/tpdirect/production/getprime",
|
|
2968
|
+
hosts: ["^js\\.tappaysdk\\.com$"],
|
|
2969
|
+
encoding: "form",
|
|
2970
|
+
passthroughHeaders: ["^x-api-key$"]
|
|
2971
|
+
},
|
|
2972
|
+
{
|
|
2973
|
+
psp: "paymob",
|
|
2974
|
+
// Paymob's own checkout (Egypt, the UAE, Saudi Arabia, Oman): Unified Checkout, the hosted page every
|
|
2975
|
+
// Paymob payment link, PayMe handle, WooCommerce plugin and Shopify redirect app opens, and Pixel, the
|
|
2976
|
+
// card frame a merchant's own page embeds. Pay sends the card in one JSON POST to the Paymob API of the
|
|
2977
|
+
// merchant's country, /api/acceptance/payments/pay on accept., uae., ksa. or oman.paymob.com (and
|
|
2978
|
+
// accept.paymobsolutions.com, Paymob Egypt's older name for the same API): {source: {identifier,
|
|
2979
|
+
// sourceholder_name, subtype: "CARD", expiry_month, expiry_year, cvn, ...}, payment_token, ...}.
|
|
2980
|
+
// Unencrypted. The request names no amount of its own: its payment key, Paymob's signed JWT for the
|
|
2981
|
+
// merchant's intention, names the amount and currency Paymob charges. paymob.js holds the rule the
|
|
2982
|
+
// pause decision reads: the exact URL, a JSON content type, and the card form's payment, key by key,
|
|
2983
|
+
// with a saved Paymob card, a payment that keeps the card, pays in installments, splits, converts or
|
|
2984
|
+
// names a Paymob account, and any other card shape refused. Every other method of the checkout
|
|
2985
|
+
// (wallets, Apple Pay, Google Pay, KNET, valU, cash) carries no card on the same URL and continues
|
|
2986
|
+
// untouched (passWithoutCard). The API answers any origin's preflight, so the cardholder's device
|
|
2987
|
+
// sends the card itself; no header is needed beside the content type. 3-D Secure follows the answer,
|
|
2988
|
+
// with no card. Test and live modes share the hosts (test keys and integrations separate them), so no
|
|
2989
|
+
// sandbox host is marked.
|
|
2990
|
+
// Ships dark: served only to a client that declares `paymob_checkout_pay`, gated off for every org
|
|
2991
|
+
// until an operator lists one (`paymob:<org>`), and autopilot never sends this request
|
|
2992
|
+
// (autopilot.js DEVICE_REPLAY_REFUSED_OPERATIONS).
|
|
2993
|
+
capability: "paymob_checkout_pay",
|
|
2994
|
+
match: "(?:accept|uae|ksa|oman)\\.paymob\\.com/api/acceptance/payments/pay|accept\\.paymobsolutions\\.com/api/acceptance/payments/pay",
|
|
2995
|
+
hosts: ["^accept\\.paymob\\.com$", "^uae\\.paymob\\.com$", "^ksa\\.paymob\\.com$", "^oman\\.paymob\\.com$", "^accept\\.paymobsolutions\\.com$"],
|
|
2996
|
+
encoding: "json",
|
|
2997
|
+
passthroughHeaders: [],
|
|
2998
|
+
jsonCardFields: [["source", "identifier"]],
|
|
2999
|
+
passWithoutCard: "(?:accept|uae|ksa|oman)\\.paymob\\.com/api/acceptance/payments/pay|accept\\.paymobsolutions\\.com/api/acceptance/payments/pay"
|
|
3000
|
+
},
|
|
3001
|
+
{
|
|
3002
|
+
psp: "payu_latam",
|
|
3003
|
+
// PayU Latam's WebCheckout (Colombia, Mexico, Chile, Peru, Panama), the hosted page a PayU Latam
|
|
3004
|
+
// merchant's payment form, button, link or cart plugin opens at checkout.payulatam.com. Its card form
|
|
3005
|
+
// posts the whole checkout transaction as JSON to /ppp-web-gateway-payu/checkout/submit/<country>
|
|
3006
|
+
// /credit_card/<session key> on the page's own host, the card in checkoutCreditCard: the number as the
|
|
3007
|
+
// field's mask spells it, the code, and the month and two-digit year as numbers. The body copies the
|
|
3008
|
+
// order PayU holds for the session, but PayU charges its own, so the amount is the agent's (no request
|
|
3009
|
+
// amount in backend.js). payu-latam.js holds the rule the
|
|
3010
|
+
// pause decision reads: the exact URL with a country this lane read, and the card form's own body, with
|
|
3011
|
+
// the box that has PayU keep the card, a card PayU saved, a wallet, installments and a test order on
|
|
3012
|
+
// the live host refused. The page's BIN lookup (checkout/card_info/) and its 3-D Secure redirect use
|
|
3013
|
+
// other paths, which `match` leaves out; `(?![\w/;.%-])` ends the key for a consumer that tests `match`
|
|
3014
|
+
// unanchored. The submit answers a CORS preflight from any origin, so the cardholder's device can send
|
|
3015
|
+
// the card itself. Ships dark: served only to a client that declares
|
|
3016
|
+
// `payu_latam_webcheckout_card`, gated off for every org until an operator lists one
|
|
3017
|
+
// (`payu_latam:<org>`), and autopilot never sends this request (autopilot.js
|
|
3018
|
+
// DEVICE_REPLAY_REFUSED_OPERATIONS). The environment is pinned (S7): sandbox.checkout.payulatam.com
|
|
3019
|
+
// only on test rows and only with documented test cards.
|
|
3020
|
+
capability: "payu_latam_webcheckout_card",
|
|
3021
|
+
match: "(?:sandbox\\.)?checkout\\.payulatam\\.com/ppp-web-gateway-payu/checkout/submit/(?:ar|br|cl|co|mx|pa|pe)/credit_card/[0-9a-f]{32}(?![\\w/;.%-])",
|
|
3022
|
+
hosts: ["^checkout\\.payulatam\\.com$", "^sandbox\\.checkout\\.payulatam\\.com$"],
|
|
3023
|
+
sandboxHosts: ["^sandbox\\.checkout\\.payulatam\\.com$"],
|
|
3024
|
+
hostEnvironmentPinned: true,
|
|
3025
|
+
encoding: "json",
|
|
3026
|
+
// AngularJS's Accept, which the page sends on every $http call. Cookies, Origin and Referer never ride.
|
|
3027
|
+
passthroughHeaders: ["^accept$"],
|
|
3028
|
+
jsonCardFields: [["checkoutCreditCard", "number"]]
|
|
3029
|
+
},
|
|
3030
|
+
// Every processor registered since this list froze, in id order (registry.js).
|
|
3031
|
+
...REGISTERED_DEFINITIONS
|
|
2756
3032
|
]);
|
|
2757
3033
|
var PSP_RECOGNIZERS = deepFreeze(PROCESSOR_DEFINITIONS.map(({ compose, encryptedCardFields, deviceSteps, deviceEncrypt, ...definition }) => definition));
|
|
2758
3034
|
var PSP_CLIENT_TABLE = deepFreeze(PROCESSOR_DEFINITIONS.map((definition) => ({
|
|
@@ -2992,7 +3268,7 @@ var HIPAY_MERCHANT_PINS = /* @__PURE__ */ Object.freeze([
|
|
|
2992
3268
|
pin6({ id: "happybulle", merchant: "HappyBulle", origins: ["https://www.happybulle.com"], usernames: ["94683309.secure-gateway.hipay-tpp.com"] })
|
|
2993
3269
|
]);
|
|
2994
3270
|
// src/amazon-payment-services.js
|
|
2995
|
-
var
|
|
3271
|
+
var BODY_LIMIT2 = 32 * 1024;
|
|
2996
3272
|
var ANSWER_LIMIT = 64 * 1024;
|
|
2997
3273
|
// src/clover.js
|
|
2998
3274
|
var REQUIRED_KEYS = /* @__PURE__ */ Object.freeze(["encrypted_pan", "exp_month", "exp_year", "cvv", "first6", "last4", "brand"]);
|
|
@@ -3215,6 +3491,159 @@ var OMISE_MERCHANT_PINS = /* @__PURE__ */ Object.freeze([
|
|
|
3215
3491
|
pin10({ id: "socialgiver", merchant: "Socialgiver", origins: ["https://www.socialgiver.com"], keys: ["pkey_5d5o2iahksmyrkybemg"] }),
|
|
3216
3492
|
pin10({ id: "thireq_pecko_links", merchant: "Thireq Pecko", origins: ["https://linksplus.omise.co"], keys: ["pkey_65w70xniwsinf0gm680"] })
|
|
3217
3493
|
]);
|
|
3494
|
+
// src/payu-latam.js
|
|
3495
|
+
var PAYU_LATAM_HOSTS = /* @__PURE__ */ Object.freeze({
|
|
3496
|
+
production: Object.freeze(["checkout.payulatam.com"]),
|
|
3497
|
+
sandbox: Object.freeze(["sandbox.checkout.payulatam.com"])
|
|
3498
|
+
});
|
|
3499
|
+
var ADDRESS = ["street1", "street2", "street3", "city", "state", "country", "postalCode", "phone"];
|
|
3500
|
+
var PERSON = [
|
|
3501
|
+
"fullName",
|
|
3502
|
+
"emailAddress",
|
|
3503
|
+
"contactPhone",
|
|
3504
|
+
"phoneCountryCode",
|
|
3505
|
+
"dniNumber",
|
|
3506
|
+
"isDniNumberEncrypt",
|
|
3507
|
+
"dniType",
|
|
3508
|
+
"personType",
|
|
3509
|
+
"businessName",
|
|
3510
|
+
"cnpj",
|
|
3511
|
+
"gender"
|
|
3512
|
+
];
|
|
3513
|
+
var MONEY = ["value", "symbol", "currency"];
|
|
3514
|
+
var RECORD_MEMBERS = /* @__PURE__ */ Object.freeze({
|
|
3515
|
+
payer: [...PERSON, "merchantBuyerId", "billingAddress", "birthDate", "identificationNumber", "identificationType"],
|
|
3516
|
+
"payer.billingAddress": ADDRESS,
|
|
3517
|
+
order: [
|
|
3518
|
+
"id",
|
|
3519
|
+
"referenceCode",
|
|
3520
|
+
"airlineCode",
|
|
3521
|
+
"description",
|
|
3522
|
+
"isTest",
|
|
3523
|
+
"signature",
|
|
3524
|
+
"language",
|
|
3525
|
+
"buyer",
|
|
3526
|
+
"shipment",
|
|
3527
|
+
"state",
|
|
3528
|
+
"status",
|
|
3529
|
+
"paymentApprovalDate",
|
|
3530
|
+
"creationDate",
|
|
3531
|
+
"accountId",
|
|
3532
|
+
"amount",
|
|
3533
|
+
"tax",
|
|
3534
|
+
"totalPurchase",
|
|
3535
|
+
"currency",
|
|
3536
|
+
"amountConvertedValue",
|
|
3537
|
+
"taxConvertedValue",
|
|
3538
|
+
"taxReturnBase",
|
|
3539
|
+
"taxReturnBaseConvertedValue",
|
|
3540
|
+
"additionalValue",
|
|
3541
|
+
"administrativeFee",
|
|
3542
|
+
"taxAdministrativeFee",
|
|
3543
|
+
"taxAdministrativeFeeReturnBase",
|
|
3544
|
+
"enabledPaymentMethods",
|
|
3545
|
+
"enabledInstallments",
|
|
3546
|
+
"enabledPaymentMethodTypes",
|
|
3547
|
+
"enabledIin",
|
|
3548
|
+
"enabledPseBanks",
|
|
3549
|
+
"enabledKhipuBanks",
|
|
3550
|
+
"paymentMethodsDescription",
|
|
3551
|
+
"urlEncodedId",
|
|
3552
|
+
"shippingValue",
|
|
3553
|
+
"paymentRequestLinkId",
|
|
3554
|
+
"airlineDescription",
|
|
3555
|
+
"displayShipping",
|
|
3556
|
+
"displayBuyerComments",
|
|
3557
|
+
"buyerCommentsLabel",
|
|
3558
|
+
"extraParameters",
|
|
3559
|
+
"dispersion"
|
|
3560
|
+
],
|
|
3561
|
+
"order.buyer": [...PERSON, "merchantBuyerId", "buyerAddress", "comments"],
|
|
3562
|
+
"order.buyer.buyerAddress": ADDRESS,
|
|
3563
|
+
"order.shipment": [...PERSON, "merchantShipmentId", "shippingAddress", "comments"],
|
|
3564
|
+
"order.shipment.shippingAddress": ADDRESS,
|
|
3565
|
+
"order.amount": MONEY,
|
|
3566
|
+
"order.tax": MONEY,
|
|
3567
|
+
"order.totalPurchase": MONEY,
|
|
3568
|
+
"order.amountConvertedValue": MONEY,
|
|
3569
|
+
"order.taxConvertedValue": MONEY,
|
|
3570
|
+
"order.taxReturnBase": MONEY,
|
|
3571
|
+
"order.taxReturnBaseConvertedValue": MONEY,
|
|
3572
|
+
shippingInfo: [
|
|
3573
|
+
"userLogin",
|
|
3574
|
+
"id",
|
|
3575
|
+
"reference",
|
|
3576
|
+
"description",
|
|
3577
|
+
"currency",
|
|
3578
|
+
"deliveryCity",
|
|
3579
|
+
"deliveryCityName",
|
|
3580
|
+
"deliveryAddress1",
|
|
3581
|
+
"deliveryAddress2",
|
|
3582
|
+
"deliveryAddress3",
|
|
3583
|
+
"postalCode",
|
|
3584
|
+
"fullName",
|
|
3585
|
+
"documentType",
|
|
3586
|
+
"document",
|
|
3587
|
+
"phoneNumber",
|
|
3588
|
+
"observationsReceivingShipment",
|
|
3589
|
+
"destinationState",
|
|
3590
|
+
"destinationStateName",
|
|
3591
|
+
"destinationCountry",
|
|
3592
|
+
"destinationEmail",
|
|
3593
|
+
"originFullName",
|
|
3594
|
+
"originIdentificationType",
|
|
3595
|
+
"originIdentification",
|
|
3596
|
+
"originCity",
|
|
3597
|
+
"originState",
|
|
3598
|
+
"originCountry",
|
|
3599
|
+
"originAddress",
|
|
3600
|
+
"originZipCode",
|
|
3601
|
+
"originPhone",
|
|
3602
|
+
"originEmail",
|
|
3603
|
+
"kilogramWeight",
|
|
3604
|
+
"volumetricWeight",
|
|
3605
|
+
"totalValue",
|
|
3606
|
+
"declaredValue",
|
|
3607
|
+
"shippingValue",
|
|
3608
|
+
"guideNumber",
|
|
3609
|
+
"enlistmentApplies",
|
|
3610
|
+
"deliveryDate",
|
|
3611
|
+
"deliveryDays",
|
|
3612
|
+
"minDeliveryDays",
|
|
3613
|
+
"packageHeight",
|
|
3614
|
+
"packageWidth",
|
|
3615
|
+
"packageLength",
|
|
3616
|
+
"shippingProvider",
|
|
3617
|
+
"shippingState",
|
|
3618
|
+
"creationDate",
|
|
3619
|
+
"lastUpdateDate",
|
|
3620
|
+
"expirationDate",
|
|
3621
|
+
"signature",
|
|
3622
|
+
"strCreationDate",
|
|
3623
|
+
"comment",
|
|
3624
|
+
"warehouseId",
|
|
3625
|
+
"additionalDeliveryDays",
|
|
3626
|
+
"shippingMerchantValue"
|
|
3627
|
+
],
|
|
3628
|
+
// PayU's own ten, as transaction/create names them, and the merchant's extra1 to extra4 (the payment form's
|
|
3629
|
+
// optional fields), each text or nothing.
|
|
3630
|
+
"order.extraParameters": [
|
|
3631
|
+
"CURRENCY",
|
|
3632
|
+
"LANGUAGE",
|
|
3633
|
+
"ACCOUNT_ID",
|
|
3634
|
+
"ALGORITHM_SIGNATURE",
|
|
3635
|
+
"CHECKOUT_VERSION",
|
|
3636
|
+
"RESPONSE_URL",
|
|
3637
|
+
"IS_TEST",
|
|
3638
|
+
"SIGNATURE",
|
|
3639
|
+
"NOTIFY_URL",
|
|
3640
|
+
"IP_COUNTRY",
|
|
3641
|
+
"EXTRA1",
|
|
3642
|
+
"EXTRA2",
|
|
3643
|
+
"EXTRA3",
|
|
3644
|
+
"EXTRA4"
|
|
3645
|
+
]
|
|
3646
|
+
});
|
|
3218
3647
|
// src/cybersource-secure-acceptance.js
|
|
3219
3648
|
var SA_BODY_LIMIT = 32 * 1024;
|
|
3220
3649
|
var SA_REPLY_LIMIT = 64 * 1024;
|
|
@@ -3550,7 +3979,8 @@ var TRANSBANK_MERCHANTS = Object.freeze([
|
|
|
3550
3979
|
fantasyName: null,
|
|
3551
3980
|
merchant: "Teleférico Santiago",
|
|
3552
3981
|
hosts: Object.freeze(["telefericosantiago.cl"]),
|
|
3553
|
-
returnHost: "telefericosantiago.cl"
|
|
3982
|
+
returnHost: "telefericosantiago.cl",
|
|
3983
|
+
returnUrl: null
|
|
3554
3984
|
})
|
|
3555
3985
|
]);
|
|
3556
3986
|
var MAX_PAGE5 = 64 * 1024;
|
|
@@ -3568,7 +3998,9 @@ var PAYTRAIL_ENTRY_FIELDS = Object.freeze([
|
|
|
3568
3998
|
"checkout-nonce",
|
|
3569
3999
|
"signature"
|
|
3570
4000
|
]);
|
|
3571
|
-
var PAYTRAIL_MERCHANTS = Object.freeze([
|
|
4001
|
+
var PAYTRAIL_MERCHANTS = Object.freeze([
|
|
4002
|
+
Object.freeze({ account: "1076015", merchant: "DofE Finland", paytrailName: "Avartti-säätiö", returnHost: "dofe.fi" })
|
|
4003
|
+
]);
|
|
3572
4004
|
var UUID_SOURCE = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
|
|
3573
4005
|
var UUID2 = new RegExp(`^${UUID_SOURCE}$`);
|
|
3574
4006
|
var ENTRY_PATH = new RegExp(`^/payments/(${UUID_SOURCE})/click-to-pay/loading-and-redirect$`);
|
|
@@ -3673,6 +4105,23 @@ var DECLINE_CODES = Object.freeze([
|
|
|
3673
4105
|
"AccountSuspended"
|
|
3674
4106
|
]);
|
|
3675
4107
|
var FRICTIONLESS_STATUSES = Object.freeze([0, 5, 7]);
|
|
4108
|
+
// src/sbps.js
|
|
4109
|
+
var pin11 = (fields) => /* @__PURE__ */ Object.freeze({
|
|
4110
|
+
...fields,
|
|
4111
|
+
origins: Object.freeze([...fields.origins]),
|
|
4112
|
+
accounts: Object.freeze(fields.accounts.map((account) => Object.freeze({ ...account })))
|
|
4113
|
+
});
|
|
4114
|
+
var SBPS_MERCHANT_PINS = /* @__PURE__ */ Object.freeze([
|
|
4115
|
+
/* @__PURE__ */ pin11({
|
|
4116
|
+
id: "boss_ezo_fukuoka",
|
|
4117
|
+
merchant: `BOSS E${ /* @__PURE__ */String.fromCharCode(12539)}ZO FUKUOKA`,
|
|
4118
|
+
origins: ["https://ticket.e-zofukuoka.com"],
|
|
4119
|
+
accounts: [{ merchantId: "75082", serviceId: "001" }]
|
|
4120
|
+
})
|
|
4121
|
+
]);
|
|
4122
|
+
var ERROR_TYPES = /* @__PURE__ */ Object.freeze(["03", "04", "05", "07", "99"]);
|
|
4123
|
+
var ERROR_FIELDS = /* @__PURE__ */ Object.freeze(["001", "002", "003", "004", "005", "999"]);
|
|
4124
|
+
var SBPS_REFUSAL_CODES = /* @__PURE__ */ Object.freeze(ERROR_TYPES.flatMap((type) => ERROR_FIELDS.map((field) => `${type}${field}`)));
|
|
3676
4125
|
// src/recognition.js
|
|
3677
4126
|
var PATTERN_WITHOUT_CARD_FIELDS = Object.freeze({
|
|
3678
4127
|
stripe: "api\\.stripe\\.com/v1/(payment_methods|tokens|setup_intents/seti_\\w+/confirm|payment_intents/pi_\\w+/confirm)"
|
package/dist/transbank.d.ts
CHANGED
|
@@ -43,3 +43,36 @@ export declare function servesTransbank(vault: {
|
|
|
43
43
|
export declare function isArmedTransbankUrl(vault: {
|
|
44
44
|
isCardRequest(url: string, method?: string): boolean;
|
|
45
45
|
} | undefined, url: string): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* A reviewed Webpay shop, as this build reads it to send the browser back: the hosts of its checkout pages, the host of
|
|
48
|
+
* its return page, and the return page itself, exactly as its transactions name it (null while nobody has read it).
|
|
49
|
+
*/
|
|
50
|
+
export interface TransbankReturnPage {
|
|
51
|
+
readonly hosts: readonly string[];
|
|
52
|
+
readonly returnHost: string;
|
|
53
|
+
readonly returnUrl: string | null;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* payment-core's TRANSBANK_MERCHANTS, every row that names its commerce code, with these three fields. A row without a
|
|
57
|
+
* code names no shop there, so it is not listed here. transbank.test.mjs pins this list to payment-core's, so a reviewed
|
|
58
|
+
* change that codes a shop there fails this package's tests until the shop is listed here too. Teleférico Santiago's
|
|
59
|
+
* row names no code yet, so no paused entry is sent back anywhere.
|
|
60
|
+
*/
|
|
61
|
+
export declare const TRANSBANK_RETURN_PAGES: readonly TransbankReturnPage[];
|
|
62
|
+
/**
|
|
63
|
+
* Where the paused Webpay entry `entryUrl` goes once the cardholder's phone has paid it: the return page of the one
|
|
64
|
+
* reviewed shop whose checkout pages include `pageOrigin` (the origin the create named, written exactly as an origin),
|
|
65
|
+
* with the entry's token as `token_ws`. The same navigation payment-core's transbankMerchantReturn builds, and the one
|
|
66
|
+
* Webpay itself sends the phone's session to. Null for a link that is not Webpay's entry, a page no reviewed shop
|
|
67
|
+
* lists, a page two list, or a shop whose return page no token can follow. `pages` is for tests.
|
|
68
|
+
*/
|
|
69
|
+
export declare function transbankMerchantReturn(entryUrl: unknown, pageOrigin: unknown, pages?: readonly TransbankReturnPage[]): string | null;
|
|
70
|
+
/**
|
|
71
|
+
* The answer the paused entry gets: a 303 to the shop's return page, which the browser follows with a GET, and which no
|
|
72
|
+
* cache keeps (the URL carries Webpay's token).
|
|
73
|
+
*/
|
|
74
|
+
export declare function transbankMerchantReturnAnswer(returnUrl: string): {
|
|
75
|
+
status: 303;
|
|
76
|
+
headers: Record<string, string>;
|
|
77
|
+
body: string;
|
|
78
|
+
};
|