@agent-cards/sdk 0.23.19 → 0.23.21

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 (66) hide show
  1. package/CHANGELOG.md +61 -2
  2. package/PREFLIGHT.md +4 -0
  3. package/README.md +175 -7
  4. package/dist/amadeus.d.ts +4 -2
  5. package/dist/amadeus.js +16 -3
  6. package/dist/buy.d.ts +84 -2
  7. package/dist/buy.js +16 -1
  8. package/dist/card-endpoint-facts.d.ts +2 -1
  9. package/dist/card-endpoint-facts.js +18 -9
  10. package/dist/card-endpoint.d.ts +20 -4
  11. package/dist/card-endpoint.js +38 -4
  12. package/dist/card-fields.generated.js +1444 -51
  13. package/dist/cdp.d.ts +29 -0
  14. package/dist/cdp.js +444 -24
  15. package/dist/client.d.ts +134 -7
  16. package/dist/client.js +350 -25
  17. package/dist/comgate.d.ts +50 -0
  18. package/dist/comgate.js +80 -0
  19. package/dist/cybersource-secure-acceptance.generated.d.ts +1 -1
  20. package/dist/eprotect.generated.d.ts +1 -1
  21. package/dist/gmo.generated.js +7 -3
  22. package/dist/hipay.generated.d.ts +56 -0
  23. package/dist/hipay.generated.js +392 -0
  24. package/dist/hold.d.ts +180 -0
  25. package/dist/hold.js +270 -0
  26. package/dist/hosted-entry.d.ts +4 -0
  27. package/dist/hosted-entry.js +32 -0
  28. package/dist/index.d.ts +4 -1
  29. package/dist/index.js +1 -0
  30. package/dist/lifecycle.d.ts +10 -0
  31. package/dist/lifecycle.js +21 -0
  32. package/dist/merchant-card-endpoints.generated.js +102 -11
  33. package/dist/paddle-tokenex.generated.js +7 -3
  34. package/dist/paddle-vgs.generated.d.ts +3 -2
  35. package/dist/paddle-vgs.generated.js +9 -5
  36. package/dist/payrails.generated.js +7 -3
  37. package/dist/pre-claim.d.ts +20 -0
  38. package/dist/pre-claim.js +202 -22
  39. package/dist/preflight-catalog.json +58 -0
  40. package/dist/preflight-schemas.json +4 -0
  41. package/dist/preflight.generated.js +26 -2
  42. package/dist/prepared-processor.d.ts +6 -2
  43. package/dist/prepared-processor.js +18 -2
  44. package/dist/primer.generated.js +1487 -94
  45. package/dist/przelewy24.d.ts +47 -0
  46. package/dist/przelewy24.js +88 -0
  47. package/dist/quickpay.d.ts +44 -0
  48. package/dist/quickpay.js +65 -0
  49. package/dist/registry.d.ts +6 -5
  50. package/dist/registry.js +27 -7
  51. package/dist/shiji-sts.generated.js +7 -3
  52. package/dist/stripe-checkout.generated.js +744 -13
  53. package/dist/tokenex-iframe.d.ts +93 -0
  54. package/dist/tokenex-iframe.generated.d.ts +81 -0
  55. package/dist/tokenex-iframe.generated.js +403 -0
  56. package/dist/tokenex-iframe.js +195 -0
  57. package/dist/transbank.d.ts +45 -0
  58. package/dist/transbank.js +73 -0
  59. package/dist/twoc2p.d.ts +54 -0
  60. package/dist/twoc2p.generated.d.ts +33 -0
  61. package/dist/twoc2p.generated.js +1149 -0
  62. package/dist/twoc2p.js +85 -0
  63. package/dist/voice.d.ts +16 -13
  64. package/dist/voice.js +13 -10
  65. package/examples/preflight/kernel-native/inventory.json +1 -1
  66. package/package.json +3 -3
@@ -1,6 +1,6 @@
1
1
  // @ts-nocheck
2
2
  // Generated from @agent-cards/payment-core. Do not edit.
3
- // artifact-sha256: 527edb8fd48229e7404d5fda8d1f8e243b5694c350eee105bec8815a0e848df0
3
+ // artifact-sha256: 7b5770020fc598b9f1fdfc842ef761812943269a1bd368d4751f99c1ffad7a17
4
4
  // src/json-path.js
5
5
  var FORBIDDEN_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
6
6
  function isPlainObject(v) {
@@ -644,7 +644,6 @@ var NAVIGATION_HEADERS = /* @__PURE__ */ Object.freeze([
644
644
  "sec-fetch-site",
645
645
  "sec-fetch-user"
646
646
  ]);
647
- var GUARANTEE_RATES = "a policy for guarantee rates: the hotel charges the card at the stay, by when a single-use card may have closed";
648
647
  var ATT_SESSION = /* @__PURE__ */ deepFreeze({
649
648
  cookies: true,
650
649
  cookie_names: null,
@@ -2108,7 +2107,9 @@ var MERCHANT_CARD_ENDPOINT_PROFILES = /* @__PURE__ */ deepFreeze([
2108
2107
  "secure-hotel-booking.com sits behind DataDome. The same card frame serves every D-EDGE hotel, so the profile names D-EDGE rather than one hotel; its currency is HUMA's.",
2109
2108
  "HUMA's own payment step, read live Oct 6, 2026 (live-checks-oct6/huma_kotor_bay): the frame's cleanCardNumber rewrites CardNumber on every keypress and on blur into groups of four with one space between them for a Visa or Mastercard number (4242 4242 4242 4242; 4-6-5 for an Amex, 4-6-4 for a Diners), so the post carries the spaces.",
2110
2109
  "cleanCardNumber strips every non-digit and writes the number in the format of the first CARD_TYPES row whose pattern it matches (the frame's inline script, the same in the archive.org copies and live on Oct 6): amex /^3[47]/ format_465, the first 15 digits as 4-6-5; diners_club_international /^36/ and diners_club_carte_blanche /^30[0-5]/ format_464, the first 14 digits as 4-6-4; every other row (visa, master, jcb, maestro, discover, instapayment, diners_club /^54/), and a number no row matches, format_4444, groups of four with the rest last. card.pan is grouped_by_type: the rules take the number grouped that way or as plain digits, and write the real number the way the placeholder was written, a grouped one in its own network's grouping, so a real American Express card behind a placeholder grouped in fours still goes out 4-6-5. Behind a grouped placeholder, a real 34 or 37 number of any length but 15, or a 36 or 300 to 305 number of any length but 14, is refused: the frame has no grouping for it and cuts a longer one short.",
2111
- "The same check read when HUMA charges: its Non Refundable rate charges the whole stay at this post (the hub shows Due to pay now and its button reads PAY), while its flexible rate only guarantees the booking with the card, which the hotel charges on a late cancellation or a no-show."
2110
+ "The same check read when HUMA charges: its Non Refundable rate charges the whole stay at this post (the hub shows Due to pay now and its button reads PAY), while its flexible rate only guarantees the booking with the card, which the hotel charges on a late cancellation or a no-show.",
2111
+ "The hub loads the booking it takes a payment for with POST /load/<session uuid> on pay.secure-hotel-booking.com and spreads the answer into its state (main.bundle.js v=1.0.3573, sha256 eb06043d...51897c9, the payment reducer; read live Oct 6, 2026 as a POST answered 200). It also sends 3-D Secure browser data to /setDevice/<session uuid>, which changes nothing the record holds, and calls /Voucher/add, /Voucher/remove, /Loyalty/set, /Loyalty/remove and /Issuer/set/<session uuid> only when the guest applies a voucher, points or a bank, each answer replacing the record. Every hub URL ends in the session uuid the card post's path carries.",
2112
+ "The /load answer (archive.org copies from other D-EDGE hotels, Dec 2025 to Sep 2026): deposit (due now), total and balance (the room and the part left for the stay, both without the stay tax the basket lines add), hasOriginalDeposit (false at a rate that only guarantees the booking), hasScheduledPayment, isFullDiscount, vouchers and status (New while unpaid), amounts written in the booking's language ('€ 1,609.36', '116,10 €'). facts reads it with the dedge_pay_hub reader, so the agent's amount is held to the deposit, and a guarantee, a scheduled charge or part of the room left for the stay is refused (Felipe's rule of Oct 7, 2026: a hotel is paid only at a rate charged in full at booking)."
2112
2113
  ],
2113
2114
  har: null,
2114
2115
  checkout: "https://card.secure-hotel-booking.com",
@@ -2146,7 +2147,15 @@ var MERCHANT_CARD_ENDPOINT_PROFILES = /* @__PURE__ */ deepFreeze([
2146
2147
  response: { headers: ["content-type", "location", "set-cookie"], withhold: [] },
2147
2148
  resends: [],
2148
2149
  challenge: null,
2149
- facts: null,
2150
+ // The booking the hub takes the payment for lives on the hub's own host, not the card frame's.
2151
+ facts: {
2152
+ reader: "dedge_pay_hub",
2153
+ origin: "https://pay.secure-hotel-booking.com",
2154
+ responses: [{ method: "POST", path: "/load/:session", query: {}, format: "json" }],
2155
+ // 3-D Secure browser data, sent beside /load when the hub loads: the record does not change.
2156
+ inert: [{ method: "POST", path: "/setDevice/:session", query: {} }],
2157
+ bind: "session"
2158
+ },
2150
2159
  bootstrap: "/robots.txt",
2151
2160
  timeout_ms: 6e4,
2152
2161
  charge_timing: "at_request",
@@ -2155,7 +2164,7 @@ var MERCHANT_CARD_ENDPOINT_PROFILES = /* @__PURE__ */ deepFreeze([
2155
2164
  "HUMA's own payment step: whether its pay hub offers this card frame or a WSPay redirect (a HAR of one real booking's payment step)",
2156
2165
  "which cookies the card post needs, with DataDome in front of the host",
2157
2166
  "the answer to the card post (a redirect, a 3DS step or a page), and whether a 3DS step sends the card again",
2158
- GUARANTEE_RATES,
2167
+ "HUMA's /load answer for its prepaid rate, as a recorded purchase shows it: the deposit, total and balance strings, a zero balance beside the stay tax, and the status of an unpaid booking that facts reads",
2159
2168
  "that the bootstrap path answers without a server error"
2160
2169
  ]
2161
2170
  },
@@ -2321,6 +2330,8 @@ var MERCHANT_CARD_ENDPOINT_PROFILES = /* @__PURE__ */ deepFreeze([
2321
2330
  challenge: { at: ["captcha", "token"], ttl_ms: 24e4 },
2322
2331
  facts: {
2323
2332
  reader: "fastspring_session",
2333
+ // The record's answers come from the popup's own store host, the endpoint.
2334
+ origin: null,
2324
2335
  // Every answer FastSpring's page reads its order from (refreshPageResponse and
2325
2336
  // refreshOrderResponse): the popup document, the one-segment calls (/tax, /coupons,
2326
2337
  // /locale, /exempt), an item's quantity, renewal or add-on change, and a verified discount.
@@ -3019,10 +3030,73 @@ function fastspringFacts(state, merchant) {
3019
3030
  return fail(unreadable);
3020
3031
  }
3021
3032
  const recurring = projection.hasRecurring || projection.forceFuture || anySelectedRenewal(groups);
3022
- return { ok: true, facts: { amount: { amountCents, currency: currency.toLowerCase() }, live: projection.production, recurring } };
3033
+ return { ok: true, facts: { amount: { amountCents, currency: currency.toLowerCase() }, live: projection.production, recurring, deferred: null } };
3034
+ }
3035
+ var DEDGE_MAX_VOUCHERS = 8;
3036
+ var EURO_FIRST = /^\u20ac (\d{1,3}(?:,\d{3}){0,2})(?:\.(\d{2}))?$/;
3037
+ var EURO_LAST = /^(\d{1,3}(?:[ .\u00a0\u202f]\d{3}){0,2})(?:,(\d{2}))? \u20ac$/;
3038
+ function hubAmount(text) {
3039
+ if (typeof text !== "string")
3040
+ return null;
3041
+ const match = EURO_FIRST.exec(text) ?? EURO_LAST.exec(text);
3042
+ if (!match)
3043
+ return /\d/.test(text) && !/\u20ac|EUR/i.test(text) ? { other: true } : null;
3044
+ if (new Set(match[1].replace(/\d/g, "")).size > 1)
3045
+ return null;
3046
+ return { cents: Number(match[1].replace(/\D/g, "")) * 100 + Number(match[2] ?? "0") };
3047
+ }
3048
+ function dedgeState(format, text) {
3049
+ const state = format === "json" ? parseJson(text) : void 0;
3050
+ return isPlainObject(state) ? { state } : { refusal: "the payment page's booking record is not a JSON object" };
3051
+ }
3052
+ function dedgeProjection(state) {
3053
+ if (!isPlainObject(state))
3054
+ return null;
3055
+ const vouchers = state.vouchers === void 0 ? [] : state.vouchers;
3056
+ if (!Array.isArray(vouchers) || vouchers.length > DEDGE_MAX_VOUCHERS)
3057
+ return null;
3058
+ const scalar = (value) => value !== null && typeof value === "object" ? null : value;
3059
+ return {
3060
+ status: scalar(state.status),
3061
+ deposit: scalar(state.deposit),
3062
+ total: scalar(state.total),
3063
+ balance: scalar(state.balance),
3064
+ hasOriginalDeposit: scalar(state.hasOriginalDeposit),
3065
+ hasScheduledPayment: scalar(state.hasScheduledPayment),
3066
+ isFullDiscount: scalar(state.isFullDiscount),
3067
+ paidAmount: state.paidAmount === void 0 ? "" : scalar(state.paidAmount),
3068
+ vouchers: vouchers.map(() => ({}))
3069
+ };
3070
+ }
3071
+ function dedgeFacts(state, merchant) {
3072
+ const unreadable = `${merchant}'s order record is not in the layout Agentcard reviewed`;
3073
+ const projection = isPlainObject(state) ? dedgeProjection(state) : null;
3074
+ if (!projection || JSON.stringify(projection) !== JSON.stringify(state))
3075
+ return fail(unreadable);
3076
+ const { status, hasOriginalDeposit, hasScheduledPayment, isFullDiscount, paidAmount, vouchers } = projection;
3077
+ if (typeof status !== "string" || typeof hasOriginalDeposit !== "boolean" || typeof hasScheduledPayment !== "boolean" || typeof isFullDiscount !== "boolean" || typeof paidAmount !== "string")
3078
+ return fail(unreadable);
3079
+ if (status !== "New")
3080
+ return fail(`${merchant}'s order is not waiting for a payment`);
3081
+ if (isFullDiscount)
3082
+ return fail(`vouchers or points pay the whole of ${merchant}'s order, so the card pays nothing`);
3083
+ if (paidAmount !== "")
3084
+ return fail(`part of ${merchant}'s order was already paid another way`);
3085
+ if (vouchers.length > 0)
3086
+ return fail(`a voucher pays part of ${merchant}'s order, which Agentcard has not reviewed`);
3087
+ const [deposit, total, balance] = [projection.deposit, projection.total, projection.balance].map(hubAmount);
3088
+ if ([deposit, total, balance].some((amount) => amount?.other))
3089
+ return fail(`${merchant}'s order is in a currency this build does not read`);
3090
+ if (!deposit || !total || !balance)
3091
+ return fail(unreadable);
3092
+ if (deposit.cents + balance.cents !== total.cents)
3093
+ return fail(unreadable);
3094
+ const deferred = !hasOriginalDeposit || deposit.cents === 0 ? "guarantee" : hasScheduledPayment ? "scheduled" : balance.cents > 0 ? "balance" : null;
3095
+ return { ok: true, facts: { amount: { amountCents: deposit.cents, currency: "eur" }, live: true, recurring: false, deferred } };
3023
3096
  }
3024
3097
  var READERS = /* @__PURE__ */ Object.freeze({
3025
- fastspring_session: Object.freeze({ state: fastspringState, project: fastspringProjection, facts: fastspringFacts })
3098
+ fastspring_session: Object.freeze({ state: fastspringState, project: fastspringProjection, facts: fastspringFacts }),
3099
+ dedge_pay_hub: Object.freeze({ state: dedgeState, project: dedgeProjection, facts: dedgeFacts })
3026
3100
  });
3027
3101
  var MERCHANT_CARD_ENDPOINT_FACT_READERS = /* @__PURE__ */ Object.freeze(Object.keys(READERS));
3028
3102
  function cardPlaceholders(p, cardUrl) {
@@ -3040,12 +3114,13 @@ function boundShape(p, card, shapes, exchange) {
3040
3114
  }
3041
3115
  return null;
3042
3116
  }
3117
+ var recordOrigin = (p) => p.facts.origin ?? p.endpoint;
3043
3118
  function shapeFor(p, cardUrl, exchange) {
3044
3119
  if (!p.facts || !isPlainObject(exchange) || typeof exchange.method !== "string" || typeof exchange.url !== "string")
3045
3120
  return null;
3046
3121
  const card = cardPlaceholders(p, cardUrl);
3047
3122
  const url = strictUrl(exchange.url);
3048
- if (!card || !url || url.origin !== p.endpoint)
3123
+ if (!card || !url || url.origin !== recordOrigin(p))
3049
3124
  return null;
3050
3125
  return boundShape(p, card, p.facts.responses, exchange);
3051
3126
  }
@@ -3057,12 +3132,19 @@ function sessionPath(p, card) {
3057
3132
  const written = segments.slice(0, at + 1).map((segment) => segment.startsWith(":") ? card[segment.slice(1)] : segment);
3058
3133
  return written.every((segment) => typeof segment === "string") ? written.join("/") : null;
3059
3134
  }
3135
+ function onSession(p, card, url) {
3136
+ if (p.facts.origin) {
3137
+ const value = card[p.facts.bind];
3138
+ return url.origin === p.facts.origin && typeof value === "string" && url.pathname.split("/").at(-1) === value;
3139
+ }
3140
+ const session = sessionPath(p, card);
3141
+ return !!session && url.origin === p.endpoint && (url.pathname === session || url.pathname.startsWith(`${session}/`));
3142
+ }
3060
3143
  function merchantCardEndpointFactsRole(profile, cardUrl, exchange) {
3061
3144
  const p = trustedMerchantCardEndpoint(profile);
3062
3145
  if (!p.facts || !isPlainObject(exchange) || typeof exchange.method !== "string" || typeof exchange.url !== "string")
3063
3146
  return null;
3064
3147
  const card = cardPlaceholders(p, cardUrl);
3065
- const session = card ? sessionPath(p, card) : null;
3066
3148
  let url;
3067
3149
  try {
3068
3150
  url = new URL(exchange.url);
@@ -3070,10 +3152,12 @@ function merchantCardEndpointFactsRole(profile, cardUrl, exchange) {
3070
3152
  catch {
3071
3153
  return null;
3072
3154
  }
3073
- if (!session || url.origin !== p.endpoint || url.pathname !== session && !url.pathname.startsWith(`${session}/`))
3155
+ if (!card)
3074
3156
  return null;
3075
3157
  if (exchange.method.toUpperCase() === p.method && exchange.url === cardUrl)
3076
3158
  return "card";
3159
+ if (!onSession(p, card, url))
3160
+ return null;
3077
3161
  if (shapeFor(p, cardUrl, exchange))
3078
3162
  return "record";
3079
3163
  if (boundShape(p, card, p.facts.inert, exchange))
@@ -3110,13 +3194,20 @@ function readMerchantCardEndpointFacts(profile, cardUrl, record) {
3110
3194
  return fail(`the order record is not ${p.merchant}'s record of this checkout`);
3111
3195
  return READERS[p.facts.reader].facts(record.state, p.merchant);
3112
3196
  }
3197
+ var DEFERRED_REASONS = /* @__PURE__ */ Object.freeze({
3198
+ guarantee: (merchant) => `${merchant} only holds the card as a guarantee for this order and charges it later, when a single-use card may have closed; choose a rate paid in full now`,
3199
+ scheduled: (merchant) => `${merchant} charges this order on a later date, when a single-use card may have closed; choose a rate paid in full now`,
3200
+ balance: (merchant) => `${merchant} leaves part of this order to pay at the stay, when a single-use card may have closed; choose a rate paid in full now`
3201
+ });
3113
3202
  function merchantCardEndpointFactsRefusal(profile, facts, agent) {
3114
3203
  const p = trustedMerchantCardEndpoint(profile);
3115
3204
  const refuse2 = (code, reason) => ({ code, reason });
3116
- if (!isPlainObject(facts) || !isPlainObject(facts.amount) || !isPlainObject(agent))
3205
+ if (!isPlainObject(facts) || !isPlainObject(facts.amount) || !isPlainObject(agent) || facts.deferred !== null && !Object.hasOwn(DEFERRED_REASONS, facts.deferred))
3117
3206
  return refuse2("malformed", `the order record for ${p.merchant} is malformed`);
3118
3207
  if (facts.recurring !== false)
3119
3208
  return refuse2("recurring", `${p.merchant}'s order renews on a schedule, and each renewal would charge the card with no approval of its own`);
3209
+ if (facts.deferred !== null)
3210
+ return refuse2("deferred", DEFERRED_REASONS[facts.deferred](p.merchant));
3120
3211
  if (facts.live !== agent.live)
3121
3212
  return agent.live ? refuse2("test_checkout", `${p.merchant}'s checkout is in test mode`) : refuse2("live_checkout", `${p.merchant}'s checkout is live`);
3122
3213
  if (typeof agent.currency !== "string" || facts.amount.currency !== agent.currency.toLowerCase()) {
@@ -1,6 +1,6 @@
1
1
  // @ts-nocheck
2
2
  // Generated from @agent-cards/payment-core. Do not edit.
3
- // artifact-sha256: c9116965f8802329701f18adf6519c9111857dfc4329e4f59d7666de150fb5a4
3
+ // artifact-sha256: 4289a22922e08251b579e9aadc396c8cff5d1a95b99ce35dd9a4618b43a33db5
4
4
  // src/sha256.js
5
5
  var K = /* @__PURE__ */ new Uint32Array([
6
6
  1116352408,
@@ -153,6 +153,9 @@ var typedArrayName = Object.getOwnPropertyDescriptor(TYPED_ARRAY, Symbol.toStrin
153
153
  function parseRsaPublicKey(key) {
154
154
  const spki = key && typeof key === "object" ? key.spki : void 0;
155
155
  const pin2 = key && typeof key === "object" ? key.sha256 : void 0;
156
+ const named = key && typeof key === "object" && Object.prototype.hasOwnProperty.call(key, "exponent") ? key.exponent : void 0;
157
+ if (named !== void 0 && named !== 17)
158
+ throw refuse("key");
156
159
  if (typeof spki !== "string" || spki.length > 1024 || spki.length % 4 !== 0 || !BASE64.test(spki))
157
160
  throw refuse("key");
158
161
  if (typeof pin2 !== "string" || !SHA256_HEX.test(pin2))
@@ -188,9 +191,10 @@ function parseRsaPublicKey(key) {
188
191
  if (!MODULUS_BYTES.includes(n.length) || !(n[0] & 128) || !(n[n.length - 1] & 1))
189
192
  throw refuse("key");
190
193
  const e = exponent.bytes;
191
- if (e.length !== 3 || e[0] !== 1 || e[1] !== 0 || e[2] !== 1)
194
+ const expected = named === 17 ? [17] : [1, 0, 1];
195
+ if (e.length !== expected.length || !expected.every((byte, i) => e[i] === byte))
192
196
  throw refuse("key");
193
- return Object.freeze({ n: toBigInt(n), e: 65537n, size: n.length });
197
+ return Object.freeze({ n: toBigInt(n), e: named === 17 ? 17n : 65537n, size: n.length });
194
198
  }
195
199
  function rsaesPkcs1v15Encrypt(key, message, random) {
196
200
  const { n, e, size } = parseRsaPublicKey(key);
@@ -17,9 +17,10 @@ declare function paddleVgsBodyVerdict(body: any): Readonly<{
17
17
  }>;
18
18
  declare function paddleVgsRequestRefusal(request: any): any;
19
19
  declare function isPreparedPaddleVgsRequest(url: any, method: any, body: any, environment: any, headers: any): boolean;
20
+ declare var PADDLE_VGS_ANY_SELLER: boolean;
20
21
  declare var PADDLE_VGS_MERCHANT_PINS: readonly any[];
21
22
  declare function paddleVgsMerchantPin(merchantOrigin: any, pins?: readonly any[]): any;
22
- declare function paddleVgsMerchantRefusal(environment: any, merchantOrigin: any, authorization: any, pins?: readonly any[]): "unsupported_environment" | "paddle_vgs_merchant_unreviewed" | "paddle_vgs_seller_unreviewed" | null;
23
+ declare function paddleVgsMerchantRefusal(environment: any, merchantOrigin: any, authorization: any, pins?: readonly any[], anySeller?: boolean): "unsupported_environment" | "paddle_vgs_merchant_unreviewed" | "paddle_vgs_seller_unreviewed" | null;
23
24
  declare function paddleVgsSellerClaimsPinned(pins?: readonly any[]): boolean;
24
25
  declare function paddleVgsRefusalMessage(code: any): any;
25
26
  declare var PADDLE_VGS_CARD_NETWORKS: readonly string[];
@@ -75,4 +76,4 @@ declare function paddleVgsPayVerdict(request: any, approved: any): Readonly<{
75
76
  verdict: "continue";
76
77
  body: string;
77
78
  }>;
78
- export { PADDLE_VGS_CAPABILITY, PADDLE_VGS_CARDS_URLS, PADDLE_VGS_CARD_ID_WINDOW_MS, PADDLE_VGS_CARD_NETWORKS, PADDLE_VGS_CONTENT_TYPE, PADDLE_VGS_MERCHANT_PINS, PADDLE_VGS_OPERATION, PADDLE_VGS_PSP, PADDLE_VGS_REFUSAL_CODES, injectPaddleVgsCard, isPaddleVgsCardsUrl, isPreparedPaddleVgsRequest, paddleVgsAnswerOutcome, paddleVgsBodyVerdict, paddleVgsCardFacts, paddleVgsCardFactsAgree, paddleVgsCardFactsOf, paddleVgsCardRefusal, paddleVgsEnvironment, paddleVgsMerchantPin, paddleVgsMerchantRefusal, paddleVgsPayCarriesStoredCard, paddleVgsPayTarget, paddleVgsPayVerdict, paddleVgsRefusalCode, paddleVgsRefusalMessage, paddleVgsRequestRefusal, paddleVgsSellerClaimsPinned, paddleVgsStoredCardRefusal, paddleVgsTypedCardRefusal };
79
+ export { PADDLE_VGS_ANY_SELLER, PADDLE_VGS_CAPABILITY, PADDLE_VGS_CARDS_URLS, PADDLE_VGS_CARD_ID_WINDOW_MS, PADDLE_VGS_CARD_NETWORKS, PADDLE_VGS_CONTENT_TYPE, PADDLE_VGS_MERCHANT_PINS, PADDLE_VGS_OPERATION, PADDLE_VGS_PSP, PADDLE_VGS_REFUSAL_CODES, injectPaddleVgsCard, isPaddleVgsCardsUrl, isPreparedPaddleVgsRequest, paddleVgsAnswerOutcome, paddleVgsBodyVerdict, paddleVgsCardFacts, paddleVgsCardFactsAgree, paddleVgsCardFactsOf, paddleVgsCardRefusal, paddleVgsEnvironment, paddleVgsMerchantPin, paddleVgsMerchantRefusal, paddleVgsPayCarriesStoredCard, paddleVgsPayTarget, paddleVgsPayVerdict, paddleVgsRefusalCode, paddleVgsRefusalMessage, paddleVgsRequestRefusal, paddleVgsSellerClaimsPinned, paddleVgsStoredCardRefusal, paddleVgsTypedCardRefusal };
@@ -1,6 +1,6 @@
1
1
  // @ts-nocheck
2
2
  // Generated from @agent-cards/payment-core. Do not edit.
3
- // artifact-sha256: f3437a15e11b72b9958179cc9610fdafb411cc5db76be536af62c08360a45575
3
+ // artifact-sha256: 20dc16205adc94410b425b342c7c54fce24ec95960fb8a0ee2a1558ba9d96dea
4
4
  // src/paddle-vgs.js
5
5
  var PADDLE_VGS_PSP = "paddle_vgs";
6
6
  var PADDLE_VGS_CAPABILITY = "paddle_vgs_cards";
@@ -135,6 +135,7 @@ var pin = (fields) => Object.freeze({
135
135
  origins: Object.freeze([...fields.origins]),
136
136
  sellerClaim: fields.sellerClaim ? Object.freeze({ ...fields.sellerClaim }) : null
137
137
  });
138
+ var PADDLE_VGS_ANY_SELLER = true;
138
139
  var PADDLE_VGS_MERCHANT_PINS = /* @__PURE__ */ Object.freeze([
139
140
  pin({ id: "rectangle_pro", merchant: "Rectangle Pro", origins: ["https://rectangleapp.com"], sellerClaim: null })
140
141
  ]);
@@ -143,14 +144,17 @@ function paddleVgsMerchantPin(merchantOrigin, pins = PADDLE_VGS_MERCHANT_PINS) {
143
144
  return null;
144
145
  return pins.find((entry) => !!entry && Array.isArray(entry.origins) && entry.origins.includes(merchantOrigin)) ?? null;
145
146
  }
146
- function paddleVgsMerchantRefusal(environment, merchantOrigin, authorization, pins = PADDLE_VGS_MERCHANT_PINS) {
147
+ var SELLER_ORIGIN = /^https:\/\/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/;
148
+ var SELLER_ORIGIN_LIMIT = 261;
149
+ function paddleVgsMerchantRefusal(environment, merchantOrigin, authorization, pins = PADDLE_VGS_MERCHANT_PINS, anySeller = PADDLE_VGS_ANY_SELLER) {
147
150
  if (environment === "sandbox")
148
151
  return null;
149
152
  if (environment !== "production")
150
153
  return "unsupported_environment";
151
154
  const found = paddleVgsMerchantPin(merchantOrigin, pins);
152
- if (!found)
153
- return "paddle_vgs_merchant_unreviewed";
155
+ if (!found) {
156
+ return anySeller === true && typeof merchantOrigin === "string" && merchantOrigin.length <= SELLER_ORIGIN_LIMIT && SELLER_ORIGIN.test(merchantOrigin) ? null : "paddle_vgs_merchant_unreviewed";
157
+ }
154
158
  if (found.sellerClaim && authorization !== void 0) {
155
159
  const claims = bearerClaims(authorization);
156
160
  if (!claims || claims[found.sellerClaim.name] !== found.sellerClaim.value)
@@ -405,4 +409,4 @@ function paddleVgsPayVerdict(request, approved) {
405
409
  card.metadata[key] = facts[key];
406
410
  return Object.freeze({ verdict: "continue", body: JSON.stringify(value) });
407
411
  }
408
- export { PADDLE_VGS_CAPABILITY, PADDLE_VGS_CARDS_URLS, PADDLE_VGS_CARD_ID_WINDOW_MS, PADDLE_VGS_CARD_NETWORKS, PADDLE_VGS_CONTENT_TYPE, PADDLE_VGS_MERCHANT_PINS, PADDLE_VGS_OPERATION, PADDLE_VGS_PSP, PADDLE_VGS_REFUSAL_CODES, injectPaddleVgsCard, isPaddleVgsCardsUrl, isPreparedPaddleVgsRequest, paddleVgsAnswerOutcome, paddleVgsBodyVerdict, paddleVgsCardFacts, paddleVgsCardFactsAgree, paddleVgsCardFactsOf, paddleVgsCardRefusal, paddleVgsEnvironment, paddleVgsMerchantPin, paddleVgsMerchantRefusal, paddleVgsPayCarriesStoredCard, paddleVgsPayTarget, paddleVgsPayVerdict, paddleVgsRefusalCode, paddleVgsRefusalMessage, paddleVgsRequestRefusal, paddleVgsSellerClaimsPinned, paddleVgsStoredCardRefusal, paddleVgsTypedCardRefusal };
412
+ export { PADDLE_VGS_ANY_SELLER, PADDLE_VGS_CAPABILITY, PADDLE_VGS_CARDS_URLS, PADDLE_VGS_CARD_ID_WINDOW_MS, PADDLE_VGS_CARD_NETWORKS, PADDLE_VGS_CONTENT_TYPE, PADDLE_VGS_MERCHANT_PINS, PADDLE_VGS_OPERATION, PADDLE_VGS_PSP, PADDLE_VGS_REFUSAL_CODES, injectPaddleVgsCard, isPaddleVgsCardsUrl, isPreparedPaddleVgsRequest, paddleVgsAnswerOutcome, paddleVgsBodyVerdict, paddleVgsCardFacts, paddleVgsCardFactsAgree, paddleVgsCardFactsOf, paddleVgsCardRefusal, paddleVgsEnvironment, paddleVgsMerchantPin, paddleVgsMerchantRefusal, paddleVgsPayCarriesStoredCard, paddleVgsPayTarget, paddleVgsPayVerdict, paddleVgsRefusalCode, paddleVgsRefusalMessage, paddleVgsRequestRefusal, paddleVgsSellerClaimsPinned, paddleVgsStoredCardRefusal, paddleVgsTypedCardRefusal };
@@ -1,6 +1,6 @@
1
1
  // @ts-nocheck
2
2
  // Generated from @agent-cards/payment-core. Do not edit.
3
- // artifact-sha256: 38065a5bd834d5233979a0528fde4345378914e8e8b1a63e329bff0994572da5
3
+ // artifact-sha256: 056fa54de953be9af775505906b2fba30def2787a217a12fe2ca2a50b8614649
4
4
  // src/json-path.js
5
5
  function roundTrips(parsed, body) {
6
6
  try {
@@ -160,6 +160,9 @@ var typedArrayName = Object.getOwnPropertyDescriptor(TYPED_ARRAY, Symbol.toStrin
160
160
  function parseRsaPublicKey(key) {
161
161
  const spki = key && typeof key === "object" ? key.spki : void 0;
162
162
  const pin = key && typeof key === "object" ? key.sha256 : void 0;
163
+ const named = key && typeof key === "object" && Object.prototype.hasOwnProperty.call(key, "exponent") ? key.exponent : void 0;
164
+ if (named !== void 0 && named !== 17)
165
+ throw refuse("key");
163
166
  if (typeof spki !== "string" || spki.length > 1024 || spki.length % 4 !== 0 || !BASE64.test(spki))
164
167
  throw refuse("key");
165
168
  if (typeof pin !== "string" || !SHA256_HEX.test(pin))
@@ -195,9 +198,10 @@ function parseRsaPublicKey(key) {
195
198
  if (!MODULUS_BYTES.includes(n.length) || !(n[0] & 128) || !(n[n.length - 1] & 1))
196
199
  throw refuse("key");
197
200
  const e = exponent.bytes;
198
- if (e.length !== 3 || e[0] !== 1 || e[1] !== 0 || e[2] !== 1)
201
+ const expected = named === 17 ? [17] : [1, 0, 1];
202
+ if (e.length !== expected.length || !expected.every((byte, i) => e[i] === byte))
199
203
  throw refuse("key");
200
- return Object.freeze({ n: toBigInt(n), e: 65537n, size: n.length });
204
+ return Object.freeze({ n: toBigInt(n), e: named === 17 ? 17n : 65537n, size: n.length });
201
205
  }
202
206
  function readElement(der, at, tag) {
203
207
  if (at + 2 > der.length || der[at] !== tag)
@@ -2,6 +2,7 @@ import { StripeCheckoutGate } from './stripe-checkout.js';
2
2
  import { MercadoCheckoutGate } from './mercado-checkout.js';
3
3
  import { type JuspayCheckoutGate } from './juspay-gate.js';
4
4
  import { DatatransRepeats } from './datatrans.js';
5
+ import { TokenexIframeRepeats } from './tokenex-iframe.js';
5
6
  import { type AciGate } from './aci.js';
6
7
  import type { EprotectGate } from './eprotect.js';
7
8
  import { type ShijiStsCompanions } from './shiji-sts.js';
@@ -99,6 +100,8 @@ export interface PreClaimContext {
99
100
  verifoneProfileOf?(url: string): VerifoneProfile | null;
100
101
  cardOnFilePolicy?(url: string, method?: string): string | null;
101
102
  withoutCard?(url: string, body: string | null | undefined): 'continue' | 'refuse' | null;
103
+ /** VaultClient.recognizesProcessor: whether the synced registry serves this processor (ACI, EBANX, the TokenEx iframe). */
104
+ recognizesProcessor?(psp: string): boolean;
102
105
  /** VaultClient.sendEbanxFollowUp: a send an approved EBANX token request covers, from the cardholder's device. */
103
106
  sendEbanxFollowUp?(authorizationId: string, request: {
104
107
  url: string;
@@ -186,6 +189,8 @@ export interface PreClaimContext {
186
189
  juspay?: JuspayCheckoutGate;
187
190
  /** The attachment's approved Datatrans answers (the repeat rule, datatrans.ts). Absent: none are kept. */
188
191
  datatrans?: DatatransRepeats;
192
+ /** The attachment's approved TokenEx iframe answers (the repeat rule, tokenex-iframe.ts). Absent: none are kept. */
193
+ tokenexIframe?: TokenexIframeRepeats;
189
194
  /** The adapter's identity for the request's frame (CDP frameId, Playwright Frame); undefined when unknown. */
190
195
  frame?: unknown;
191
196
  /**
@@ -249,13 +254,28 @@ export declare const fiservPreClaim: PreClaimGate;
249
254
  export declare function isArmedCreditguardCall(vault: {
250
255
  recognizesProcessor?(psp: string): boolean;
251
256
  } | undefined, url: string): boolean;
257
+ export declare const przelewy24PreClaim: PreClaimGate;
252
258
  export declare const ekashuPreClaim: PreClaimGate;
259
+ export declare const transbankPreClaim: PreClaimGate;
253
260
  export declare const redsysPreClaim: PreClaimGate;
261
+ export declare const quickpayPreClaim: PreClaimGate;
262
+ export declare const comgatePreClaim: PreClaimGate;
254
263
  export declare const paypalHostedFieldsPreClaim: PreClaimGate;
255
264
  export declare const paypalCardFormsPreClaim: PreClaimGate;
256
265
  export declare const cybersourceSecureAcceptancePreClaim: PreClaimGate;
257
266
  export declare const worldlineMyCheckoutPreClaim: PreClaimGate;
258
267
  export declare const paddleVgsPayPreClaim: PreClaimGate;
268
+ export type HipayPreClaimRefusal = 'hipay_number_only' | 'hipay_update_refused';
269
+ export declare const hipayPreClaim: PreClaimGate;
270
+ /**
271
+ * Whether attachToPlaywright routes `url` to the gates for HiPay: any request to HiPay's two vault hosts, once the
272
+ * synced registry serves HiPay, as attachToCdp arms both hosts from the recognizer. Playwright's route matcher sees
273
+ * only the URL and the recognizer takes the token create alone, so without this /update would never reach
274
+ * hipayPreClaim there. Any other request to those hosts goes on untouched.
275
+ */
276
+ export declare function routesHipayVault(vault: {
277
+ recognizesProcessor?: (psp: string) => boolean;
278
+ } | null | undefined, url: string): boolean;
259
279
  export declare const ebanxPreClaim: PreClaimGate;
260
280
  /** The processor gates, in order. A new family adds one entry here; the terminal
261
281
  * arbiter runs after all of them and is not part of this list. A gate appended