@agent-cards/sdk 0.23.9 → 0.23.11
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 +48 -0
- package/PREFLIGHT.md +7 -5
- package/README.md +211 -102
- package/dist/aci.d.ts +7 -5
- package/dist/aci.generated.d.ts +2 -1
- package/dist/aci.generated.js +14 -4
- package/dist/aci.js +28 -7
- package/dist/amadeus-checkout.generated.js +2 -2
- package/dist/builtin-registry.generated.js +1 -1
- package/dist/card-fields.generated.js +165 -10
- package/dist/cdp.js +86 -34
- package/dist/client.d.ts +73 -33
- package/dist/client.js +136 -45
- package/dist/creditguard.generated.d.ts +1 -1
- package/dist/creditguard.generated.js +1 -3
- package/dist/cse-body.d.ts +7 -6
- package/dist/cse-body.js +8 -7
- package/dist/datatrans.generated.js +8 -5
- package/dist/elavon-converge.d.ts +5 -2
- package/dist/elavon-converge.generated.js +9 -5
- package/dist/elavon-converge.js +8 -4
- package/dist/fiserv.d.ts +9 -5
- package/dist/fiserv.generated.d.ts +3 -3
- package/dist/fiserv.generated.js +50 -20
- package/dist/fiserv.js +10 -6
- package/dist/lifecycle.d.ts +9 -1
- package/dist/lifecycle.js +34 -0
- package/dist/payrails.d.ts +78 -18
- package/dist/payrails.generated.d.ts +12 -2
- package/dist/payrails.generated.js +213 -18
- package/dist/payrails.js +165 -44
- package/dist/pre-claim.d.ts +7 -0
- package/dist/pre-claim.js +98 -36
- package/dist/preflight-capabilities.generated.d.ts +0 -106
- package/dist/preflight-capabilities.generated.js +0 -153
- package/dist/preflight-catalog.json +61 -181
- package/dist/preflight-schemas.json +6 -6
- package/dist/preflight.generated.d.ts +0 -106
- package/dist/preflight.generated.js +27 -15
- package/dist/preparation.d.ts +2 -0
- package/dist/preparation.js +4 -2
- package/dist/prepared-processor.d.ts +19 -5
- package/dist/prepared-processor.js +21 -5
- package/dist/primer.generated.d.ts +5 -1
- package/dist/primer.generated.js +202 -34
- package/dist/registry.d.ts +18 -12
- package/dist/registry.js +11 -8
- package/dist/shiji-sts.d.ts +24 -22
- package/dist/shiji-sts.generated.d.ts +1 -1
- package/dist/shiji-sts.generated.js +12 -8
- package/dist/shiji-sts.js +49 -46
- package/dist/stripe-checkout.generated.js +157 -49
- package/dist/verifone.generated.js +192 -17
- package/dist/verifone.js +1 -1
- package/dist/worldline-mycheckout.d.ts +27 -0
- package/dist/worldline-mycheckout.generated.d.ts +29 -0
- package/dist/worldline-mycheckout.generated.js +162 -0
- package/dist/worldline-mycheckout.js +93 -0
- package/dist/wspay.d.ts +17 -16
- package/dist/wspay.generated.d.ts +6 -1
- package/dist/wspay.generated.js +13 -3
- package/dist/wspay.js +9 -11
- package/examples/preflight/kernel-native/README.md +1 -1
- package/examples/preflight/kernel-native/inventory.json +1 -19
- package/package.json +3 -3
|
@@ -6,6 +6,11 @@ declare function isWspayNewCardBody(body: any, clientSecret: any, options: any):
|
|
|
6
6
|
declare function classifyWspayRequest(url: any, method: any, body: any, options: any): "card" | "unsupported" | null;
|
|
7
7
|
declare function isWspayConfirmRequest(request: any, options: any): any;
|
|
8
8
|
declare function wspayStoredCredentialRequested(body: any): boolean | null;
|
|
9
|
+
declare var WSPAY_GUARANTEE: Readonly<{
|
|
10
|
+
amount: 100;
|
|
11
|
+
currency: "eur";
|
|
12
|
+
}>;
|
|
13
|
+
declare function wspayKeepOnFileRefusal(body: any, amount: any, currency: any): "keep_on_file" | null;
|
|
9
14
|
declare function wspayConfirmRefusal(request: any, options: any): "unsupported" | "keep_on_file" | null;
|
|
10
15
|
declare function wspayRefusalMessage(reason: any): string;
|
|
11
16
|
declare function injectWspayCard(body: any, card: any, options: any): {
|
|
@@ -38,4 +43,4 @@ declare function wspayFacts(status: any, text2: any): {
|
|
|
38
43
|
outcome: string;
|
|
39
44
|
refusalCode: any;
|
|
40
45
|
};
|
|
41
|
-
export { WSPAY_CONFIRM_HOSTS, WSPAY_TEST_HOST, classifyWspayRequest, injectWspayCard, isWspayConfirmRequest, isWspayConfirmUrl, isWspayNewCardBody, sanitizeWspayResponse, wspayConfirmClientSecret, wspayConfirmRefusal, wspayFacts, wspayRefusalMessage, wspayResponseOutcome, wspayStoredCredentialRequested };
|
|
46
|
+
export { WSPAY_CONFIRM_HOSTS, WSPAY_GUARANTEE, WSPAY_TEST_HOST, classifyWspayRequest, injectWspayCard, isWspayConfirmRequest, isWspayConfirmUrl, isWspayNewCardBody, sanitizeWspayResponse, wspayConfirmClientSecret, wspayConfirmRefusal, wspayFacts, wspayKeepOnFileRefusal, wspayRefusalMessage, wspayResponseOutcome, wspayStoredCredentialRequested };
|
package/dist/wspay.generated.js
CHANGED
|
@@ -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: 9ba65916c5dc5ee3ca830d630cafbde62d537e61991c33c80f1520ac93ef0b0d
|
|
4
4
|
// src/wspay.js
|
|
5
5
|
var WSPAY_CONFIRM_HOSTS = Object.freeze(["proxy.wspay.biz", "proxy-test.wspay.biz"]);
|
|
6
6
|
var WSPAY_TEST_HOST = "proxy-test.wspay.biz";
|
|
@@ -224,6 +224,12 @@ function wspayStoredCredentialRequested(body) {
|
|
|
224
224
|
const value = confirmBody(body);
|
|
225
225
|
return value === null ? null : value.payment_method.data.tokenize_pan === true;
|
|
226
226
|
}
|
|
227
|
+
var WSPAY_GUARANTEE = Object.freeze({ amount: 100, currency: "eur" });
|
|
228
|
+
function wspayKeepOnFileRefusal(body, amount, currency) {
|
|
229
|
+
if (wspayStoredCredentialRequested(body) !== true)
|
|
230
|
+
return null;
|
|
231
|
+
return amount === WSPAY_GUARANTEE.amount && typeof currency === "string" && currency.toLowerCase() === WSPAY_GUARANTEE.currency ? null : "keep_on_file";
|
|
232
|
+
}
|
|
227
233
|
function wspayConfirmRefusal(request, options) {
|
|
228
234
|
if (!isWspayConfirmRequest(request, { keepOnFile: true }))
|
|
229
235
|
return "unsupported";
|
|
@@ -358,7 +364,11 @@ function sanitizeWspayResponse(text2, options) {
|
|
|
358
364
|
if (pm !== null && pm !== void 0) {
|
|
359
365
|
if (!keysWithin(pm, ["type", "data"]) || pm.type !== "card" || !keysWithin(data, ["brand", "issuer", "masked", "expiration_date", "token"]) || !opaqueId(data.token) || owns(data, "brand") && !opaqueId(data.brand, 32) || owns(data, "issuer") && !opaqueId(data.issuer, 64) || owns(data, "expiration_date") && !yymm(data.expiration_date) || owns(data, "masked") && !exact(/^[0-9]{0,6}[-* xX]{4,16}[0-9]{4}$/, data.masked))
|
|
360
366
|
return fail();
|
|
361
|
-
|
|
367
|
+
const card = {};
|
|
368
|
+
for (const key of ["brand", "issuer", "token"])
|
|
369
|
+
if (owns(data, key))
|
|
370
|
+
card[key] = data[key];
|
|
371
|
+
safe.payment_method = { type: "card", data: card };
|
|
362
372
|
}
|
|
363
373
|
}
|
|
364
374
|
return JSON.stringify({ status: "approved", action_required: null, payment_result: safe });
|
|
@@ -367,4 +377,4 @@ function wspayFacts(status, text2) {
|
|
|
367
377
|
const verdict = wspayResponseOutcome(status, text2);
|
|
368
378
|
return { outcome: verdict.outcome, refusalCode: verdict.outcome === "refused" ? verdict.code : null };
|
|
369
379
|
}
|
|
370
|
-
export { WSPAY_CONFIRM_HOSTS, WSPAY_TEST_HOST, classifyWspayRequest, injectWspayCard, isWspayConfirmRequest, isWspayConfirmUrl, isWspayNewCardBody, sanitizeWspayResponse, wspayConfirmClientSecret, wspayConfirmRefusal, wspayFacts, wspayRefusalMessage, wspayResponseOutcome, wspayStoredCredentialRequested };
|
|
380
|
+
export { WSPAY_CONFIRM_HOSTS, WSPAY_GUARANTEE, WSPAY_TEST_HOST, classifyWspayRequest, injectWspayCard, isWspayConfirmRequest, isWspayConfirmUrl, isWspayNewCardBody, sanitizeWspayResponse, wspayConfirmClientSecret, wspayConfirmRefusal, wspayFacts, wspayKeepOnFileRefusal, wspayRefusalMessage, wspayResponseOutcome, wspayStoredCredentialRequested };
|
package/dist/wspay.js
CHANGED
|
@@ -28,19 +28,17 @@ export function isWspayHost(url) {
|
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* The pause decision for a POST the registry recognized on a WSPay host. Null when it is the
|
|
31
|
-
* card frame's confirm of a new card
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* the cardholder.
|
|
31
|
+
* card frame's confirm of a new card, which pauses for approval; otherwise the reason it is
|
|
32
|
+
* refused. It judges the whole request (the exact URL, the frame's content type, Accept and
|
|
33
|
+
* WP3-v2-Client authorization, and a body of the frame's own keys bound to the URL's
|
|
34
|
+
* client_secret) with payment-core's wspayConfirmRefusal, the check the API runs at create.
|
|
35
|
+
* It passes keep-on-file consent because the approval that follows asks the cardholder for it.
|
|
37
36
|
*/
|
|
38
37
|
export function wspayRefusal(request) {
|
|
39
|
-
//
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
return refusal === 'keep_on_file' ? 'wspay_keep_on_file_unsupported' : 'unsupported_wspay_payment_method';
|
|
38
|
+
// Keep-on-file consent (the second argument): the Vault's approval asks the cardholder whether
|
|
39
|
+
// the merchant may keep the card, and the API admits such a confirm only as a card guarantee.
|
|
40
|
+
const refusal = wspayConfirmRefusal({ url: request.url, method: 'POST', headers: request.headers ?? {}, body: request.body ?? '' }, { keepOnFile: true });
|
|
41
|
+
return refusal === null ? null : 'unsupported_wspay_payment_method';
|
|
44
42
|
}
|
|
45
43
|
/**
|
|
46
44
|
* Whether an approved answer handed to a WSPay confirm is WSPay's 3-D Secure step: HTTP 200 with
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
You can detect a checkout's PSP before entering card details with `@agent-cards/sdk`. Kernel native support needs a separate profile for the native adapter that actually runs the checkout. The direct SDK's coverage does not establish Kernel's native coverage.
|
|
4
4
|
|
|
5
|
-
No qualified native profile accompanies this kit. The inventory covers all
|
|
5
|
+
No qualified native profile accompanies this kit. The inventory covers all 24 PSPs in the checkout catalog and reports `unknown` for every native runtime status. Kernel's pinned documentation lists Stripe, Shopify, Square, Recurly, and Razorpay. The other processors are unestablished, rather than explicitly unsupported. See the endpoint constraints and source hashes in [documented-adapters.json](./documented-adapters.json).
|
|
6
6
|
|
|
7
7
|
## Use the detector now
|
|
8
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema_version": 1,
|
|
3
3
|
"catalog_version": "2026-09-15.1",
|
|
4
|
-
"catalog_sha256": "
|
|
4
|
+
"catalog_sha256": "47dd1bc5a749224f66980b42b758f9a19d9ac849e3a8d5230075226a4870fde5",
|
|
5
5
|
"baseline_version": "kernel-native-docs-2026-09-11.1",
|
|
6
6
|
"baseline_sha256": "d86722f49633d8223fccae54cd3d485df4375aee06aa156a273cc689b7c8507c",
|
|
7
7
|
"native_build": null,
|
|
@@ -202,15 +202,6 @@
|
|
|
202
202
|
"Native runtime evidence is missing."
|
|
203
203
|
]
|
|
204
204
|
},
|
|
205
|
-
{
|
|
206
|
-
"psp": "moneris",
|
|
207
|
-
"mode": "token",
|
|
208
|
-
"documentation": "not_documented",
|
|
209
|
-
"status": "unknown",
|
|
210
|
-
"limitations": [
|
|
211
|
-
"No adapter declaration was found in the pinned documentation. Native runtime evidence is missing."
|
|
212
|
-
]
|
|
213
|
-
},
|
|
214
205
|
{
|
|
215
206
|
"psp": "bambora",
|
|
216
207
|
"mode": "token",
|
|
@@ -228,15 +219,6 @@
|
|
|
228
219
|
"limitations": [
|
|
229
220
|
"No adapter declaration was found in the pinned documentation. Native runtime evidence is missing."
|
|
230
221
|
]
|
|
231
|
-
},
|
|
232
|
-
{
|
|
233
|
-
"psp": "gravy",
|
|
234
|
-
"mode": "token",
|
|
235
|
-
"documentation": "not_documented",
|
|
236
|
-
"status": "unknown",
|
|
237
|
-
"limitations": [
|
|
238
|
-
"No adapter declaration was found in the pinned documentation. Native runtime evidence is missing."
|
|
239
|
-
]
|
|
240
222
|
}
|
|
241
223
|
]
|
|
242
224
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-cards/sdk",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.11",
|
|
4
4
|
"description": "Agentcard's SDK: one client, Agentcard, with two modules. checkout pauses a browser purchase and pays it with the person's own card; voice connects a person to your product once and approves a purchase by voice inside it. Card data never enters your process.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"_comment_build": "The public SDK keeps zero runtime dependencies. Its build vendors deterministic metadata and substitution artifacts from the internal payment core, and the voice streaming door from packages/voice/src/core (the phone package, @agent-cards/voice, ships it to phones); TypeScript remains pinned.",
|
|
28
28
|
"build": "node ../payment-core/scripts/build.mjs && node scripts/generate-payment-core.mjs && node scripts/generate-voice-stream.mjs && npx -y -p typescript@5.9.3 tsc && node scripts/generate-preflight-contract.mjs",
|
|
29
29
|
"prepublishOnly": "pnpm build",
|
|
30
|
-
"test": "node test.mjs && node --test lifecycle.test.mjs merchant-abort.test.mjs preparation.test.mjs braintree.test.mjs pre-claim.test.mjs ekashu.test.mjs paypal-hosted-fields.test.mjs cybersource-secure-acceptance.test.mjs autopilot.test.mjs stripe-checkout.test.mjs stripe-setup.test.mjs stripe-legacy-checkout.test.mjs payment-core.test.mjs prepared-processor.test.mjs merchant-hosted.test.mjs merchant-total.test.mjs sandbox-declaration.test.mjs minimum-delay.test.mjs paysafe.test.mjs payu.test.mjs attachment.test.mjs worker-targets.test.mjs mercado-checkout.test.mjs mercado-polling.test.mjs amadeus.test.mjs pelecard.test.mjs aci.test.mjs primer.test.mjs payrails.test.mjs elavon-converge.test.mjs voice.test.mjs agentcard.test.mjs buy.test.mjs readme.test.mjs gmo.test.mjs cybersource-flex.test.mjs juspay-gate.test.mjs card-endpoint.test.mjs card-endpoint-fastspring.test.mjs card-endpoint-navigation.test.mjs merchant-session-probe.test.mjs datatrans.test.mjs authorize-net-dpm.test.mjs creditguard.test.mjs eprotect.test.mjs wspay.test.mjs shiji-sts.test.mjs worldline-mycheckout.test.mjs verifone.test.mjs && node --test preflight-package.test.mjs preflight-collector.test.mjs && node --test kernel-native-qualification.test.mjs && node --test ../vault/scripts/recurly-validation/watch-duty-sdk-result.test.mjs",
|
|
31
|
-
"test:browser": "node browser.test.mjs && node stripe-browser.test.mjs && node preparation-browser.test.mjs && node checkout-com-browser.test.mjs && node paysafe-preparation-browser.test.mjs && node owned-shop-browser.test.mjs && node spreedly-browser.test.mjs && node worker-browser.test.mjs && node amadeus-browser.test.mjs && node adyen-merchant-hosted-browser.test.mjs && node adyen-merchant-frames-browser.test.mjs && node fiserv-browser.test.mjs && node gmo-browser.test.mjs && node cybersource-flex-browser.test.mjs && node juspay-browser.test.mjs && node card-endpoint-browser.test.mjs && node datatrans-browser.test.mjs && node authorize-net-dpm-browser.test.mjs && node pelecard-browser.test.mjs && node aci-browser.test.mjs && node creditguard-browser.test.mjs && node primer-browser.test.mjs && node payrails-browser.test.mjs && node elavon-converge-browser.test.mjs && node eprotect-browser.test.mjs && node wspay-browser.test.mjs && node shiji-sts-browser.test.mjs && node worldline-mycheckout-browser.test.mjs && node paypal-hosted-fields-browser.test.mjs && node cybersource-secure-acceptance-browser.test.mjs",
|
|
30
|
+
"test": "node test.mjs && node --test lifecycle.test.mjs merchant-abort.test.mjs preparation.test.mjs braintree.test.mjs pre-claim.test.mjs ekashu.test.mjs paypal-hosted-fields.test.mjs cybersource-secure-acceptance.test.mjs autopilot.test.mjs stripe-checkout.test.mjs stripe-setup.test.mjs stripe-legacy-checkout.test.mjs payment-core.test.mjs prepared-processor.test.mjs merchant-hosted.test.mjs merchant-total.test.mjs sandbox-declaration.test.mjs minimum-delay.test.mjs paysafe.test.mjs payu.test.mjs attachment.test.mjs worker-targets.test.mjs mercado-checkout.test.mjs mercado-polling.test.mjs amadeus.test.mjs pelecard.test.mjs aci.test.mjs primer.test.mjs payrails.test.mjs elavon-converge.test.mjs voice.test.mjs agentcard.test.mjs buy.test.mjs readme.test.mjs gmo.test.mjs cybersource-flex.test.mjs juspay-gate.test.mjs card-endpoint.test.mjs card-endpoint-fastspring.test.mjs card-endpoint-navigation.test.mjs merchant-session-probe.test.mjs datatrans.test.mjs authorize-net-dpm.test.mjs creditguard.test.mjs eprotect.test.mjs wspay.test.mjs shiji-sts.test.mjs worldline-mycheckout.test.mjs verifone.test.mjs gravy.test.mjs && node --test preflight-package.test.mjs preflight-collector.test.mjs && node --test kernel-native-qualification.test.mjs && node --test ../vault/scripts/recurly-validation/watch-duty-sdk-result.test.mjs",
|
|
31
|
+
"test:browser": "node browser.test.mjs && node stripe-browser.test.mjs && node preparation-browser.test.mjs && node checkout-com-browser.test.mjs && node paysafe-preparation-browser.test.mjs && node owned-shop-browser.test.mjs && node spreedly-browser.test.mjs && node worker-browser.test.mjs && node amadeus-browser.test.mjs && node adyen-merchant-hosted-browser.test.mjs && node adyen-merchant-frames-browser.test.mjs && node fiserv-browser.test.mjs && node gmo-browser.test.mjs && node cybersource-flex-browser.test.mjs && node juspay-browser.test.mjs && node card-endpoint-browser.test.mjs && node datatrans-browser.test.mjs && node authorize-net-dpm-browser.test.mjs && node pelecard-browser.test.mjs && node aci-browser.test.mjs && node creditguard-browser.test.mjs && node primer-browser.test.mjs && node payrails-browser.test.mjs && node elavon-converge-browser.test.mjs && node eprotect-browser.test.mjs && node wspay-browser.test.mjs && node shiji-sts-browser.test.mjs && node worldline-mycheckout-browser.test.mjs && node paypal-hosted-fields-browser.test.mjs && node cybersource-secure-acceptance-browser.test.mjs && node gravy-browser.test.mjs",
|
|
32
32
|
"check:payment-core": "node scripts/generate-payment-core.mjs --check",
|
|
33
33
|
"check:voice-stream": "node scripts/generate-voice-stream.mjs --check",
|
|
34
34
|
"test:preflight": "node --test preflight-package.test.mjs preflight-collector.test.mjs kernel-native-qualification.test.mjs",
|