@agent-cards/sdk 0.23.4 → 0.23.6

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 CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ - Pause a Worldpay eProtect registration whatever Worldpay key its page names. Worldpay rotates its production eProtect key daily (`26457000011` on 2026-10-08), and 0.23.3 refused every registration whose `publicKeyId` was not `26455500012`, the key it shipped, so an attached checkout at any eProtect merchant read `unsupported`. The SDK now takes any key id in Worldpay's digits; the cardholder's device encrypts the card under the key it reads from Worldpay's own `eProtect-api3.js` and writes that key's id into its copy, so no later rotation needs an SDK release. SmartPak Equine (paypageId `zhs8KzuRAryaq4cs` at `https://www.smartpakequine.com`) and Nordstrom (`fL33BPkRvbRqJ29S` at `https://www.nordstrom.com`) are reviewed eProtect merchants: a live checkout there passes `merchant: 'SmartPak Equine'` or `merchant: 'Nordstrom'` exactly, and `prepare()` refuses another name with `merchant_profile_mismatch` before any network call. eProtect stays dark for every org Agentcard has not enabled, and a payment also needs the matching API and Vault releases.
6
+
7
+ - Stop the card your agent typed from reaching CyberSource through Secure Acceptance's Silent Order POST. A merchant that takes the card in its own form, such as Arrow Electronics, has its server sign the order fields, then posts them with the card fields (`card_number`, `card_expiry_date`, `card_cvn`) to a `/silent/` path on `secureacceptance.cybersource.com` (`testsecureacceptance.cybersource.com` in CyberSource's test environment, `secureacceptance.in.cybersource.com` in India); Arrow submits that form into a hidden iframe. No Agentcard payment takes that post over, and earlier releases let it through, so CyberSource received the dummy card. Both adapters now stop it for every company, whatever `syncRegistry()` served: a form the page submits as a page load, in the page or in a frame, gets the page that says Agentcard stopped the payment before the card reached CyberSource, and a fetch or an XHR fails. A `card_number` in the URL's query, as a form with method GET sends it, stops the request the same way. The controller reads `unsupported` with reason `unsupported_cybersource_secure_acceptance` and holds, like every `unsupported` reason: to pay another way on the same page, attach again. A post with no `card_number`, or an empty one, such as a payment with a stored `payment_token`, continues untouched, and so does Hosted Checkout, the same hosts without `/silent/`, where your agent types the card on CyberSource's own page. The SDK stops a post whose body it cannot read with a `blocked` event, `unreadable_cybersource_secure_acceptance_request`, and does not hold the checkout. TypeScript: the controller's `unsupported()` reasons gain `unsupported_cybersource_secure_acceptance`; code that switches exhaustively over them needs the new case.
8
+
9
+ - Name CyberSource Secure Acceptance's Silent Order POST in a preflight inspection. A form, a frame or a document on a `/silent/` path of `secureacceptance.cybersource.com`, `testsecureacceptance.cybersource.com` or `secureacceptance.in.cybersource.com` now names `cybersource_secure_acceptance`, and the result stays `unknown`: `processor_variant_unverified` for a visible form, and `payment_signal_inactive` for a hidden one such as Arrow's. The catalog's `catalog_sha256` changes; `catalog_version` stays `2026-09-15.1`.
10
+
5
11
  - Stop PayPal's legacy Hosted Fields from sending the card your agent typed to PayPal's payment confirm. A checkout that loads PayPal's JS SDK with `components=hosted-fields`, such as Planet Golf UK's PayPal Checkout, takes the card in frames on `assets.braintreegateway.com` and sends it to `https://cors.api.paypal.com/v2/checkout/orders/{id}/confirm-payment-source` (`cors.api.sandbox.paypal.com` in PayPal's sandbox). No Agentcard payment takes that request over, and earlier releases let it through, so PayPal received the dummy card and declined it. Both adapters now fail that request in the browser for every company, whatever `syncRegistry()` served, and the controller reads `unsupported` with reason `unsupported_paypal_hosted_fields` and holds, like every `unsupported` reason: to pay another way on the same page, attach again. A confirm with no card number, such as a PayPal wallet payment, continues untouched. A confirm whose body the SDK cannot read is failed with a `blocked` event, `unreadable_paypal_request`, and the checkout is not held. A merchant that turns on PayPal's card installments also has the card number field send each typed number to PayPal's installment lookup, `/v1/credit/calculated-financing-options`; the SDK leaves that lookup alone, and it pays nothing. TypeScript: the controller's `unsupported()` reasons gain `unsupported_paypal_hosted_fields`; code that switches exhaustively over them needs the new case.
6
12
 
7
13
  - Name PayPal's legacy Hosted Fields as PayPal in a preflight inspection, not as Braintree. Their card fields are braintree-web builds whose version carries `-payments-sdk` (`3.32.0-payments-sdk-dev` on Planet Golf UK), and inspection read the page as `braintree` with status `supported`. The frames now name `paypal`, and the result stays `unknown` with `processor_variant_unverified`. A braintree-web script from a `-payments-sdk` build is no longer Braintree evidence either, and a variant seen in several frames lists its limitation once. The catalog's `catalog_sha256` changes; `catalog_version` stays `2026-09-15.1`.
package/PREFLIGHT.md CHANGED
@@ -209,6 +209,8 @@ The catalog also carries reviewed hosted, regional, and versioned variants obser
209
209
 
210
210
  PayPal's legacy Hosted Fields (`paypal`) are identified from the card fields PayPal's JS SDK renders with `components=hosted-fields`: braintree-web builds whose version carries `-payments-sdk`, such as `3.32.0-payments-sdk-dev`, served from `assets.braintreegateway.com` as `hosted-fields-input-frame.min.html` and `hosted-fields-payments-sdk-tokenization-frame.min.html`. PayPal's frames send the card to PayPal, not to Braintree, so a page that shows them names `paypal` and returns `unknown` with `processor_variant_unverified`, and no braintree-web file from a `-payments-sdk` build counts as Braintree evidence. The SDK fails the card request those frames send; see the PayPal Hosted Fields row in the [README's processor table](./README.md#supported-processors).
211
211
 
212
+ An inspection identifies CyberSource Secure Acceptance's Silent Order POST (`cybersource_secure_acceptance`) from the form a merchant's own page posts the card from, and from a frame or a document on the same path: a `/silent/` path, such as `/silent/pay` or `/silent/embedded/token/create`, on `secureacceptance.cybersource.com`, `testsecureacceptance.cybersource.com` or `secureacceptance.in.cybersource.com`. No Vault mode takes that post over, so a page that shows the form names `cybersource_secure_acceptance` and returns `unknown`: with `processor_variant_unverified` when the form is visible, and with `payment_signal_inactive` when it is hidden, as on Arrow Electronics' checkout. An inspection does not name Hosted Checkout, the same hosts without `/silent/`. The SDK stops the card post; see the CyberSource Secure Acceptance row in the [README's processor table](./README.md#supported-processors).
213
+
212
214
  Adyen's `supported` covers the Sessions payment request on Adyen's own hosts. Some Adyen merchants post the four encrypted fields to their own server instead, and their pages load the same secured fields, so an inspection identifies Adyen on both and cannot tell the two flows apart. The SDK pays a merchant's own endpoint only through a merchant profile Agentcard reviewed for it; the reviewed profiles (Dunelm and Cinemark) are in `observe`, so the SDK aborts their card requests and nothing is charged. The `actual_payment_request_validation` requirement is where that difference shows: check the paused request's host before treating an Adyen result as payable.
213
215
 
214
216
  Authorize.Net Direct Post Method and SIM ship dark. The SDK pauses their `transact.dll` card form only for an org Agentcard enabled for them (capability `authorize_net_dpm_form`), and the bundled catalog leaves them out, so the table above does not list them and inspection answers for their forms exactly as it did before: the SIM hosted form on `secure.authorize.net` identifies Authorize.Net and returns `unknown` with `processor_variant_unverified`.
package/README.md CHANGED
@@ -255,6 +255,7 @@ Coverage is specific to the processor request format, merchant setup, browser tr
255
255
  | Mercado Pago | Card tokenization and prepared checkout are implemented. Guest Checkout Pro in Mexico also corrects the issuer for one native card association when the selected card has the same brand and type. One live MXN 40 Lotería Chida purchase with published SDK 0.10.0 completed automatically through Pay; the merchant confirmed paid status and PDF fulfillment. The historical SDK result remains unknown because the private receipt adapter rejected a relative download URL; a separate read with the corrected adapter confirms that same paid receipt. Independent processor capture/settlement and other country or integration paths remain unverified. |
256
256
  | VGS Collect (Very Good Security; Wolt) | not supported: VGS's proxy aliases only submissions from its own iframe, so a replay from the cardholder's device is refused by the merchant (verified on Wolt, 2026-09-03). Not recognized, so the agent's browser is not paused there |
257
257
  | PayPal Hosted Fields (the legacy card fields of PayPal's JS SDK; Planet Golf UK) | not supported: no Agentcard payment takes over the card these fields send to `cors.api.paypal.com`. The SDK fails that request for every company, so PayPal's payment confirm never receives the dummy card, and the controller reads `unsupported` with reason `unsupported_paypal_hosted_fields` and holds the attachment until you attach again; a PayPal wallet payment continues untouched |
258
+ | CyberSource Secure Acceptance Silent Order POST (the merchant's own card form posted to CyberSource; Arrow Electronics) | not supported: no Agentcard payment takes over the card a merchant's page posts to a `/silent/` path on `secureacceptance.cybersource.com` (`testsecureacceptance.cybersource.com` in CyberSource's test environment, `secureacceptance.in.cybersource.com` in India). The SDK stops that post for every company, so CyberSource never receives the dummy card: a form the page submits as a page load, in the page or in a frame, ends on the page that says Agentcard stopped the payment, and a fetch or an XHR fails. The controller reads `unsupported` with reason `unsupported_cybersource_secure_acceptance` and holds the attachment until you attach again; a post with no `card_number`, such as a payment with a stored `payment_token`, continues untouched. The SDK does not stop Hosted Checkout, where your agent types the card on CyberSource's own page |
258
259
  | Adyen | supported (mode `cse`): the vault encrypts the card for Adyen on the cardholder's device and your browser sends it. Sessions flow: the paused request is `/checkoutshopper/v1/sessions/{id}/payments` on Adyen's own hosts. A merchant that posts the encrypted fields to its own server pauses only when Agentcard reviewed it as a merchant profile. Cinemark and Dick's Sporting Goods' own storefront take payments for a company Agentcard turned them on for; every other reviewed merchant is in `observe`, so its card requests are reported and aborted and nothing pays there yet (see "Adyen merchants that take the card on their own server"). Without a preparation, approval starts at Pay and must land before Adyen Web's own request timeout (observed at 60 seconds on Adyen Web 6.41 and 6.44; not enforced by the SDK); `prepare({ psp: 'adyen' })` moves the approval before Pay |
259
260
  | ACI Worldwide COPYandPAY (Halfords) | dark launch: served only after `syncRegistry()` and only for an org Agentcard enabled; prepared checkout only. The card-number request is replayed from the cardholder's device, the page's own CVC and expiry requests are answered locally, and `/payment` continues once. See [Pay an ACI COPYandPAY checkout](#pay-an-aci-copyandpay-checkout) |
260
261
  | Tranzila | supported (mode `hosted_form`): the cardholder finishes on Tranzila's own page; the paused form navigation resolves to a synthetic page, and you poll the merchant's order state |
@@ -1937,7 +1938,8 @@ eProtect traffic exactly as it found it, as it does before a sync.
1937
1938
 
1938
1939
  The merchant's script gives up on the registration 10 to 15 seconds after Pay,
1939
1940
  and re-sends it to a failover host after 5, which is too soon for a prompt that
1940
- waits on a person. An eProtect checkout is therefore always prepared:
1941
+ waits on a person (SmartPak Equine's card form sets neither, so its script
1942
+ waits). An eProtect checkout is therefore always prepared:
1941
1943
 
1942
1944
  ```ts
1943
1945
  const checkout = await attachToPlaywright(page, {
@@ -1954,8 +1956,10 @@ await page.getByRole('button', { name: 'Place order', exact: true }).click();
1954
1956
  registration is for, which is also the merchant Worldpay lets charge the card
1955
1957
  again. It is fixed before the page sends anything, so a registration naming
1956
1958
  another paypageId never spends the approval. The Worldpay iframe names it in
1957
- its URL (`/eProtect/payframe_<paypageId>_...`); a JS API merchant carries it
1958
- in its eProtect configuration.
1959
+ its URL (`/eProtect/payframe_<paypageId>_...`, or the `paypageid` query of
1960
+ `/eProtect/eProtect.html`, as at Nordstrom); a JS API merchant carries it in
1961
+ its eProtect configuration (SmartPak Equine's page keeps it in a hidden
1962
+ `PayPageId` input).
1959
1963
  - `cardId` is required, and the approval is locked to that card. Worldpay never
1960
1964
  receives an expiry: the merchant sends the one typed into its form with the
1961
1965
  registration. The agent types a placeholder number of the stored card's
@@ -1964,9 +1968,12 @@ await page.getByRole('button', { name: 'Place order', exact: true }).click();
1964
1968
  prepares.
1965
1969
 
1966
1970
  After Pay, the SDK pauses the registration and binds it to the preparation.
1967
- The cardholder's device, still on the approval page, encrypts the approved card
1968
- under Worldpay's key into that same query and sends it through Agentcard's
1969
- encrypted relay. The SDK then answers the paused script as Worldpay would:
1971
+ Worldpay rotates its production key daily, so the SDK pauses a registration
1972
+ whatever Worldpay key id its page names. The cardholder's device, still on the
1973
+ approval page, reads Worldpay's key from Worldpay's own `eProtect-api3.js` on
1974
+ the connection that carries the card, encrypts the approved card under it into
1975
+ that same query, writes that key's id into `publicKeyId`, and sends it through
1976
+ Agentcard's encrypted relay. The SDK then answers the paused script as Worldpay would:
1970
1977
  the registration in the script's own callback, under Worldpay's script type,
1971
1978
  with only the fields the merchant needs (no first six or last four digits).
1972
1979
  The SDK reads the authorization every 500 ms for 15 seconds, so the answer
@@ -2000,8 +2007,16 @@ one the approval shows. The API refuses another name with
2000
2007
  `merchant_profile_mismatch` and a paypageId with no pin with
2001
2008
  `unsupported_checkout`, before any preparation exists; when this release pins
2002
2009
  the paypageId too, the SDK refuses another name first, before any network call.
2003
- Agentcard has pinned no production merchant yet, so the API refuses every live
2004
- eProtect checkout today; the pre-live host needs no pin. An approved answer that is not a
2010
+ This release pins two production merchants, and the API refuses every other
2011
+ live eProtect checkout; the pre-live host needs no pin:
2012
+
2013
+ | `merchant` | `paypageId` | Merchant origin |
2014
+ | --- | --- | --- |
2015
+ | `SmartPak Equine` | `zhs8KzuRAryaq4cs` | `https://www.smartpakequine.com` |
2016
+ | `Nordstrom` | `fL33BPkRvbRqJ29S` | `https://www.nordstrom.com` |
2017
+
2018
+ The merchant origin is the checkout page's own, the top page that frames
2019
+ Worldpay's iframe at Nordstrom. An approved answer that is not a
2005
2020
  registration for the paused request raises `PaymentOutcomeUnknownError` with
2006
2021
  reason `eprotect_registration_unconfirmed`: the device may have registered the
2007
2022
  card, so reconcile the merchant before trying again.
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * The page a paused card form navigation is answered with when Agentcard stops it
3
- * (card-endpoint.ts, a profile whose `navigation` is 'top' or 'frame').
3
+ * (card-endpoint.ts, a profile whose `navigation` is 'top' or 'frame', and a form a
4
+ * merchant's page posts to CyberSource Secure Acceptance, cybersource-secure-acceptance.ts).
4
5
  *
5
6
  * A merchant's form that the page submits as a page load leaves the agent's browser
6
7
  * waiting for a page, so an aborted request is the wrong answer: it renders an error
@@ -24,7 +25,8 @@
24
25
  * Self-contained HTML: no external resource, no script that runs (the one `<script>` is
25
26
  * `application/json`), readable by a person in one paragraph and by an agent through the
26
27
  * meta tag, the header and the JSON block. It never carries the endpoint URL, the paused
27
- * body or the merchant's answer: only the profile's own merchant name, escaped.
28
+ * body or the merchant's answer: only the profile's own merchant name, or CyberSource for a
29
+ * Secure Acceptance post, escaped.
28
30
  */
29
31
  import type { SyntheticPage } from './hosted-form.js';
30
32
  import type { CheckoutState } from './lifecycle.js';
@@ -45,7 +47,7 @@ export declare function refusedNavigationOutcome(state: {
45
47
  export interface CardEndpointStoppedPageInput {
46
48
  outcome: CardEndpointStoppedOutcome;
47
49
  reason: CardEndpointStoppedReason;
48
- /** The profile's own merchant name (never the integrator's or the page's). */
50
+ /** The profile's own merchant name, or CyberSource for a Secure Acceptance post (never the integrator's or the page's). */
49
51
  merchant: string;
50
52
  /** The authorization, once one exists. */
51
53
  authorizationId?: string | null;
package/dist/cdp.js CHANGED
@@ -13,6 +13,7 @@ import { DatatransRepeats } from './datatrans.js';
13
13
  import { SHIJI_STS_COMPANION_WINDOW_MS, ShijiStsCompanions, ShijiStsError, isShijiStsHost, shijiStsTokenContinuation, } from './shiji-sts.js';
14
14
  import { isArmedEkashuUrl } from './ekashu.js';
15
15
  import { PAYPAL_HOSTED_FIELDS_PATTERNS, isPaypalHostedFieldsConfirm } from './paypal-hosted-fields.js';
16
+ import { CYBERSOURCE_SECURE_ACCEPTANCE_PATTERNS, isCybersourceSecureAcceptanceUrl } from './cybersource-secure-acceptance.js';
16
17
  import { CheckoutAttachmentError, attachmentDeadline, attachmentFailure, withinAttachmentDeadline } from './attachment.js';
17
18
  import { cseBody } from './cse-body.js';
18
19
  import { STRIPE_SETUP_INTENT_CONFIRM, setupConfirmPayingWith } from './stripe-setup.js';
@@ -1913,10 +1914,12 @@ export async function attachToCdp(cdp, pageSessionId, opts) {
1913
1914
  // PayPal's legacy Hosted Fields confirm is armed for every org, whatever the
1914
1915
  // registry serves: one that carries the typed card is paused only to be
1915
1916
  // refused, and one with no card continues (see paypal-hosted-fields.ts).
1917
+ // CyberSource Secure Acceptance's /silent/ paths are armed the same way, form
1918
+ // navigations included (see cybersource-secure-acceptance.ts).
1916
1919
  const urlPatterns = [...new Set([...(derived.length > 0 ? derived : FALLBACK_CARD_PATTERNS), ...guards.patterns,
1917
1920
  ...(stripeCheckout.isEnabled() ? ['https://api.stripe.com/*'] : []), MERCADO_CHECKOUT_PATTERN, ...merchantPatterns,
1918
1921
  ...(recognizesGmo(opts.vault) ? GMO_TOKEN_V1_PATTERNS : []), ...juspayCheckout.urlPatterns(), ...cardEndpointPatterns(),
1919
- ...(payrails ? PAYRAILS_GUARD_PATTERNS : []), ...PAYPAL_HOSTED_FIELDS_PATTERNS])];
1922
+ ...(payrails ? PAYRAILS_GUARD_PATTERNS : []), ...PAYPAL_HOSTED_FIELDS_PATTERNS, ...CYBERSOURCE_SECURE_ACCEPTANCE_PATTERNS])];
1920
1923
  const arm = async (sessionId, resume = false, worker = false) => {
1921
1924
  const key = sessionId ?? '__root__';
1922
1925
  if (armed.has(key))
@@ -3189,7 +3192,9 @@ export async function attachToPlaywright(page, opts) {
3189
3192
  // host: the card page's post and its 3-D Secure calls reach the NMI gate and fail.
3190
3193
  || isArmedEkashuUrl(opts.vault, url.toString())
3191
3194
  // PayPal's legacy Hosted Fields confirm, for every org, as attachToCdp arms it (paypal-hosted-fields.ts).
3192
- || isPaypalHostedFieldsConfirm(url.toString()), async (route) => {
3195
+ || isPaypalHostedFieldsConfirm(url.toString())
3196
+ // CyberSource Secure Acceptance's /silent/ paths, for every org, as attachToCdp arms them (cybersource-secure-acceptance.ts).
3197
+ || isCybersourceSecureAcceptanceUrl(url.toString()), async (route) => {
3193
3198
  const request = route.request();
3194
3199
  // When this request paused, and the page it came from: the merchant's total is read as of now.
3195
3200
  const pausedAt = Date.now();
@@ -0,0 +1,78 @@
1
+ /**
2
+ * CyberSource Secure Acceptance's Silent Order POST, which this SDK refuses for every company.
3
+ *
4
+ * CyberSource's Secure Acceptance Checkout API, formerly Silent Order POST, takes the card from a form
5
+ * on the merchant's own page. The merchant's server signs the order fields, and the shopper's browser
6
+ * posts them, with the card fields left unsigned, to a /silent/ path on one of CyberSource's Secure
7
+ * Acceptance hosts: /silent/pay, /silent/token/create, /silent/token/update, and the iframe form of
8
+ * each under /silent/embedded/ (CyberSource's endpoint table, read 2026-10-08). Arrow Electronics'
9
+ * checkout (its public bundles, read 2026-10-08; no card was sent) builds that form once its server
10
+ * has signed the fields and submits it into a hidden iframe:
11
+ *
12
+ * <iframe name="secureAcceptanceiFrame" style="display:none">
13
+ * <form action="https://secureacceptance.cybersource.com/silent/embedded/token/create" method="post"
14
+ * target="secureAcceptanceiFrame">: access_key, profile_id, transaction_type=create_payment_token,
15
+ * amount=0 and the other signed fields with their signature, then card_type, card_number,
16
+ * card_expiry_date (MM-YYYY) and card_cvn
17
+ *
18
+ * No Vault mode takes this post over, so no company can pay it, and an SDK without this guard let the
19
+ * card the agent typed reach CyberSource. Both adapters arm /silent/ on the three hosts whatever the
20
+ * synced registry serves, over https and http, each host also spelled with the trailing dot of a fully
21
+ * qualified name, and the pre-claim gate (cybersourceSecureAcceptancePreClaim, pre-claim.ts) judges
22
+ * each request there, whether a fetch, an XHR or a form navigation of the page or of a frame sent it,
23
+ * by its body and by its URL's query (cybersourceSecureAcceptanceRequest):
24
+ * - a card_number that holds a value: stop it, so CyberSource never receives the card. A form
25
+ * navigation is answered with the stopped page (card-endpoint-page.ts), which names CyberSource,
26
+ * since an aborted page load renders nothing and invites another click on Pay; any other request
27
+ * fails. The checkout reads `unsupported` with reason `unsupported_cybersource_secure_acceptance`
28
+ * and holds, as every unsupported refusal does;
29
+ * - no card_number, or an empty one, as in a payment with a stored payment_token: continue untouched;
30
+ * - a body the adapter could not read: stop that request alone, since nothing proves it carries no card.
31
+ * A request the synced registry recognizes as a card request belongs to that recognizer instead; no
32
+ * build serves one today. Hosted Checkout, the same hosts without /silent/, takes the card on
33
+ * CyberSource's own page, and neither adapter arms it.
34
+ */
35
+ export declare const CYBERSOURCE_SECURE_ACCEPTANCE_REASON: "unsupported_cybersource_secure_acceptance";
36
+ /** Where the stopped page says the card was going. */
37
+ export declare const CYBERSOURCE_SECURE_ACCEPTANCE_RECIPIENT = "CyberSource";
38
+ /** CyberSource's Secure Acceptance hosts: production, test, and production in India. */
39
+ export declare const CYBERSOURCE_SECURE_ACCEPTANCE_HOSTS: readonly string[];
40
+ /**
41
+ * CDP Fetch patterns for every /silent/ path on the three hosts, armed on every attachment, over https
42
+ * and over http, each host also with its trailing dot: Chrome sends a URL spelled either way unchanged,
43
+ * and DNS reads both spellings as the same host, so a page's form posted to either reaches CyberSource.
44
+ * The * before silent/ also pauses a path that doubles its slash, as a base URL that ends in a slash
45
+ * joined to /silent/pay writes it, which a server that merges slashes reads as /silent/pay. The gate
46
+ * judges each path with its slashes merged (isCybersourceSecureAcceptanceUrl), and anything else the *
47
+ * pauses, such as /billing/silent/pay, continues untouched. A pattern matches the canonical URL Chrome
48
+ * sends, whose host is lower case and whose standard port is dropped; no URL without silent/ is armed.
49
+ */
50
+ export declare const CYBERSOURCE_SECURE_ACCEPTANCE_PATTERNS: readonly string[];
51
+ /**
52
+ * Whether this URL is a /silent/ path on one of the three hosts: https or http, the host with or without
53
+ * its trailing dot, on the scheme's standard port, with no credentials, and its path read with each run
54
+ * of slashes merged into one, as a server that merges slashes reads it.
55
+ */
56
+ export declare function isCybersourceSecureAcceptanceUrl(url: string): boolean;
57
+ /**
58
+ * What a request to a /silent/ path carries: 'card' when card_number holds a value in the URL's query,
59
+ * on any method, since a form whose method is GET puts its fields there; otherwise the body's verdict
60
+ * (cybersourceSecureAcceptanceBody) for a method that sends one, and 'no_card' for a GET, a HEAD or a
61
+ * CORS preflight.
62
+ */
63
+ export declare function cybersourceSecureAcceptanceRequest(url: string, method: string, body: string | null, contentType?: string): 'card' | 'no_card' | 'unreadable';
64
+ /**
65
+ * What a Silent Order POST's body carries: 'card' when any reading of it finds a field named card_number
66
+ * that holds a value, 'no_card' when none does, and 'unreadable' for a body the adapter could not read
67
+ * (null), or a multipart body whose parts cannot be read and in which no reading finds a card, a
68
+ * multipart content type with no boundary included.
69
+ *
70
+ * The page writes both the bytes and their content type, and a server reads the bytes by that type, so
71
+ * the gate trusts no one reading. It reads every body as URL-encoded pairs (split on & and line by line,
72
+ * which also reads a plain-text form's name=value lines), as JSON at any depth, and as a multipart form:
73
+ * by its parts, when its content type names a boundary or it opens with a delimiter line and a part
74
+ * header, and by every part header that names card_number, wherever it sits. A card in any reading stops
75
+ * the post, so a body whose content type names one encoding and whose bytes hold another, a URL-encoded
76
+ * body that also parses as JSON, say, cannot carry the card past the gate.
77
+ */
78
+ export declare function cybersourceSecureAcceptanceBody(body: string | null, contentType?: string): 'card' | 'no_card' | 'unreadable';
@@ -0,0 +1,214 @@
1
+ /**
2
+ * CyberSource Secure Acceptance's Silent Order POST, which this SDK refuses for every company.
3
+ *
4
+ * CyberSource's Secure Acceptance Checkout API, formerly Silent Order POST, takes the card from a form
5
+ * on the merchant's own page. The merchant's server signs the order fields, and the shopper's browser
6
+ * posts them, with the card fields left unsigned, to a /silent/ path on one of CyberSource's Secure
7
+ * Acceptance hosts: /silent/pay, /silent/token/create, /silent/token/update, and the iframe form of
8
+ * each under /silent/embedded/ (CyberSource's endpoint table, read 2026-10-08). Arrow Electronics'
9
+ * checkout (its public bundles, read 2026-10-08; no card was sent) builds that form once its server
10
+ * has signed the fields and submits it into a hidden iframe:
11
+ *
12
+ * <iframe name="secureAcceptanceiFrame" style="display:none">
13
+ * <form action="https://secureacceptance.cybersource.com/silent/embedded/token/create" method="post"
14
+ * target="secureAcceptanceiFrame">: access_key, profile_id, transaction_type=create_payment_token,
15
+ * amount=0 and the other signed fields with their signature, then card_type, card_number,
16
+ * card_expiry_date (MM-YYYY) and card_cvn
17
+ *
18
+ * No Vault mode takes this post over, so no company can pay it, and an SDK without this guard let the
19
+ * card the agent typed reach CyberSource. Both adapters arm /silent/ on the three hosts whatever the
20
+ * synced registry serves, over https and http, each host also spelled with the trailing dot of a fully
21
+ * qualified name, and the pre-claim gate (cybersourceSecureAcceptancePreClaim, pre-claim.ts) judges
22
+ * each request there, whether a fetch, an XHR or a form navigation of the page or of a frame sent it,
23
+ * by its body and by its URL's query (cybersourceSecureAcceptanceRequest):
24
+ * - a card_number that holds a value: stop it, so CyberSource never receives the card. A form
25
+ * navigation is answered with the stopped page (card-endpoint-page.ts), which names CyberSource,
26
+ * since an aborted page load renders nothing and invites another click on Pay; any other request
27
+ * fails. The checkout reads `unsupported` with reason `unsupported_cybersource_secure_acceptance`
28
+ * and holds, as every unsupported refusal does;
29
+ * - no card_number, or an empty one, as in a payment with a stored payment_token: continue untouched;
30
+ * - a body the adapter could not read: stop that request alone, since nothing proves it carries no card.
31
+ * A request the synced registry recognizes as a card request belongs to that recognizer instead; no
32
+ * build serves one today. Hosted Checkout, the same hosts without /silent/, takes the card on
33
+ * CyberSource's own page, and neither adapter arms it.
34
+ */
35
+ export const CYBERSOURCE_SECURE_ACCEPTANCE_REASON = 'unsupported_cybersource_secure_acceptance';
36
+ /** Where the stopped page says the card was going. */
37
+ export const CYBERSOURCE_SECURE_ACCEPTANCE_RECIPIENT = 'CyberSource';
38
+ /** CyberSource's Secure Acceptance hosts: production, test, and production in India. */
39
+ export const CYBERSOURCE_SECURE_ACCEPTANCE_HOSTS = Object.freeze([
40
+ 'secureacceptance.cybersource.com', 'testsecureacceptance.cybersource.com', 'secureacceptance.in.cybersource.com',
41
+ ]);
42
+ /**
43
+ * CDP Fetch patterns for every /silent/ path on the three hosts, armed on every attachment, over https
44
+ * and over http, each host also with its trailing dot: Chrome sends a URL spelled either way unchanged,
45
+ * and DNS reads both spellings as the same host, so a page's form posted to either reaches CyberSource.
46
+ * The * before silent/ also pauses a path that doubles its slash, as a base URL that ends in a slash
47
+ * joined to /silent/pay writes it, which a server that merges slashes reads as /silent/pay. The gate
48
+ * judges each path with its slashes merged (isCybersourceSecureAcceptanceUrl), and anything else the *
49
+ * pauses, such as /billing/silent/pay, continues untouched. A pattern matches the canonical URL Chrome
50
+ * sends, whose host is lower case and whose standard port is dropped; no URL without silent/ is armed.
51
+ */
52
+ export const CYBERSOURCE_SECURE_ACCEPTANCE_PATTERNS = Object.freeze(CYBERSOURCE_SECURE_ACCEPTANCE_HOSTS.flatMap((host) => ['https', 'http'].flatMap((scheme) => [`${scheme}://${host}/*silent/*`, `${scheme}://${host}./*silent/*`])));
53
+ /**
54
+ * Whether this URL is a /silent/ path on one of the three hosts: https or http, the host with or without
55
+ * its trailing dot, on the scheme's standard port, with no credentials, and its path read with each run
56
+ * of slashes merged into one, as a server that merges slashes reads it.
57
+ */
58
+ export function isCybersourceSecureAcceptanceUrl(url) {
59
+ let parsed;
60
+ try {
61
+ parsed = new URL(url);
62
+ }
63
+ catch {
64
+ return false;
65
+ }
66
+ return (parsed.protocol === 'https:' || parsed.protocol === 'http:') && !parsed.port && !parsed.username && !parsed.password
67
+ && CYBERSOURCE_SECURE_ACCEPTANCE_HOSTS.includes(parsed.hostname.toLowerCase().replace(/\.$/, ''))
68
+ && parsed.pathname.replace(/\/{2,}/g, '/').startsWith('/silent/');
69
+ }
70
+ /** Methods that send no body: only the URL's query can carry a card on them. */
71
+ const BODILESS = new Set(['GET', 'HEAD', 'OPTIONS']);
72
+ /**
73
+ * What a request to a /silent/ path carries: 'card' when card_number holds a value in the URL's query,
74
+ * on any method, since a form whose method is GET puts its fields there; otherwise the body's verdict
75
+ * (cybersourceSecureAcceptanceBody) for a method that sends one, and 'no_card' for a GET, a HEAD or a
76
+ * CORS preflight.
77
+ */
78
+ export function cybersourceSecureAcceptanceRequest(url, method, body, contentType) {
79
+ let query = '';
80
+ try {
81
+ query = new URL(url).search;
82
+ }
83
+ catch {
84
+ query = '';
85
+ }
86
+ if (carriesCardNumber(formFields(query)))
87
+ return 'card';
88
+ return BODILESS.has(String(method).toUpperCase()) ? 'no_card' : cybersourceSecureAcceptanceBody(body, contentType);
89
+ }
90
+ /**
91
+ * What a Silent Order POST's body carries: 'card' when any reading of it finds a field named card_number
92
+ * that holds a value, 'no_card' when none does, and 'unreadable' for a body the adapter could not read
93
+ * (null), or a multipart body whose parts cannot be read and in which no reading finds a card, a
94
+ * multipart content type with no boundary included.
95
+ *
96
+ * The page writes both the bytes and their content type, and a server reads the bytes by that type, so
97
+ * the gate trusts no one reading. It reads every body as URL-encoded pairs (split on & and line by line,
98
+ * which also reads a plain-text form's name=value lines), as JSON at any depth, and as a multipart form:
99
+ * by its parts, when its content type names a boundary or it opens with a delimiter line and a part
100
+ * header, and by every part header that names card_number, wherever it sits. A card in any reading stops
101
+ * the post, so a body whose content type names one encoding and whose bytes hold another, a URL-encoded
102
+ * body that also parses as JSON, say, cannot carry the card past the gate.
103
+ */
104
+ export function cybersourceSecureAcceptanceBody(body, contentType) {
105
+ if (typeof body !== 'string')
106
+ return 'unreadable';
107
+ const delimiter = multipartDelimiter(body, typeof contentType === 'string' ? contentType : '');
108
+ const parts = delimiter === undefined ? [] : delimiter === null ? null : multipartFields(body, delimiter);
109
+ if (carriesCardNumber(formFields(body)) || carriesCardNumber(jsonFields(body)) || carriesCardNumber(parts ?? [])
110
+ || multipartNamesCardNumber(body, delimiter ?? undefined))
111
+ return 'card';
112
+ return parts === null ? 'unreadable' : 'no_card';
113
+ }
114
+ /**
115
+ * Whether a field named card_number holds a value. The name matches in any case and every occurrence
116
+ * counts; an empty value, or one of whitespace only, holds no card.
117
+ */
118
+ function carriesCardNumber(fields) {
119
+ return fields.some(([name, value]) => name.trim().toLowerCase() === 'card_number'
120
+ && value !== undefined && value !== null && !(typeof value === 'string' && value.trim() === ''));
121
+ }
122
+ /**
123
+ * The delimiter line of a multipart body: the one its content type names, or, whatever its content type
124
+ * says, the one it opens with when a part header follows. Undefined for a body that is not multipart,
125
+ * and null for a multipart content type that names no boundary.
126
+ */
127
+ function multipartDelimiter(body, contentType) {
128
+ if (/^\s*multipart\//i.test(contentType)) {
129
+ const boundary = /;\s*boundary=(?:"([^"]+)"|([^;\s]+))/i.exec(contentType);
130
+ return boundary ? `--${boundary[1] ?? boundary[2]}` : null;
131
+ }
132
+ return /^(--[^\r\n]+)\r?\n[^\s:]+:/.exec(body)?.[1];
133
+ }
134
+ /**
135
+ * A multipart body's named parts, or null when a body with content never names its delimiter or one
136
+ * of its parts has no blank line after its headers. A part takes every name its headers give it.
137
+ */
138
+ function multipartFields(body, delimiter) {
139
+ if (!body.includes(delimiter))
140
+ return body.trim() === '' ? [] : null;
141
+ const fields = [];
142
+ for (const part of body.split(delimiter).slice(1)) {
143
+ if (part.startsWith('--'))
144
+ break; // the closing delimiter
145
+ const blank = /\r?\n\r?\n/.exec(part);
146
+ if (!blank)
147
+ return null;
148
+ const value = part.slice(blank.index + blank[0].length).replace(/\r?\n$/, '');
149
+ for (const name of headerNames(part.slice(0, blank.index)))
150
+ fields.push([name, value]);
151
+ }
152
+ return fields;
153
+ }
154
+ /** Every name a part's headers give it, quoted or bare, whichever header carries it. */
155
+ function headerNames(headers) {
156
+ return [...headers.matchAll(/;\s*name\s*=\s*(?:"([^"]*)"|([^;\s"]*))/gi)].map((match) => match[1] ?? match[2]);
157
+ }
158
+ /**
159
+ * Whether a part named card_number holds a value, read without trusting where the body splits into
160
+ * parts: each header line that names card_number, wherever it sits, opens a part whose value runs from
161
+ * the blank line after its headers to the next delimiter line (the body's own, or any line that opens
162
+ * with -- when it names none). A server that splits the parts elsewhere, at a delimiter written inside
163
+ * another part's value, say, finds no card this reading misses.
164
+ */
165
+ function multipartNamesCardNumber(body, delimiter) {
166
+ const lines = body.split(/\r?\n/);
167
+ const ends = (line) => (delimiter === undefined ? line.startsWith('--') : [delimiter, `${delimiter}--`].includes(line.trimEnd()));
168
+ for (let i = 0; i < lines.length; i++) {
169
+ if (!/^[^\s:]+:/.test(lines[i]) || !headerNames(lines[i]).some((name) => name.trim().toLowerCase() === 'card_number'))
170
+ continue;
171
+ let j = i + 1;
172
+ while (j < lines.length && lines[j].trim() !== '')
173
+ j++;
174
+ for (j++; j < lines.length && !ends(lines[j]); j++)
175
+ if (lines[j].trim() !== '')
176
+ return true;
177
+ }
178
+ return false;
179
+ }
180
+ /** Every key of a JSON body, at any depth, with its value; none for a body that is not JSON. */
181
+ function jsonFields(body) {
182
+ if (!/^\s*[[{]/.test(body))
183
+ return [];
184
+ let parsed;
185
+ try {
186
+ parsed = JSON.parse(body);
187
+ }
188
+ catch {
189
+ return [];
190
+ }
191
+ const fields = [];
192
+ const walk = (node, depth) => {
193
+ if (node === null || typeof node !== 'object' || depth > 64)
194
+ return;
195
+ for (const [name, value] of Object.entries(node)) {
196
+ fields.push([name, value]);
197
+ walk(value, depth + 1);
198
+ }
199
+ };
200
+ walk(parsed, 0);
201
+ return fields;
202
+ }
203
+ /**
204
+ * URL-encoded pairs, split on & as a server splits a form, and again line by line: a plain-text form
205
+ * sends name=value lines, and no raw line break survives URL encoding, so a line break in a URL-encoded
206
+ * body only comes from a page that wrote one there.
207
+ */
208
+ function formFields(body) {
209
+ const fields = [...new URLSearchParams(body)];
210
+ for (const line of body.split(/[\r\n]+/))
211
+ for (const pair of new URLSearchParams(line))
212
+ fields.push(pair);
213
+ return fields;
214
+ }
@@ -18,8 +18,8 @@ export interface EprotectMerchantPin {
18
18
  * (merchant_profile_mismatch) before any preparation exists. When this build pins the paypageId
19
19
  * too, it refuses another name first, before any network call, as a Fiserv checkout must name its
20
20
  * key pin's merchant. A paypageId this build does not pin is the API's to judge (unsupported_checkout
21
- * with no pin); none is pinned on either side yet. The pre-live host takes only the guide's test
22
- * cards and needs no pin. `pins` is for tests.
21
+ * with no pin). This build pins SmartPak Equine and Nordstrom, under those exact names. The pre-live
22
+ * host takes only the guide's test cards and needs no pin. `pins` is for tests.
23
23
  */
24
24
  export declare function eprotectCheckoutRefusal(input: {
25
25
  environment: string;
@@ -4,22 +4,61 @@ declare var EPROTECT_HOSTS: Readonly<{
4
4
  sandbox: "request.eprotect.vantivprelive.com";
5
5
  }>;
6
6
  declare var EPROTECT_SECONDARY_HOST: string;
7
- declare var EPROTECT_KEYS: Readonly<{
8
- production: Readonly<{
9
- keyId: "26455500012";
10
- exponent: "10001";
11
- modulus: "b9c7095ff203475347a932a6e11bacbb61cfb66a877158683634e5fb1dbf9923401bd7f82c21b67ffd3c82bdc64797c5e2ba4b57c68b1aaccb7fbe847da7234a21df910dfcc0aebacbbd4d36b35c0c35f7ee27358610d2e2fb2aa87d359deda0b5f4d77e31ac5ab98741da5b6052cb657087da05ad496154b8954939ee6fd463301ff15ebca94f210f4627a255a95ca8833728c1ab80b6cc3a874e4d3dce5d40f66c043ba1b042717bb9cc5d89434fa489a51c2ba9a3843b310df58c9e8a54c36cdd5fd66e76651b6fc88850b60e0739abfcf7d0d0cb44beb7e768da3bcea7e743b8c2d57edef59643f54432ccf60c49d4f5f84410ecf9c5a7af19bc5e792801";
12
- }>;
13
- sandbox: Readonly<{
14
- keyId: "1";
15
- exponent: "10001";
16
- modulus: "bc637dd74ba76507dad5af1c7ad6f97dbef5298c3b9f74caea7301347db7b4a8c37f26491863100667246fd45071f3346bf62239f9b117d06fb67861b66ad0d158beeddd2f6f28be93d846f4c8f9ba1bd7e8f186f36cab0e432f22b3d732c221a9ff00a9bfacb88b24503e2695fd7237835d4936477b21289478906a49b164f52503c20eb29f11fcbda2af94deb9a0bfde5a4589276897436315c5d664d60bf10650164f509283aed39747ad5d6cb2bbe54e1b42306e5db37dfd42dcbfcc689e0ddfe3bc9cb22ae7018e5a4a1ff39813584ac7bd6d6d65ca763f0a672da454081ea20e8b1d403316d80b9353ba396bea8962b1a7d2f775c76612d857c1f7594f";
17
- }>;
18
- }>;
7
+ declare var EPROTECT_KEY_SOURCES: any;
8
+ declare var EPROTECT_KEY_SCRIPT_MAX_BYTES: number;
19
9
  declare var EPROTECT_TEST_PANS: Readonly<Set<unknown>>;
20
10
  declare var EPROTECT_REFUSAL_CODES: readonly string[];
21
11
  declare function eprotectEnvironment(hostname: any): "production" | "sandbox" | null;
22
12
  declare function eprotectPreparationUrl(environment: any): string;
13
+ declare function eprotectKeySourceUrl(environment: any): string;
14
+ declare function eprotectScriptFacts(bytes: any): {
15
+ literals: number;
16
+ keyId?: undefined;
17
+ modulus?: undefined;
18
+ exponent?: undefined;
19
+ modulusSha256?: undefined;
20
+ maskedSha256?: undefined;
21
+ } | {
22
+ literals: number;
23
+ keyId: string;
24
+ modulus: string;
25
+ exponent: string;
26
+ modulusSha256: string;
27
+ maskedSha256: string;
28
+ };
29
+ declare function eprotectKeyScriptVerdict(environment: any, bytes: any, sources?: any): {
30
+ ok: boolean;
31
+ reason: string;
32
+ maskedSha256?: undefined;
33
+ keyId?: undefined;
34
+ modulus?: undefined;
35
+ modulusSha256?: undefined;
36
+ } | {
37
+ ok: boolean;
38
+ reason: string;
39
+ maskedSha256: string | undefined;
40
+ keyId?: undefined;
41
+ modulus?: undefined;
42
+ modulusSha256?: undefined;
43
+ } | {
44
+ ok: boolean;
45
+ keyId: string;
46
+ modulus: string;
47
+ modulusSha256: string;
48
+ maskedSha256: string;
49
+ reason?: undefined;
50
+ };
51
+ declare function readEprotectKeyScript(environment: any, bytes: any, sources?: any): Readonly<{
52
+ environment: any;
53
+ keyId: string | undefined;
54
+ modulus: string | undefined;
55
+ exponent: "10001";
56
+ modulusSha256: string | undefined;
57
+ }>;
58
+ declare function eprotectKeyReport(key: any): Readonly<{
59
+ key_id: any;
60
+ modulus_sha256: any;
61
+ }>;
23
62
  declare function isEprotectTokenRequest(url: any, method: any): boolean;
24
63
  declare function isEprotectRequest(request: any): boolean;
25
64
  declare function eprotectRequestFacts(url: any): {
@@ -35,7 +74,7 @@ declare function eprotectSecondaryAttempt(url: any): {
35
74
  paypageId: any;
36
75
  id: any;
37
76
  } | null;
38
- declare function isEprotectDeviceRequest(templateUrl: any, deviceUrl: any): boolean;
77
+ declare function isEprotectDeviceRequest(templateUrl: any, deviceUrl: any, sessionKeyId: any): boolean;
39
78
  declare function isPreparedEprotectRequest(url: any, method: any, body: any, environment: any, paypageId: any): boolean;
40
79
  declare var EPROTECT_MERCHANT_PINS: any;
41
80
  declare function eprotectMerchantPin(paypageId: any, merchantOrigin: any, pins?: any): any;
@@ -43,7 +82,7 @@ declare function eprotectMerchantRefusal(environment: any, paypageId: any, merch
43
82
  declare function defaultRandom(bytes: any): void;
44
83
  declare function eprotectEncrypt(text: any, key: any, random?: typeof defaultRandom): string;
45
84
  declare function eprotectCardRefusal(environment: any, cardNumber: any): "unsupported_environment" | "sandbox_host_requires_documented_test_card" | "invalid_card_number" | "live_host_refuses_documented_test_card" | null;
46
- declare function eprotectDeviceRequest(templateUrl: any, card: any, random?: typeof defaultRandom): {
85
+ declare function eprotectDeviceRequest(templateUrl: any, card: any, sessionKey: any, random?: typeof defaultRandom): {
47
86
  url: string;
48
87
  method: string;
49
88
  headers: {};
@@ -74,4 +113,4 @@ declare function eprotectGiveUp(url: any): {
74
113
  code: any;
75
114
  } | null;
76
115
  declare function eprotectRefusalCode(bodyText: any): any;
77
- export { EPROTECT_HOSTS, EPROTECT_KEYS, EPROTECT_MERCHANT_PINS, EPROTECT_PATH, EPROTECT_REFUSAL_CODES, EPROTECT_SECONDARY_HOST, EPROTECT_TEST_PANS, eprotectCardRefusal, eprotectDeviceRequest, eprotectEncrypt, eprotectEnvironment, eprotectGiveUp, eprotectJsonp, eprotectMerchantPin, eprotectMerchantRefusal, eprotectOutcome, eprotectPreparationUrl, eprotectRefusalCode, eprotectRequestFacts, eprotectSecondaryAttempt, isEprotectDeviceRequest, isEprotectRequest, isEprotectTokenRequest, isPreparedEprotectRequest, sanitizeEprotectRegistration };
116
+ export { EPROTECT_HOSTS, EPROTECT_KEY_SCRIPT_MAX_BYTES, EPROTECT_KEY_SOURCES, EPROTECT_MERCHANT_PINS, EPROTECT_PATH, EPROTECT_REFUSAL_CODES, EPROTECT_SECONDARY_HOST, EPROTECT_TEST_PANS, eprotectCardRefusal, eprotectDeviceRequest, eprotectEncrypt, eprotectEnvironment, eprotectGiveUp, eprotectJsonp, eprotectKeyReport, eprotectKeyScriptVerdict, eprotectKeySourceUrl, eprotectMerchantPin, eprotectMerchantRefusal, eprotectOutcome, eprotectPreparationUrl, eprotectRefusalCode, eprotectRequestFacts, eprotectScriptFacts, eprotectSecondaryAttempt, isEprotectDeviceRequest, isEprotectRequest, isEprotectTokenRequest, isPreparedEprotectRequest, readEprotectKeyScript, sanitizeEprotectRegistration };