@agent-cards/sdk 0.23.13 → 0.23.15
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 +39 -0
- package/PREFLIGHT.md +3 -1
- package/README.md +54 -13
- package/dist/adyen-merchant-hosted.generated.js +2 -2
- package/dist/amadeus.d.ts +5 -2
- package/dist/amadeus.js +17 -3
- package/dist/card-fields.generated.js +924 -3
- package/dist/cdp.js +83 -19
- package/dist/client.d.ts +97 -1
- package/dist/client.js +235 -16
- package/dist/creditguard.generated.d.ts +100 -2
- package/dist/creditguard.generated.js +333 -3
- package/dist/datatrans.generated.d.ts +19 -4
- package/dist/datatrans.generated.js +15 -3
- package/dist/ebanx.d.ts +107 -0
- package/dist/ebanx.generated.d.ts +78 -0
- package/dist/ebanx.generated.js +577 -0
- package/dist/ebanx.js +159 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/lifecycle.d.ts +32 -5
- package/dist/lifecycle.js +40 -5
- package/dist/paddle-tokenex.d.ts +56 -0
- package/dist/paddle-tokenex.generated.d.ts +67 -0
- package/dist/paddle-tokenex.generated.js +951 -0
- package/dist/paddle-tokenex.js +95 -0
- package/dist/paypal-card-forms.d.ts +73 -0
- package/dist/paypal-card-forms.js +126 -0
- package/dist/pre-claim.d.ts +39 -1
- package/dist/pre-claim.js +348 -18
- package/dist/preparation.d.ts +13 -0
- package/dist/preparation.js +22 -0
- package/dist/prepared-processor.d.ts +5 -1
- package/dist/prepared-processor.js +17 -2
- package/dist/primer.generated.js +960 -39
- package/dist/redsys.d.ts +42 -0
- package/dist/redsys.js +68 -0
- package/dist/stripe-checkout.generated.js +494 -9
- package/dist/wix-payments.generated.d.ts +42 -0
- package/dist/wix-payments.generated.js +241 -0
- package/package.json +8 -5
package/dist/redsys.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Redsys's hosted payment page (the TPV Virtual redirect most Spanish banks give their merchants), as
|
|
3
|
+
* this SDK reads it.
|
|
4
|
+
*
|
|
5
|
+
* The merchant's page posts a signed entry form, top-level, to https://sis.redsys.es/sis/realizarPago
|
|
6
|
+
* (or /sis/realizarPago/utf-8), and Redsys answers with its own card page under a session of its own.
|
|
7
|
+
* That entry carries no card, and it is the one request this SDK pauses: the cardholder's device repeats
|
|
8
|
+
* it over the end-to-end TLS relay and fills the card into the page Redsys returns to it (payment-core
|
|
9
|
+
* processors/redsys.js). Everything else the agent's browser posts to Redsys carries a card the agent
|
|
10
|
+
* typed, or leads to a page that asks for one: the card page's own post (/sis/pagoTarjeta;jsessionid=...),
|
|
11
|
+
* the older page's 3-D Secure card lookup (/sis/services/rest/rest3DS/consultaTarjeta3DSPantalla), InSite's
|
|
12
|
+
* card post (/sis/services/rest/NC/generaIdOper). This SDK aborts every one of them, so a placeholder card
|
|
13
|
+
* never reaches Redsys.
|
|
14
|
+
*
|
|
15
|
+
* The entry host is payment-core's REDSYS_HOSTS; redsys.test.mjs pins the two lists together. The
|
|
16
|
+
* abort rule also covers Redsys's test platform, sis-t.redsys.es, on any port: it answers on 25443, which
|
|
17
|
+
* no recognizer takes, so Agentcard pays nothing there, and an entry posted to it opens a page that asks
|
|
18
|
+
* the agent for a card.
|
|
19
|
+
*/
|
|
20
|
+
export declare const REDSYS_PSP = "redsys";
|
|
21
|
+
export declare const REDSYS_ENTRY_HOSTS: readonly string[];
|
|
22
|
+
export declare const REDSYS_HOSTS: readonly string[];
|
|
23
|
+
/** Whether this URL is on one of Redsys's hosts (https, no credentials, any port). */
|
|
24
|
+
export declare function isRedsysHost(url: string): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* The only request on Redsys's hosts that is the merchant's entry: a POST to one of the two entry paths on
|
|
27
|
+
* the live host, written exactly as a form action writes it, with no port, query or fragment
|
|
28
|
+
* (payment-core isRedsysEntryUrl). The entry the SDK pauses; every other POST there is aborted.
|
|
29
|
+
*/
|
|
30
|
+
export declare function isRedsysEntry(url: string, method: string): boolean;
|
|
31
|
+
/** The entry URL the registry recognizes when this build is armed for Redsys, for any URL on a Redsys host. */
|
|
32
|
+
export declare function redsysEntryUrl(url: string): string | null;
|
|
33
|
+
/**
|
|
34
|
+
* Whether an adapter must hand this request to the pre-claim gates: it is on one of Redsys's hosts and
|
|
35
|
+
* this build's registry serves Redsys's entry. The card page's post and the other card requests are not
|
|
36
|
+
* the entry, so the registry's card-request test does not name them; the CDP adapter still pauses them
|
|
37
|
+
* through the recognizer's host patterns, and attachToPlaywright's route predicate asks this, so both
|
|
38
|
+
* adapters show the gates every request to a Redsys host once Redsys is armed.
|
|
39
|
+
*/
|
|
40
|
+
export declare function isArmedRedsysUrl(vault: {
|
|
41
|
+
isCardRequest(url: string, method?: string): boolean;
|
|
42
|
+
}, url: string): boolean;
|
package/dist/redsys.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Redsys's hosted payment page (the TPV Virtual redirect most Spanish banks give their merchants), as
|
|
3
|
+
* this SDK reads it.
|
|
4
|
+
*
|
|
5
|
+
* The merchant's page posts a signed entry form, top-level, to https://sis.redsys.es/sis/realizarPago
|
|
6
|
+
* (or /sis/realizarPago/utf-8), and Redsys answers with its own card page under a session of its own.
|
|
7
|
+
* That entry carries no card, and it is the one request this SDK pauses: the cardholder's device repeats
|
|
8
|
+
* it over the end-to-end TLS relay and fills the card into the page Redsys returns to it (payment-core
|
|
9
|
+
* processors/redsys.js). Everything else the agent's browser posts to Redsys carries a card the agent
|
|
10
|
+
* typed, or leads to a page that asks for one: the card page's own post (/sis/pagoTarjeta;jsessionid=...),
|
|
11
|
+
* the older page's 3-D Secure card lookup (/sis/services/rest/rest3DS/consultaTarjeta3DSPantalla), InSite's
|
|
12
|
+
* card post (/sis/services/rest/NC/generaIdOper). This SDK aborts every one of them, so a placeholder card
|
|
13
|
+
* never reaches Redsys.
|
|
14
|
+
*
|
|
15
|
+
* The entry host is payment-core's REDSYS_HOSTS; redsys.test.mjs pins the two lists together. The
|
|
16
|
+
* abort rule also covers Redsys's test platform, sis-t.redsys.es, on any port: it answers on 25443, which
|
|
17
|
+
* no recognizer takes, so Agentcard pays nothing there, and an entry posted to it opens a page that asks
|
|
18
|
+
* the agent for a card.
|
|
19
|
+
*/
|
|
20
|
+
export const REDSYS_PSP = 'redsys';
|
|
21
|
+
export const REDSYS_ENTRY_HOSTS = Object.freeze(['sis.redsys.es']);
|
|
22
|
+
export const REDSYS_HOSTS = Object.freeze(['sis.redsys.es', 'sis-t.redsys.es']);
|
|
23
|
+
const REDSYS_ENTRY_PATHS = Object.freeze(['/sis/realizarPago', '/sis/realizarPago/utf-8']);
|
|
24
|
+
const REDSYS_ENTRY_URL = 'https://sis.redsys.es/sis/realizarPago';
|
|
25
|
+
/** Whether this URL is on one of Redsys's hosts (https, no credentials, any port). */
|
|
26
|
+
export function isRedsysHost(url) {
|
|
27
|
+
let parsed;
|
|
28
|
+
try {
|
|
29
|
+
parsed = new URL(url);
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
return parsed.protocol === 'https:' && !parsed.username && !parsed.password && REDSYS_HOSTS.includes(parsed.hostname.toLowerCase());
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The only request on Redsys's hosts that is the merchant's entry: a POST to one of the two entry paths on
|
|
38
|
+
* the live host, written exactly as a form action writes it, with no port, query or fragment
|
|
39
|
+
* (payment-core isRedsysEntryUrl). The entry the SDK pauses; every other POST there is aborted.
|
|
40
|
+
*/
|
|
41
|
+
export function isRedsysEntry(url, method) {
|
|
42
|
+
if (String(method).toUpperCase() !== 'POST' || typeof url !== 'string')
|
|
43
|
+
return false;
|
|
44
|
+
let parsed;
|
|
45
|
+
try {
|
|
46
|
+
parsed = new URL(url);
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
return parsed.protocol === 'https:' && REDSYS_ENTRY_HOSTS.includes(parsed.hostname) && REDSYS_ENTRY_PATHS.includes(parsed.pathname)
|
|
52
|
+
&& !parsed.port && !parsed.username && !parsed.password && parsed.href === url && !/[?#]/.test(url);
|
|
53
|
+
}
|
|
54
|
+
/** The entry URL the registry recognizes when this build is armed for Redsys, for any URL on a Redsys host. */
|
|
55
|
+
export function redsysEntryUrl(url) {
|
|
56
|
+
return isRedsysHost(url) ? REDSYS_ENTRY_URL : null;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Whether an adapter must hand this request to the pre-claim gates: it is on one of Redsys's hosts and
|
|
60
|
+
* this build's registry serves Redsys's entry. The card page's post and the other card requests are not
|
|
61
|
+
* the entry, so the registry's card-request test does not name them; the CDP adapter still pauses them
|
|
62
|
+
* through the recognizer's host patterns, and attachToPlaywright's route predicate asks this, so both
|
|
63
|
+
* adapters show the gates every request to a Redsys host once Redsys is armed.
|
|
64
|
+
*/
|
|
65
|
+
export function isArmedRedsysUrl(vault, url) {
|
|
66
|
+
const entry = redsysEntryUrl(url);
|
|
67
|
+
return entry !== null && vault.isCardRequest(entry, 'POST');
|
|
68
|
+
}
|