@agent-cards/sdk 0.23.18 → 0.23.19

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.
@@ -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: 75a1d6551b8b0f5af53c9ce72e709e523f6911e0f96a1705fca0855b180d8532
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,71 @@ 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" }
1973
2136
  }
1974
2137
  ]);
1975
2138
  var PSP_RECOGNIZERS = deepFreeze(PROCESSOR_DEFINITIONS.map(({ compose, encryptedCardFields, deviceSteps, deviceEncrypt, ...definition }) => definition));
@@ -2447,6 +2610,18 @@ var AUTH_FIELDS = Object.freeze([
2447
2610
  "[auth]threeDSCompInd"
2448
2611
  ]);
2449
2612
  var QUICKPAY_REFUSALS = Object.freeze(["quickpay_card_page", "quickpay_3ds_challenge", "quickpay_cancelled"]);
2613
+ // src/processors/comgate.js
2614
+ var COMGATE_GATEWAY_HOSTS = Object.freeze({
2615
+ "pay1.comgate.cz": "payments.comgate.cz",
2616
+ "pay2.comgate.cz": "payments.comgate.cz",
2617
+ "pay3.comgate.cz": "payments-gcp.comgate.cz",
2618
+ "pay4.comgate.cz": "payments-gcp.comgate.cz"
2619
+ });
2620
+ var COMGATE_MERCHANTS = Object.freeze([]);
2621
+ var MAX_LOAD = 1024 * 1024;
2622
+ var MAX_ANSWER = 64 * 1024;
2623
+ var HEADER_NAMES = Object.freeze(["content-type", "x-cg-origin", "origin"]);
2624
+ var COMGATE_REFUSALS = Object.freeze(["comgate_3ds_challenge", "comgate_declined"]);
2450
2625
  // src/processors/przelewy24.js
2451
2626
  var PRZELEWY24_HOSTS = Object.freeze(["secure.przelewy24.pl", "sandbox.przelewy24.pl"]);
2452
2627
  var PRZELEWY24_SANDBOX_HOSTS = Object.freeze(["sandbox.przelewy24.pl"]);
@@ -2478,6 +2653,27 @@ var MAX_PAGE5 = 64 * 1024;
2478
2653
  var JSON_HEADERS = Object.freeze({ "content-type": "application/json", accept: "application/json, text/plain, */*" });
2479
2654
  var FORM_HEADERS = Object.freeze({ "content-type": "application/x-www-form-urlencoded", accept: "application/json, text/plain, */*" });
2480
2655
  var TRANSBANK_REFUSALS = Object.freeze(["transbank_3ds_challenge", "transbank_aborted", "transbank_error"]);
2656
+ // src/processors/paytrail.js
2657
+ var PAYTRAIL_HOSTS = Object.freeze(["services.paytrail.com"]);
2658
+ var PAYTRAIL_ENTRY_FIELDS = Object.freeze([
2659
+ "checkout-transaction-id",
2660
+ "checkout-account",
2661
+ "checkout-method",
2662
+ "checkout-algorithm",
2663
+ "checkout-timestamp",
2664
+ "checkout-nonce",
2665
+ "signature"
2666
+ ]);
2667
+ var PAYTRAIL_MERCHANTS = Object.freeze([]);
2668
+ var UUID_SOURCE = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
2669
+ var UUID = new RegExp(`^${UUID_SOURCE}$`);
2670
+ var ENTRY_PATH = new RegExp(`^/payments/(${UUID_SOURCE})/click-to-pay/loading-and-redirect$`);
2671
+ var SIGNATURES = Object.freeze({ sha256: /^[0-9a-f]{64}$/, sha512: /^[0-9a-f]{128}$/ });
2672
+ var PAYMENT_HIGHWAY_HOSTS = Object.freeze(["v1.api.paymenthighway.io"]);
2673
+ var CARD_PAGE_PATH = new RegExp(`^/form/(${UUID_SOURCE})/pay_with_click_to_pay$`);
2674
+ var MAX_PAGE6 = 256 * 1024;
2675
+ var PAYTRAIL_CARD_HEADERS = Object.freeze({ "Content-Type": "application/json", "X-Requested-With": "PH-Form", Accept: "application/json" });
2676
+ var PAYTRAIL_REFUSALS = Object.freeze(["paytrail_3ds_challenge", "paytrail_card_refused"]);
2481
2677
  // src/recognition.js
2482
2678
  var PATTERN_WITHOUT_CARD_FIELDS = Object.freeze({
2483
2679
  stripe: "api\\.stripe\\.com/v1/(payment_methods|tokens|setup_intents/seti_\\w+/confirm|payment_intents/pi_\\w+/confirm)"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-cards/sdk",
3
- "version": "0.23.18",
3
+ "version": "0.23.19",
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",