@agent-cards/sdk 0.23.18 → 0.23.20

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.
Files changed (49) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/PREFLIGHT.md +2 -0
  3. package/README.md +46 -7
  4. package/dist/aci.d.ts +0 -7
  5. package/dist/aci.js +0 -19
  6. package/dist/amadeus.d.ts +4 -2
  7. package/dist/amadeus.js +16 -3
  8. package/dist/buy.d.ts +84 -2
  9. package/dist/buy.js +16 -1
  10. package/dist/card-endpoint-facts.d.ts +2 -1
  11. package/dist/card-endpoint-facts.js +18 -9
  12. package/dist/card-endpoint.d.ts +20 -4
  13. package/dist/card-endpoint.js +38 -4
  14. package/dist/card-fields.generated.js +974 -45
  15. package/dist/cdp.d.ts +29 -0
  16. package/dist/cdp.js +302 -18
  17. package/dist/client.d.ts +43 -5
  18. package/dist/client.js +237 -43
  19. package/dist/datatrans.d.ts +2 -2
  20. package/dist/datatrans.generated.js +16 -11
  21. package/dist/datatrans.js +2 -2
  22. package/dist/hipay.generated.d.ts +56 -0
  23. package/dist/hipay.generated.js +389 -0
  24. package/dist/hold.d.ts +180 -0
  25. package/dist/hold.js +264 -0
  26. package/dist/index.d.ts +3 -1
  27. package/dist/index.js +1 -0
  28. package/dist/lifecycle.d.ts +10 -0
  29. package/dist/lifecycle.js +21 -0
  30. package/dist/merchant-card-endpoints.generated.js +102 -11
  31. package/dist/paddle-vgs.generated.d.ts +3 -2
  32. package/dist/paddle-vgs.generated.js +9 -5
  33. package/dist/pelecard.generated.d.ts +2 -1
  34. package/dist/pelecard.generated.js +14 -5
  35. package/dist/pre-claim.d.ts +14 -0
  36. package/dist/pre-claim.js +76 -3
  37. package/dist/prepared-processor.d.ts +6 -2
  38. package/dist/prepared-processor.js +18 -2
  39. package/dist/primer.generated.js +998 -69
  40. package/dist/quickpay.d.ts +44 -0
  41. package/dist/quickpay.js +65 -0
  42. package/dist/stripe-checkout.generated.js +320 -2
  43. package/dist/twoc2p.d.ts +54 -0
  44. package/dist/twoc2p.generated.d.ts +33 -0
  45. package/dist/twoc2p.generated.js +1145 -0
  46. package/dist/twoc2p.js +85 -0
  47. package/dist/voice.d.ts +16 -13
  48. package/dist/voice.js +13 -10
  49. package/package.json +3 -3
@@ -0,0 +1,44 @@
1
+ /**
2
+ * QuickPay's hosted payment window (where most Danish and Nordic webshops send the buyer), as this SDK reads it.
3
+ *
4
+ * The merchant's page posts a signed entry form, top-level, to https://payment.quickpay.net/ (QuickPay's Form
5
+ * API v10), and QuickPay answers with a redirect to its own window under a session of its own (/<32 hex>). That
6
+ * entry carries no card, and it is the one request this SDK pauses: the cardholder's device repeats it over the
7
+ * end-to-end TLS relay and fills the card into the window QuickPay returns to it (payment-core
8
+ * processors/quickpay.js). Everything else the agent's browser posts to QuickPay carries a card the agent typed
9
+ * or follows one: the window's card post (/process_card), its fee lookup (/calculate_fee, which carries the card
10
+ * number), its wallet token post (/process_payment_token) and its 3-D Secure step (/<session>/3ds_auth). The
11
+ * window also looks up the card's first eight digits with a GET (/payment-methods?bin=...). This SDK aborts every
12
+ * one of them, so a placeholder card never reaches QuickPay.
13
+ *
14
+ * The host is payment-core's QUICKPAY_HOSTS; quickpay.test.mjs pins the two lists together. QuickPay has no test
15
+ * host: a test payment runs on the same host with QuickPay's own test cards.
16
+ */
17
+ export declare const QUICKPAY_PSP = "quickpay";
18
+ export declare const QUICKPAY_HOSTS: readonly string[];
19
+ /** Whether this URL is on QuickPay's window host (https, no credentials, any port, a trailing dot or not). */
20
+ export declare function isQuickpayHost(url: string): boolean;
21
+ /**
22
+ * The only request on QuickPay's host that is the merchant's entry: a POST to the host's root, written exactly as
23
+ * a form action writes it, with no port, query or fragment (payment-core isQuickpayEntryUrl, which takes that one
24
+ * string only). The entry the SDK pauses; every other POST there is aborted.
25
+ */
26
+ export declare function isQuickpayEntry(url: string, method: string): boolean;
27
+ /**
28
+ * The window's card lookup: a GET on QuickPay's host to /payment-methods, which names the first eight digits of
29
+ * the card typed so far in its `bin` query. Any other GET there (the window itself, its scripts and images) is
30
+ * not a card request.
31
+ */
32
+ export declare function isQuickpayCardLookup(url: string, method: string): boolean;
33
+ /** The entry URL the registry recognizes when this build is armed for QuickPay, for any URL on QuickPay's host. */
34
+ export declare function quickpayEntryUrl(url: string): string | null;
35
+ /**
36
+ * Whether an adapter must hand this request to the pre-claim gates: it is on QuickPay's host and this build's
37
+ * registry serves QuickPay's entry. The window's card post and the other card requests are not the entry, so the
38
+ * registry's card-request test does not name them; the CDP adapter still pauses them through the recognizer's
39
+ * host pattern, and attachToPlaywright's route predicate asks this, so both adapters show the gates every
40
+ * request to QuickPay's host once QuickPay is armed.
41
+ */
42
+ export declare function isArmedQuickpayUrl(vault: {
43
+ isCardRequest(url: string, method?: string): boolean;
44
+ }, url: string): boolean;
@@ -0,0 +1,65 @@
1
+ /**
2
+ * QuickPay's hosted payment window (where most Danish and Nordic webshops send the buyer), as this SDK reads it.
3
+ *
4
+ * The merchant's page posts a signed entry form, top-level, to https://payment.quickpay.net/ (QuickPay's Form
5
+ * API v10), and QuickPay answers with a redirect to its own window under a session of its own (/<32 hex>). That
6
+ * entry carries no card, and it is the one request this SDK pauses: the cardholder's device repeats it over the
7
+ * end-to-end TLS relay and fills the card into the window QuickPay returns to it (payment-core
8
+ * processors/quickpay.js). Everything else the agent's browser posts to QuickPay carries a card the agent typed
9
+ * or follows one: the window's card post (/process_card), its fee lookup (/calculate_fee, which carries the card
10
+ * number), its wallet token post (/process_payment_token) and its 3-D Secure step (/<session>/3ds_auth). The
11
+ * window also looks up the card's first eight digits with a GET (/payment-methods?bin=...). This SDK aborts every
12
+ * one of them, so a placeholder card never reaches QuickPay.
13
+ *
14
+ * The host is payment-core's QUICKPAY_HOSTS; quickpay.test.mjs pins the two lists together. QuickPay has no test
15
+ * host: a test payment runs on the same host with QuickPay's own test cards.
16
+ */
17
+ export const QUICKPAY_PSP = 'quickpay';
18
+ export const QUICKPAY_HOSTS = Object.freeze(['payment.quickpay.net']);
19
+ const QUICKPAY_ENTRY_URL = 'https://payment.quickpay.net/';
20
+ /** Whether this URL is on QuickPay's window host (https, no credentials, any port, a trailing dot or not). */
21
+ export function isQuickpayHost(url) {
22
+ let parsed;
23
+ try {
24
+ parsed = new URL(url);
25
+ }
26
+ catch {
27
+ return false;
28
+ }
29
+ return parsed.protocol === 'https:' && !parsed.username && !parsed.password
30
+ && QUICKPAY_HOSTS.includes(parsed.hostname.toLowerCase().replace(/\.$/, ''));
31
+ }
32
+ /**
33
+ * The only request on QuickPay's host that is the merchant's entry: a POST to the host's root, written exactly as
34
+ * a form action writes it, with no port, query or fragment (payment-core isQuickpayEntryUrl, which takes that one
35
+ * string only). The entry the SDK pauses; every other POST there is aborted.
36
+ */
37
+ export function isQuickpayEntry(url, method) {
38
+ return String(method).toUpperCase() === 'POST' && url === QUICKPAY_ENTRY_URL;
39
+ }
40
+ /**
41
+ * The window's card lookup: a GET on QuickPay's host to /payment-methods, which names the first eight digits of
42
+ * the card typed so far in its `bin` query. Any other GET there (the window itself, its scripts and images) is
43
+ * not a card request.
44
+ */
45
+ export function isQuickpayCardLookup(url, method) {
46
+ if (String(method).toUpperCase() !== 'GET' || !isQuickpayHost(url))
47
+ return false;
48
+ const parsed = new URL(url);
49
+ return /(?:^|\/)payment-methods\/?$/i.test(parsed.pathname) || parsed.searchParams.has('bin');
50
+ }
51
+ /** The entry URL the registry recognizes when this build is armed for QuickPay, for any URL on QuickPay's host. */
52
+ export function quickpayEntryUrl(url) {
53
+ return isQuickpayHost(url) ? QUICKPAY_ENTRY_URL : null;
54
+ }
55
+ /**
56
+ * Whether an adapter must hand this request to the pre-claim gates: it is on QuickPay's host and this build's
57
+ * registry serves QuickPay's entry. The window's card post and the other card requests are not the entry, so the
58
+ * registry's card-request test does not name them; the CDP adapter still pauses them through the recognizer's
59
+ * host pattern, and attachToPlaywright's route predicate asks this, so both adapters show the gates every
60
+ * request to QuickPay's host once QuickPay is armed.
61
+ */
62
+ export function isArmedQuickpayUrl(vault, url) {
63
+ const entry = quickpayEntryUrl(url);
64
+ return entry !== null && vault.isCardRequest(entry, 'POST');
65
+ }
@@ -1,6 +1,6 @@
1
1
  // @ts-nocheck
2
2
  // Generated from @agent-cards/payment-core. Do not edit.
3
- // artifact-sha256: 7140b6eee18986c07c3393c1a950467cd13a86c32f47813ab57af11c7cd3fa02
3
+ // artifact-sha256: abafbcce1536643bd38817e2332c0e107e93b04bc347051096c6e031cda00722
4
4
  // src/deep-freeze.js
5
5
  function deepFreeze(value) {
6
6
  if (value && typeof value === "object" && !Object.isFrozen(value)) {
@@ -502,6 +502,104 @@ var PROCESSOR_DEFINITIONS = deepFreeze([
502
502
  dedupe: ["(token)"]
503
503
  }
504
504
  },
505
+ {
506
+ psp: "comgate",
507
+ // ComGate's payment gateway, where most Czech and Slovak e-shops send the buyer (ComGate's own WooCommerce,
508
+ // Shoptet, PrestaShop and Magento modules). The merchant's server creates the payment at ComGate, which keeps
509
+ // the amount, the currency and the merchant on its side, and sends the buyer's browser to the gateway URL
510
+ // ComGate answered with, https://payN.comgate.cz/init?id=<transaction id> (processors/comgate.js). The
511
+ // gateway is an app that takes the card in ComGate's own card frames (sec.comgate.cz), encrypts it there
512
+ // under the payment's own RSA key and posts the ciphertext to ComGate's API (payments.comgate.cz, or
513
+ // payments-gcp.comgate.cz behind pay3 and pay4). The paused request is therefore the entry, a GET Document
514
+ // navigation that carries no card and no body: the cardholder's device makes the gateway's own API calls
515
+ // for that payment over the end-to-end TLS relay, holds the payment ComGate returns to what the person
516
+ // approved, encrypts the card under the payment's key as the card frame does and posts it, and the runtime
517
+ // resolves the paused navigation with the hosted_form notice. Only the entry is matched, exactly
518
+ // (processors/comgate.js isComgateEntryUrl: the one `id` parameter, nothing else). The card post
519
+ // (/client/instructions/card-process), the BIN lookup (/bin-checker, /client/instructions/check-card) and
520
+ // the Web Checkout SDK's /checkout/provider calls carry a card or part of one, already encrypted in ComGate's
521
+ // frame, so no body rule can see it: this lane's SDK change aborts every call to those paths in the agent's
522
+ // browser, as it pauses the entry, and no dummy card ever reaches ComGate. ComGate has no test host for merchants: a test
523
+ // payment runs on these hosts and says so in the payment the API returns, so the hosts mark no environment.
524
+ // Dark: served only to a client that declares the capability, and gated off for every org the operator has
525
+ // not allowlisted. `(?![\w/.%-])` ends the path for a consumer that tests `match` unanchored.
526
+ capability: "comgate_hosted_payment_page",
527
+ match: "pay[1-4]\\.comgate\\.cz/init(?![\\w/.%-])",
528
+ hosts: ["^pay1\\.comgate\\.cz$", "^pay2\\.comgate\\.cz$", "^pay3\\.comgate\\.cz$", "^pay4\\.comgate\\.cz$"],
529
+ // The entry has no body; `encoding` names none, and the card rides the JSON the device builds.
530
+ encoding: "form",
531
+ passthroughHeaders: [],
532
+ // The paused request is the navigation itself, a GET with the payment's id in its one query parameter.
533
+ request: { method: "GET", cardIn: "processor_page", response: "document" },
534
+ mode: "hosted_form",
535
+ hostedForm: {
536
+ // The card goes into ComGate's API from the device, not into the paused entry, which carries none. The
537
+ // device never posts a form of its own: the Vault's form-action policy leaves these hosts out.
538
+ cardIn: "processor_page",
539
+ // The entry's own rules (processors/comgate.js checkComgateEntry), the reviewed merchants among them: the
540
+ // create runs them, and naming them here makes the cardholder's device run them again on the entry it is
541
+ // about to repeat (forms.js hostedFormTemplateRefusal).
542
+ policy: "comgate",
543
+ required: [],
544
+ // The members of ComGate's card-process body the device writes, each the card frame's own ciphertext:
545
+ // the number, the expiry and the security code (`secret` in ComGate's names).
546
+ card: { number: "number", expiry: "expiry", cvc: "secret" },
547
+ // The payment's id names one payment (checkComgateEntry's dedupe): the entry's only parameter.
548
+ dedupe: ["id"]
549
+ }
550
+ },
551
+ {
552
+ psp: "paytrail",
553
+ // Paytrail's card method, the one Visa and Mastercard form on the payment wall most Finnish webshops send
554
+ // the buyer to (WooCommerce, MyCashflow, Vilkas and the merchants' own pages render the same forms). The
555
+ // merchant's page, or Paytrail's own wall, posts a card-free ENTRY top-level to
556
+ // https://services.paytrail.com/payments/<transaction>/click-to-pay/loading-and-redirect: seven checkout-
557
+ // fields Paytrail signed for the merchant (its account, the transaction, a timestamp, a nonce and an HMAC).
558
+ // Paytrail answers with a loading page that re-posts them to .../initialize-payment, which sends the
559
+ // browser to Payment Highway's card page (v1.api.paymenthighway.io, Paytrail's card platform) under a
560
+ // session of its own, so a card post made away from that session has no payment to pay
561
+ // (processors/paytrail.js). The paused request is therefore the entry, a Document navigation that carries
562
+ // no card: the cardholder's device repeats it over the end-to-end TLS relay, follows it to the card page,
563
+ // posts the card there in that same session, and the runtime resolves the paused navigation with the
564
+ // hosted_form notice. Only the entry path is matched, exactly (processors/paytrail.js isPaytrailEntryUrl:
565
+ // 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; the SDK's pause, a later
567
+ // change, refuses them in the agent's browser, so no dummy card reaches Payment Highway. The entry names no amount: Paytrail
568
+ // holds it, so the cardholder approves the agent's amount and the device holds it to the amount the card
569
+ // page names. Paytrail's public test merchant shares this host, so the host marks no environment. Dark:
570
+ // served only to a client that declares the capability, and gated off for every org the operator has not
571
+ // allowlisted.
572
+ capability: "paytrail_hosted_payment_page",
573
+ 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
+ hosts: ["^services\\.paytrail\\.com$"],
575
+ encoding: "form",
576
+ passthroughHeaders: [],
577
+ mode: "hosted_form",
578
+ hostedForm: {
579
+ // The card goes into Payment Highway's card page, which the device reaches from the entry, never into the
580
+ // paused entry, which must carry none (processors/paytrail.js checkPaytrailEntry). The device never posts
581
+ // a form of its own: the Vault's form-action policy leaves this host out.
582
+ cardIn: "processor_page",
583
+ // The entry's own rules (processors/paytrail.js checkPaytrailEntry), the reviewed merchants among them:
584
+ // the create runs them, and naming them here makes the cardholder's device run them again on the entry
585
+ // it is about to repeat (forms.js hostedFormTemplateRefusal).
586
+ policy: "paytrail",
587
+ required: [
588
+ "checkout-transaction-id",
589
+ "checkout-account",
590
+ "checkout-method",
591
+ "checkout-algorithm",
592
+ "checkout-timestamp",
593
+ "checkout-nonce",
594
+ "signature"
595
+ ],
596
+ // The card page's own card members, which the device writes into the page's JSON card post (never into
597
+ // the entry).
598
+ card: { number: "pan", month: "expiry_month", year: "expiry_year", cvc: "cvc" },
599
+ // The merchant's account and the transaction name one payment.
600
+ dedupe: ["checkout-account", "checkout-transaction-id"]
601
+ }
602
+ },
505
603
  // ── Verified tokenizers (plaintext PAN in the body) ───────────────────────
506
604
  // Each entry below was checked against the PSP's own shipped browser SDK or a
507
605
  // live probe, then run through resolveRecognizerForUrl with positive, sibling
@@ -1970,6 +2068,165 @@ var PROCESSOR_DEFINITIONS = deepFreeze([
1970
2068
  hosts: ["^payment\\.pay\\.nl$"],
1971
2069
  encoding: "multipart",
1972
2070
  passthroughHeaders: []
2071
+ },
2072
+ {
2073
+ psp: "revolut",
2074
+ // Revolut Business's online checkout (Revolut Merchant, UK and EEA): the card field and card popup
2075
+ // RevolutCheckout.js mounts as frames from merchant.revolut.com, for an order the merchant's server made,
2076
+ // on the merchant's own page (the WooCommerce plugin among them) or Revolut's hosted checkout page. The
2077
+ // frame's pay posts the card as one JSON body to its own origin's /api/public/orders/<order token>/payments,
2078
+ // the token a lowercase uuid. PAN@ payment_method.number, the expiry as numbers @ .expiry_month and
2079
+ // .expiry_year (four digits), the code @ .cvv, beside the order's amount in minor units. Unencrypted.
2080
+ // revolut.js holds the rule the pause decision, the API's create and the device all read: exactly this
2081
+ // URL, the frame's own headers, and its card payment body byte for byte, with a payment that keeps the
2082
+ // card on file (save_for CUSTOMER or MERCHANT) refused by its own code. A payment with another method
2083
+ // (Apple Pay, Google Pay, Revolut Pay, open banking) carries no card on the same URL and continues
2084
+ // untouched (passWithoutCard). merchant.revolut.com answers the Vault's origin, so the cardholder's device
2085
+ // sends the request itself. 3-D Secure follows the answer in the agent's page, card free. The environment
2086
+ // is pinned (S7): sandbox-merchant.revolut.com only on test rows and only with test cards (revolut.js
2087
+ // REVOLUT_TEST_CARDS), merchant.revolut.com only on live rows.
2088
+ // Ships dark: served only to a client that declares `revolut_card_field`, gated off for every org until an
2089
+ // operator lists one (`revolut:<org>`), and the backend's gate serves only Agentcard's own company until the
2090
+ // order the payment names is bound to what the cardholder approves (backend config.ts REVOLUT_ORDER_BOUND_TO_APPROVAL).
2091
+ // Autopilot never sends this request (autopilot.js DEVICE_REPLAY_REFUSED_OPERATIONS).
2092
+ capability: "revolut_card_field",
2093
+ match: "(?:sandbox-)?merchant\\.revolut\\.com/api/public/orders/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/payments",
2094
+ hosts: ["^merchant\\.revolut\\.com$", "^sandbox-merchant\\.revolut\\.com$"],
2095
+ sandboxHosts: ["^sandbox-merchant\\.revolut\\.com$"],
2096
+ hostEnvironmentPinned: true,
2097
+ encoding: "json",
2098
+ // The frame's own headers: the API version Revolut reads the body by, its device id and the widget's
2099
+ // version (the four the preflight allows, with the content type), and the JSON Accept. Origin, Referer
2100
+ // and cookies never ride (the frame's own fetch carries Revolut's cookies only because it is same origin).
2101
+ passthroughHeaders: ["^revolut-api-version$", "^revolut-device-id$", "^revolut-client-version$", "^accept$"],
2102
+ jsonCardFields: [["payment_method", "number"]],
2103
+ passWithoutCard: "(?:sandbox-)?merchant\\.revolut\\.com/api/public/orders/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/payments"
2104
+ },
2105
+ {
2106
+ psp: "sumup",
2107
+ // SumUp's online payments (UK, EEA, US, Latin America): the Payment Widget
2108
+ // (gateway.sumup.com/gateway/ecom/card/v2/sdk.js) that SumUp's WooCommerce plugin, its Payment Links, Online
2109
+ // Store and invoices all mount (its hosted checkout page too, which this lane refuses: that page serves every
2110
+ // merchant from one origin). Each card field is a frame on gateway.sumup.com, and a
2111
+ // hidden form frame there sends the card in one PUT to https://api.sumup.com/v0.2/checkouts/<checkout id>:
2112
+ // JSON {"payment_type":"card","device_information":..,"card":{"name","number","expiry_month":"MM",
2113
+ // "expiry_year":"YY" or "YYYY","cvv"},"installments":1,..}, unencrypted, with X-Sumup-Correlation-Id naming
2114
+ // the same checkout. sumup.js holds the request rule the pause decision, the API's create and the device all
2115
+ // read: exactly that URL, a JSON Content-Type, the correlation id, and the widget's body byte for byte, with
2116
+ // a body that carries a recurring mandate, which keeps the card at SumUp, refused. The body names no
2117
+ // amount and no merchant: the checkout the merchant's server created holds both, so a live request is taken
2118
+ // only for a checkout origin a reviewed pin lists. The request carries no cookie and no Authorization
2119
+ // header (the checkout id is its credential), and the API answers any browser origin's preflight with
2120
+ // credentials omitted. The answer is the checkout: PAID, FAILED, or PENDING with a 3-D Secure step the
2121
+ // widget then runs in the page. SumUp's sandbox merchants share the live host, so no sandbox host is
2122
+ // marked and the lane takes production rows only.
2123
+ // Ships dark: served only to a client that declares `sumup_checkout_process`, gated off for every org until
2124
+ // an operator lists one (`sumup:<org>`), and autopilot never sends this request (autopilot.js
2125
+ // DEVICE_REPLAY_REFUSED_OPERATIONS). `(?![\w/.%-])` ends the path for a consumer that tests `match`
2126
+ // unanchored, so the checkout's apple-pay-session sibling is never matched.
2127
+ capability: "sumup_checkout_process",
2128
+ match: "api\\.sumup\\.com/v0\\.2/checkouts/[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}(?![\\w/.%-])",
2129
+ hosts: ["^api\\.sumup\\.com$"],
2130
+ encoding: "json",
2131
+ // The widget's correlation and session ids ride as it sent them, each held to its own shape (sumup.js);
2132
+ // origin, referer and cookies never do (the widget sends no cookie).
2133
+ passthroughHeaders: ["^x-sumup-correlation-id$", "^x-sumup-widget-session-id$"],
2134
+ jsonCardFields: [["card", "number"]],
2135
+ request: { method: "PUT", cardIn: "body", response: "json" }
2136
+ },
2137
+ {
2138
+ psp: "twoc2p",
2139
+ // 2C2P's hosted payment page (pgw-ui.2c2p.com, builds 4.1 to 4.5), where most 2C2P merchants in Thailand,
2140
+ // Malaysia and Singapore send a buyer, top level or in a frame. On Pay the page encrypts the card with
2141
+ // 2C2P's own library under one static RSA-1024 key and posts one JSON request to
2142
+ // pgwv4.2c2p.com/payment/<build>/Payment (sandbox-pgwv4 for a sandbox token), the card only as
2143
+ // payment.data.securePayToken. twoc2p.js holds the rule the pause decision, the API's create, the approve
2144
+ // and the SDK read: the exact Payment URL of a reviewed build, the page's own body, and a request that keeps,
2145
+ // reuses or exposes a card, pays in instalments, converts the currency or redeems points refused. cse mode,
2146
+ // as Paddle TokenEx and Shiji STS ship: the cardholder's device writes a new securePayToken from the real
2147
+ // card under the key payment-core pins (twoc2p-keys.js), the runtime swaps it over the placeholder's, and the
2148
+ // agent's page continues the request (substituteTwoC2p). A Payment request with no card field (a QR code, a
2149
+ // bank transfer) carries none of the cardholder's cards and continues untouched (passWithoutCard). The
2150
+ // request names no amount and no merchant: the payment token binds both, which the API reads from 2C2P's
2151
+ // own session answer (twoc2p-answers.js), and a live payment is taken only for a merchant a reviewed pin
2152
+ // names. Ships dark: served only to a client that declares `twoc2p_secure_pay`, gated off for every org
2153
+ // until an operator lists one (`twoc2p:<org>`), and autopilot never sends this request (autopilot.js
2154
+ // DEVICE_REPLAY_REFUSED_OPERATIONS). The environment is pinned (S7): sandbox-pgwv4 only on test rows and
2155
+ // only with documented test cards. `(?![\w/.-])` ends the path for a consumer that tests `match` unanchored.
2156
+ capability: "twoc2p_secure_pay",
2157
+ match: "(?:sandbox-)?pgwv4\\.2c2p\\.com/payment/4\\.[0-9]{1,2}/Payment(?![\\w/.-])",
2158
+ hosts: ["^pgwv4\\.2c2p\\.com$", "^sandbox-pgwv4\\.2c2p\\.com$"],
2159
+ sandboxHosts: ["^sandbox-pgwv4\\.2c2p\\.com$"],
2160
+ hostEnvironmentPinned: true,
2161
+ encoding: "json",
2162
+ // The page continues its own request with its own headers; none is stored.
2163
+ passthroughHeaders: [],
2164
+ jsonCardFields: [["payment", "data", "securePayToken"]],
2165
+ passWithoutCard: "(?:sandbox-)?pgwv4\\.2c2p\\.com/payment/4\\.[0-9]{1,2}/Payment",
2166
+ clientSideEncrypted: true,
2167
+ mode: "cse",
2168
+ cse: { scheme: "twoc2p-secure-pay", at: "payment.data", fields: ["securePayToken"] },
2169
+ // The device's one field carries the whole card (number, expiry and code), so the client table names it once.
2170
+ encryptedCardFields: { card: "securePayToken" }
2171
+ },
2172
+ {
2173
+ psp: "hipay",
2174
+ // HiPay Enterprise (France, Portugal, Italy, Spain): HiPay's JavaScript SDK (libs.hipay.com/js/sdkjs.js)
2175
+ // takes the card in hosted fields, and their hidden controller frame on libs.hipay.com (or a direct post
2176
+ // from the merchant's own origin) posts it as one JSON body to HiPay's Secure Vault under the merchant's
2177
+ // public Basic credential: card_number, card_expiry_month (MM), card_expiry_year (YYYY), cvc, card_holder
2178
+ // when the page has the field, and multi_use. hipay.js holds the request rule the pause decision, the API's
2179
+ // create, the prepared bind and the device all read: exactly a token URL, a JSON Content-Type, a public
2180
+ // username of the vault's own environment, and a complete create byte for byte. The hosted fields also post
2181
+ // the number alone while it is typed; that body is refused (hipay_number_only) and the SDK fails it in the
2182
+ // browser, so the frame keeps the number and Pay sends one complete create. The merchant's page gives the
2183
+ // frame 20 seconds after Pay, so the lane is prepared only (preparationRequired). HiPay's vault answers any
2184
+ // browser origin, so the card leaves the cardholder's device by a direct fetch. The body names no amount and
2185
+ // no merchant: a live request is taken only for a checkout origin and a public username one reviewed pin
2186
+ // names together. stage-secure2-vault.hipay-tpp.com is HiPay's stage vault: pinned (S7) to test rows, which
2187
+ // send only test cards. Ships dark: served only to a client that declares `hipay_vault_token`, gated off
2188
+ // for every org until an operator lists one (`hipay:<org>`), and autopilot never sends this request
2189
+ // (autopilot.js DEVICE_REPLAY_REFUSED_OPERATIONS). `(?![\w/.-])` ends the path for a consumer that tests
2190
+ // `match` unanchored, so /rest/v2/token/update is never this entry.
2191
+ capability: "hipay_vault_token",
2192
+ match: "(?:stage-)?secure2-vault\\.hipay-tpp\\.com/rest/v2/token(?![\\w/.-])",
2193
+ hosts: ["^secure2-vault\\.hipay-tpp\\.com$", "^stage-secure2-vault\\.hipay-tpp\\.com$"],
2194
+ sandboxHosts: ["^stage-secure2-vault\\.hipay-tpp\\.com$"],
2195
+ hostEnvironmentPinned: true,
2196
+ preparationRequired: true,
2197
+ encoding: "json",
2198
+ // The merchant's public credential and the frame's JSON Accept. Origin, Referer and cookies never ride.
2199
+ passthroughHeaders: ["^authorization$", "^accept$"]
2200
+ },
2201
+ {
2202
+ psp: "amazon_payment_services",
2203
+ // Amazon Payment Services (formerly PayFort; the UAE, Saudi Arabia, Egypt), its custom merchant page: the
2204
+ // merchant's own card form posts top-level, as a document navigation, to /FortAPI/paymentPage on
2205
+ // checkout.payfort.com, form encoded, with service_command=TOKENIZATION and the merchant's signed fields
2206
+ // beside card_number, expiry_date (YYMM) and card_security_code. amazon-payment-services.js holds the rule
2207
+ // the pause decision reads: exactly that URL, and the form field by field, with another service command, a
2208
+ // saved card (token_name) and a recurring agreement (merchant_extra) refused by name. The same URL takes
2209
+ // APS's redirection and iframe entries, which carry no card and continue untouched (passWithoutCard); APS's
2210
+ // own page then takes the card, and no Vault mode pays it. The request names no amount: the merchant
2211
+ // charges the token APS answers with later, from its own server, so the agent's amount is the figure the
2212
+ // cardholder approves. APS answers no browser origin, so the card leaves the cardholder's device only
2213
+ // through the checkout relay, with the page's own Origin and Referer. sbcheckout.payfort.com is APS's
2214
+ // sandbox: pinned (S7) to test rows, which send only test cards.
2215
+ // Ships dark: served only to a client that declares `aps_custom_merchant_page`, gated off for every org
2216
+ // until an operator lists one (`amazon_payment_services:<org>`), and autopilot never sends this request
2217
+ // (autopilot.js DEVICE_REPLAY_REFUSED_OPERATIONS). `(?![\w/.%-])` ends the path for a consumer that tests
2218
+ // `match` unanchored.
2219
+ capability: "aps_custom_merchant_page",
2220
+ match: "(?:sb)?checkout\\.payfort\\.com/FortAPI/paymentPage(?![\\w/.%-])",
2221
+ hosts: ["^checkout\\.payfort\\.com$", "^sbcheckout\\.payfort\\.com$"],
2222
+ sandboxHosts: ["^sbcheckout\\.payfort\\.com$"],
2223
+ hostEnvironmentPinned: true,
2224
+ encoding: "form",
2225
+ // The form's own Origin and Referer: a browser sends both on the page's POST, and the request rule holds
2226
+ // them to the checkout page. Cookies and every other header never ride.
2227
+ passthroughHeaders: ["^origin$", "^referer$"],
2228
+ cardFields: ["card_number"],
2229
+ passWithoutCard: "(?:sb)?checkout\\.payfort\\.com/FortAPI/paymentPage"
1973
2230
  }
1974
2231
  ]);
1975
2232
  var PSP_RECOGNIZERS = deepFreeze(PROCESSOR_DEFINITIONS.map(({ compose, encryptedCardFields, deviceSteps, deviceEncrypt, ...definition }) => definition));
@@ -2150,6 +2407,10 @@ var WIX_PAYMENTS_MERCHANT_PINS = /* @__PURE__ */ Object.freeze([
2150
2407
  // src/paymongo.js
2151
2408
  var PAYMONGO_CHECKOUT_HOST = "checkout.paymongo.com";
2152
2409
  var ORIGIN = `https://${PAYMONGO_CHECKOUT_HOST}/`;
2410
+ // src/payrexx.js
2411
+ var PAYREXX_FOLLOW_UP_WINDOW_MS = 15 * 60 * 1e3;
2412
+ var PAYREXX_FOLLOW_UP_IDLE_MS = 60 * 1e3;
2413
+ var PAYREXX_FOLLOW_UP_CHALLENGE_MS = 11 * 60 * 1e3;
2153
2414
  // src/paygent.js
2154
2415
  var PAYGENT_PSP = "paygent";
2155
2416
  var PAYGENT_TOKEN_HOSTS = /* @__PURE__ */ Object.freeze({
@@ -2172,6 +2433,22 @@ var PAY_NL_MERCHANT_PINS = /* @__PURE__ */ Object.freeze([
2172
2433
  ]);
2173
2434
  var ERROR_KEYS = /* @__PURE__ */ Object.freeze(["errorId", "errorTag", "errorMessage", "errorFieldName"]);
2174
2435
  var REQUEST_KEYS = /* @__PURE__ */ Object.freeze(["result", ...ERROR_KEYS]);
2436
+ // src/twoc2p-keys.js
2437
+ var TWOC2P_KEYS = /* @__PURE__ */ Object.freeze({
2438
+ production: Object.freeze({
2439
+ spki: "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC/1ljsxI+r6qQraTFrHfWNrV41vxumBF+4ILAG3WsN6HEBQU2wSUv/IyQmZkiys1ilOb+OOuQTH8OXMnqQg9E4epyePW3L7IeOieSbIIDeSX6UpTWmT/Fs7moWZkN8RpuCV0u87n3AY2tQbtcSqwEKi2sxzWLFwscoGn6N5yVIpQIDAQAB",
2440
+ sha256: "bb8f27929ce140c6ef0ec9c4a20d7ca0b83376bc35a501985dc40d16669384fe",
2441
+ script: Object.freeze({ url: "https://t.2c2p.com/SecurePayment/api/my2c2p.1.7.6.min.js", sha256: "4a745a37765a2e28e299d64f6ea5811aab27b176da61db6f840fa85d6a47e763" })
2442
+ }),
2443
+ sandbox: Object.freeze({
2444
+ spki: "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDKakJC+2MSZikKoPzlNqXvJCuWNLhejg3gMRePSetYNNgnhyqFwwAR7t7i/B2QFZoixSYc2/23cJz0jA5O+q+Cu3fycqKlf1L9966+X3B9nyHe2eKQZr8KrcS/8+sEKcd0pLATY4AleW1iktuN+2oghrDKuv+aDNztWcOy+PTofwIDAQAB",
2445
+ sha256: "7f80c07f1d72db28ede10dae942940657c72dfa789836c9fdf283cba6feff2e6",
2446
+ script: Object.freeze({ url: "https://demo2.2c2p.com/2C2PFrontEnd/SecurePayment/api/my2c2p.1.7.6.min.js", sha256: "435723d92bfefb00607a56851967e0b745d52b8d49443de5f0000f0583fde5cc" })
2447
+ })
2448
+ });
2449
+ // src/amazon-payment-services.js
2450
+ var BODY_LIMIT = 32 * 1024;
2451
+ var ANSWER_LIMIT = 64 * 1024;
2175
2452
  // src/cybersource-secure-acceptance.js
2176
2453
  var SA_BODY_LIMIT = 32 * 1024;
2177
2454
  var SA_REPLY_LIMIT = 64 * 1024;
@@ -2398,7 +2675,15 @@ var METHOD_PAGE = /* @__PURE__ */ new Set(["resultadoMethod", ...BROWSER_FIELDS,
2398
2675
  var REDSYS_REFUSALS = Object.freeze(["redsys_card_page", "redsys_3ds_challenge", "redsys_declined"]);
2399
2676
  // src/processors/quickpay.js
2400
2677
  var QUICKPAY_HOSTS = Object.freeze(["payment.quickpay.net"]);
2401
- var QUICKPAY_MERCHANTS = Object.freeze([]);
2678
+ var QUICKPAY_MERCHANTS = Object.freeze([
2679
+ Object.freeze({
2680
+ merchantId: "107268",
2681
+ agreementId: null,
2682
+ merchant: "Skandinavisk Dyrepark",
2683
+ host: "shop.skandinaviskdyrepark.dk",
2684
+ callbackHost: "shop.skandinaviskdyrepark.dk"
2685
+ })
2686
+ ]);
2402
2687
  var MAX_ENTRY3 = 16 * 1024;
2403
2688
  var REQUIRED3 = Object.freeze([
2404
2689
  "version",
@@ -2447,6 +2732,18 @@ var AUTH_FIELDS = Object.freeze([
2447
2732
  "[auth]threeDSCompInd"
2448
2733
  ]);
2449
2734
  var QUICKPAY_REFUSALS = Object.freeze(["quickpay_card_page", "quickpay_3ds_challenge", "quickpay_cancelled"]);
2735
+ // src/processors/comgate.js
2736
+ var COMGATE_GATEWAY_HOSTS = Object.freeze({
2737
+ "pay1.comgate.cz": "payments.comgate.cz",
2738
+ "pay2.comgate.cz": "payments.comgate.cz",
2739
+ "pay3.comgate.cz": "payments-gcp.comgate.cz",
2740
+ "pay4.comgate.cz": "payments-gcp.comgate.cz"
2741
+ });
2742
+ var COMGATE_MERCHANTS = Object.freeze([]);
2743
+ var MAX_LOAD = 1024 * 1024;
2744
+ var MAX_ANSWER = 64 * 1024;
2745
+ var HEADER_NAMES = Object.freeze(["content-type", "x-cg-origin", "origin"]);
2746
+ var COMGATE_REFUSALS = Object.freeze(["comgate_3ds_challenge", "comgate_declined"]);
2450
2747
  // src/processors/przelewy24.js
2451
2748
  var PRZELEWY24_HOSTS = Object.freeze(["secure.przelewy24.pl", "sandbox.przelewy24.pl"]);
2452
2749
  var PRZELEWY24_SANDBOX_HOSTS = Object.freeze(["sandbox.przelewy24.pl"]);
@@ -2478,6 +2775,27 @@ var MAX_PAGE5 = 64 * 1024;
2478
2775
  var JSON_HEADERS = Object.freeze({ "content-type": "application/json", accept: "application/json, text/plain, */*" });
2479
2776
  var FORM_HEADERS = Object.freeze({ "content-type": "application/x-www-form-urlencoded", accept: "application/json, text/plain, */*" });
2480
2777
  var TRANSBANK_REFUSALS = Object.freeze(["transbank_3ds_challenge", "transbank_aborted", "transbank_error"]);
2778
+ // src/processors/paytrail.js
2779
+ var PAYTRAIL_HOSTS = Object.freeze(["services.paytrail.com"]);
2780
+ var PAYTRAIL_ENTRY_FIELDS = Object.freeze([
2781
+ "checkout-transaction-id",
2782
+ "checkout-account",
2783
+ "checkout-method",
2784
+ "checkout-algorithm",
2785
+ "checkout-timestamp",
2786
+ "checkout-nonce",
2787
+ "signature"
2788
+ ]);
2789
+ var PAYTRAIL_MERCHANTS = Object.freeze([]);
2790
+ var UUID_SOURCE = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
2791
+ var UUID = new RegExp(`^${UUID_SOURCE}$`);
2792
+ var ENTRY_PATH = new RegExp(`^/payments/(${UUID_SOURCE})/click-to-pay/loading-and-redirect$`);
2793
+ var SIGNATURES = Object.freeze({ sha256: /^[0-9a-f]{64}$/, sha512: /^[0-9a-f]{128}$/ });
2794
+ var PAYMENT_HIGHWAY_HOSTS = Object.freeze(["v1.api.paymenthighway.io"]);
2795
+ var CARD_PAGE_PATH = new RegExp(`^/form/(${UUID_SOURCE})/pay_with_click_to_pay$`);
2796
+ var MAX_PAGE6 = 256 * 1024;
2797
+ var PAYTRAIL_CARD_HEADERS = Object.freeze({ "Content-Type": "application/json", "X-Requested-With": "PH-Form", Accept: "application/json" });
2798
+ var PAYTRAIL_REFUSALS = Object.freeze(["paytrail_3ds_challenge", "paytrail_card_refused"]);
2481
2799
  // src/recognition.js
2482
2800
  var PATTERN_WITHOUT_CARD_FIELDS = Object.freeze({
2483
2801
  stripe: "api\\.stripe\\.com/v1/(payment_methods|tokens|setup_intents/seti_\\w+/confirm|payment_intents/pi_\\w+/confirm)"
@@ -0,0 +1,54 @@
1
+ /** The PSP id the API and the recognizer name this lane, re-exported so the client dispatches by it. */
2
+ export { TWOC2P_PSP } from './twoc2p.generated.js';
3
+ /** The dark-launch capability a build declares when it fills a 2C2P Payment with the device's card field. */
4
+ export declare const TWOC2P_CAPABILITY = "twoc2p_secure_pay";
5
+ /** A cse substitution as the API serves it (substitute.ts Substitutions): here the one card field. */
6
+ interface TwoC2pServedSubstitution {
7
+ encoding: string;
8
+ at: string;
9
+ fields: Record<string, string>;
10
+ remove?: string[];
11
+ }
12
+ /**
13
+ * Whether an approved 2C2P authorization's served substitution is one this SDK can continue: JSON at payment.data,
14
+ * no sibling to remove, and exactly the one card field, a non-empty string. substituteTwoC2p checks the field
15
+ * against the pinned key for the Payment's environment; this is the shape gate the continuation runs first.
16
+ */
17
+ export declare function isTwoC2pServedSubstitution(sub: unknown): sub is TwoC2pServedSubstitution;
18
+ /** The part of the client a refused continuation retires its approval through. */
19
+ interface TwoC2pRetiringClient {
20
+ cancelAuthorization?: (authorizationId: string, reason: 'merchant_never_retried') => Promise<unknown>;
21
+ }
22
+ /**
23
+ * The retirement a refused 2C2P continuation runs (twoC2pContinuation's `retire`), or undefined for a client that
24
+ * cannot cancel: the approval is cancelled as merchant_never_retried, since its field went to no request, and the
25
+ * API stops serving the field. The paused request fails at once, so the cancel is not awaited; when the API does not
26
+ * confirm it, `onEvent` hears approval_retire_unconfirmed with the authorization's id. The API's sweep drops the field
27
+ * once its readable window passes either way.
28
+ */
29
+ export declare function twoC2pRetire(client: TwoC2pRetiringClient | undefined, authorizationId: string, onEvent?: (event: {
30
+ type: string;
31
+ detail?: unknown;
32
+ }) => void): (() => void) | undefined;
33
+ /** The paused request an approval was created from: the URL and body the API reviewed at create. */
34
+ export interface TwoC2pApprovedRequest {
35
+ url: string;
36
+ body: string;
37
+ }
38
+ /**
39
+ * The continuation of an approved 2C2P Payment: the paused body with the device's card field written over the
40
+ * placeholder's (payment-core substituteTwoC2p, which refuses a field that is not one under the pinned key for the
41
+ * Payment's environment, or one already in the paused body).
42
+ *
43
+ * Only into `approved`, the paused Payment the approval was created from: `url` and `body` must equal it byte for
44
+ * byte. 2C2P's key is the same for every merchant, so the field would pay any later Payment of the same shape;
45
+ * binding it to the one request keeps this lane from ever writing one payment's field into another.
46
+ *
47
+ * Null when neither URL is a 2C2P Payment, so every other processor keeps its own swap. Throws for any other body or
48
+ * URL, and for a substitution the shape gate or the swap refuses, in each case before anything continues. A refusal
49
+ * means the device's field went to no request, so `retire` runs first: the caller retires the approval as
50
+ * merchant_never_retried, and the API stops serving the field (cdp.ts cseContinuation).
51
+ */
52
+ export declare function twoC2pContinuation(url: string, body: string, sub: unknown, approved: TwoC2pApprovedRequest, retire?: () => void): {
53
+ body: string;
54
+ } | null;
@@ -0,0 +1,33 @@
1
+ declare var TWOC2P_PSP: string;
2
+ declare var TWOC2P_CAPABILITY: string;
3
+ declare var TWOC2P_OPERATION: string;
4
+ declare var TWOC2P_SCHEME: string;
5
+ declare var TWOC2P_FIELD_AT: string;
6
+ declare var TWOC2P_FIELD: string;
7
+ declare var TWOC2P_REVIEWED_BUILDS: readonly string[];
8
+ declare var TWOC2P_REFUSAL_CODES: readonly string[];
9
+ declare function twoC2pPaymentTarget(url: any): Readonly<{
10
+ environment: "production" | "sandbox";
11
+ version: string;
12
+ reviewed: boolean;
13
+ }> | null;
14
+ declare function twoC2pPaymentCarriesCard(body: any): boolean;
15
+ declare function twoC2pBodyVerdict(body: any, keyBytes?: number, environment?: undefined): Readonly<{
16
+ verdict: "continue";
17
+ }> | Readonly<{
18
+ verdict: "refuse";
19
+ code: any;
20
+ }> | Readonly<{
21
+ verdict: "card";
22
+ }>;
23
+ declare function twoC2pRequestRefusal(request: any, environment: any): any;
24
+ declare function twoC2pRefusalMessage(code: any): any;
25
+ declare function encryptTwoC2pCard(card: any, environment: any, facilities?: {}): Promise<string>;
26
+ declare function twoC2pSubstitutionOf(value: any, environment: any): any;
27
+ declare function substituteTwoC2p(url: any, body: any, field: any): string;
28
+ declare function twoC2pSubstitutionsRefusal(template: any, substitution: any): {
29
+ code: string;
30
+ message: any;
31
+ } | null;
32
+ declare function twoC2pKeyUsable(authorization: any): boolean;
33
+ export { TWOC2P_CAPABILITY, TWOC2P_FIELD, TWOC2P_FIELD_AT, TWOC2P_OPERATION, TWOC2P_PSP, TWOC2P_REFUSAL_CODES, TWOC2P_REVIEWED_BUILDS, TWOC2P_SCHEME, encryptTwoC2pCard, substituteTwoC2p, twoC2pBodyVerdict, twoC2pKeyUsable, twoC2pPaymentCarriesCard, twoC2pPaymentTarget, twoC2pRefusalMessage, twoC2pRequestRefusal, twoC2pSubstitutionOf, twoC2pSubstitutionsRefusal };