@agent-cards/sdk 0.23.22 → 0.23.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.js CHANGED
@@ -1,13 +1,10 @@
1
1
  import { BUILTIN_REGISTRY, cardUrlPatterns as deriveCardUrlPatterns, LOOPBACK_URL_PATTERNS, findRecognizer, isRecognizerRequest, recognizerRequestMethod, recognizerRequiresPreparation, urlsOnProcessorHosts, } from './registry.js';
2
2
  import { armServedProfiles, classifyProfileRequest, declareSandboxMerchant, merchantProfileEnvironment, merchantProfileFor, merchantProfileUrlPatterns, } from './merchant-hosted.js';
3
3
  import { merchantAmountExchanges, merchantAmountFromResponses, merchantProfilePricedBySource, merchantTotalWire, MerchantTotalWait, } from './merchant-total.js';
4
- import { ACI_CAPABILITY, ACI_PSP, aciCardLegAnswer } from './aci.js';
5
- import { PRZELEWY24_CAPABILITY, PRZELEWY24_PSP } from './przelewy24.js';
6
- import { EPROTECT_CAPABILITY, EPROTECT_PSP, eprotectCheckoutRefusal, eprotectScriptAnswer, isEprotectRegistration } from './eprotect.js';
7
- import { COMGATE_CAPABILITY, COMGATE_PSP } from './comgate.js';
8
- import { EXIMBAY_CAPABILITY } from './eximbay.js';
4
+ import { ACI_PSP, aciCardLegAnswer } from './aci.js';
5
+ import { EPROTECT_PSP, eprotectCheckoutRefusal, eprotectScriptAnswer, isEprotectRegistration } from './eprotect.js';
9
6
  import { isHostedGetEntry } from './hosted-entry.js';
10
- import { TRANSBANK_CAPABILITY, TRANSBANK_PSP } from './transbank.js';
7
+ import { SBPS_PSP, isSbpsTokenGet, sbpsScriptAnswer } from './sbps.js';
11
8
  import { isMercadoTokenRequest, parseMercadoCheckoutContext, validateMercadoProcessorContext } from './mercado-checkout.generated.js';
12
9
  import { matchesPreparation, preparationMode, validPreparationEnvironment } from './prepared-processor.js';
13
10
  import { fiservKeyPinById, isFiservSubstitution, requiresFiservPreparation } from './fiserv.js';
@@ -16,37 +13,36 @@ import { hasOwnedShopMarker, parseOwnedShopOrder, parseOwnedShopReceipt } from '
16
13
  import { requestWithoutCard } from './card-fields.generated.js';
17
14
  import { merchantSessionCapture } from './merchant-session-probe.js';
18
15
  import { creditguardPageProcessUrl, creditguardPpDomainHost, creditguardPreparationEnvironment, creditguardProcessTxId, sanitizeCreditguardResponse, } from './creditguard.generated.js';
19
- import { CONVERGE_CAPABILITY } from './elavon-converge.js';
20
- import { SHIJI_STS_CAPABILITY, SHIJI_STS_PSP, isShijiStsServedCompanion, isShijiStsServedSubstitution } from './shiji-sts.js';
21
- import { AMADEUS_CHECKOUT_CAPABILITY, AMADEUS_CHECKOUT_PSP } from './amadeus-checkout.generated.js';
22
- import { PADDLE_VGS_CAPABILITY, PADDLE_VGS_PSP, paddleVgsCardFactsOf } from './paddle-vgs.generated.js';
23
- import { PAYGENT_CAPABILITY, PAYGENT_PSP, paygentAnswerOutcome } from './paygent.generated.js';
24
- import { PADDLE_TOKENEX_CAPABILITY, PADDLE_TOKENEX_PSP, isPaddleTokenexServedFacts, isPaddleTokenexServedSubstitution } from './paddle-tokenex.js';
25
- import { TWOC2P_CAPABILITY, TWOC2P_PSP } from './twoc2p.js';
26
- import { WIX_PAYMENTS_CAPABILITY, WIX_PAYMENTS_PSP } from './wix-payments.generated.js';
27
- import { HIPAY_CAPABILITY, HIPAY_PSP } from './hipay.generated.js';
28
- import { TOAST_CAPABILITY, TOAST_PSP, isToastCiphertext } from './toast.generated.js';
16
+ import { SHIJI_STS_PSP, isShijiStsServedCompanion, isShijiStsServedSubstitution } from './shiji-sts.js';
17
+ import { AMADEUS_CHECKOUT_PSP } from './amadeus-checkout.generated.js';
18
+ import { PADDLE_VGS_PSP, paddleVgsCardFactsOf } from './paddle-vgs.generated.js';
19
+ import { PAYGENT_PSP, paygentAnswerOutcome } from './paygent.generated.js';
20
+ import { PADDLE_TOKENEX_PSP, isPaddleTokenexServedFacts, isPaddleTokenexServedSubstitution } from './paddle-tokenex.js';
21
+ import { WIX_PAYMENTS_PSP } from './wix-payments.generated.js';
22
+ import { HIPAY_PSP } from './hipay.generated.js';
23
+ import { TOAST_PSP, isToastCiphertext } from './toast.generated.js';
29
24
  import { classifyStripeCheckoutRequest, encodeStripeCheckoutContext, hasStripeCheckoutMarker, parseStripeCheckoutContext, parseStripeCheckoutResponse, STRIPE_CHECKOUT_CONTEXT_HEADER, } from './stripe-checkout.generated.js';
30
25
  import { VoiceModule } from './voice.js';
31
26
  import { BuyModule } from './buy.js';
32
27
  import { Languages } from './languages.js';
33
28
  import { RequestRegistry } from './requests.js';
34
29
  import { AgentcardError } from './voice-types.js';
35
- import { GMO_CAPABILITY, GMO_PSP, gmoTokenAnswer } from './gmo.js';
30
+ import { HYPHEN, SLASH, maskUuids } from './url-mask-parts.js';
31
+ import { URL_MASKS } from './url-masks.generated.js';
32
+ import { DECLARED_CAPABILITIES } from './capabilities.generated.js';
33
+ import { AGENT_AMOUNT } from './agent-amount.generated.js';
34
+ import { GMO_PSP, gmoTokenAnswer } from './gmo.js';
36
35
  import { admitCybersourceFlexPreparation, isCybersourceFlexTokenShape, sameCybersourceFlexPreparation } from './cybersource-flex.generated.js';
37
- import { CYBERSOURCE_FLEX_CAPABILITY, CYBERSOURCE_FLEX_PSP, validCybersourceFlexSidecar, } from './cybersource-flex.js';
38
- import { JUSPAY_CAPABILITY, JUSPAY_PSP, juspayPageAnswer } from './juspay-gate.js';
36
+ import { CYBERSOURCE_FLEX_PSP, validCybersourceFlexSidecar, } from './cybersource-flex.js';
37
+ import { JUSPAY_PSP, juspayPageAnswer } from './juspay-gate.js';
39
38
  import { CARD_ENDPOINT_MODE, CARD_ENDPOINT_PSP, CardEndpointRefusedError, cardEndpointById, cardEndpointLive, cardEndpointSessionRefusal, } from './card-endpoint.js';
40
39
  import { merchantCardEndpointFactsRefusal as sharedFactsRefusal, readMerchantCardEndpointFacts as sharedReadFacts, } from './merchant-card-endpoints.generated.js';
41
- import { DATATRANS_CAPABILITY } from './datatrans.js';
42
- import { TOKENEX_IFRAME_CAPABILITY, TOKENEX_IFRAME_PSP, tokenexIframePageAnswer, tokenexIframePlaceholderFits } from './tokenex-iframe.js';
43
- import { PELECARD_CAPABILITY, PELECARD_PSP } from './pelecard.js';
44
- import { PRIMER_CAPABILITY, PRIMER_PSP, primerTokenAnswer } from './primer.js';
45
- import { PAYRAILS_CAPABILITY, isPayrailsPaymentUrl, payrailsAnswer } from './payrails.js';
46
- import { WSPAY_CAPABILITY, WSPAY_PSP } from './wspay.js';
40
+ import { TOKENEX_IFRAME_PSP, tokenexIframePageAnswer, tokenexIframePlaceholderFits } from './tokenex-iframe.js';
41
+ import { PRIMER_PSP, primerTokenAnswer } from './primer.js';
42
+ import { isPayrailsPaymentUrl, payrailsAnswer } from './payrails.js';
47
43
  import { EbanxFollowUpError } from './ebanx.js';
48
- import { PAYREXX_CAPABILITY, PAYREXX_PSP, PayrexxFollowUpError } from './payrexx.js';
49
- import { SECURE_ACCEPTANCE_CAPABILITY, SECURE_ACCEPTANCE_FAST_POLL_MS, SECURE_ACCEPTANCE_PSP, SECURE_ACCEPTANCE_REPLY_WINDOW_MS, secureAcceptanceCheckoutProfile, secureAcceptanceCheckoutRefusal, secureAcceptanceFrameAnswer, } from './cybersource-secure-acceptance.js';
44
+ import { PAYREXX_PSP, PayrexxFollowUpError } from './payrexx.js';
45
+ import { SECURE_ACCEPTANCE_FAST_POLL_MS, SECURE_ACCEPTANCE_PSP, SECURE_ACCEPTANCE_REPLY_WINDOW_MS, secureAcceptanceCheckoutProfile, secureAcceptanceCheckoutRefusal, secureAcceptanceFrameAnswer, } from './cybersource-secure-acceptance.js';
50
46
  /**
51
47
  * The modes this SDK can finish. Asked for on syncRegistry (the API serves
52
48
  * only recognizers in these modes, so a request this build cannot complete
@@ -206,6 +202,12 @@ export const SUPPORTED_REGISTRY_FEATURES = ['card_fields', 'checkout_sessions'];
206
202
  * never lets the agent's browser post to (pre-claim.ts, redsys.ts). Served on the same terms as NMI's: only
207
203
  * to a build that lists it, for a company Agentcard turned Redsys on for.
208
204
  *
205
+ * `paytrail_hosted_payment_page`: Paytrail's card method, whose card-free signed Visa and Mastercard
206
+ * entry this build pauses for the cardholder's device, and whose loading page post, card page posts and
207
+ * card-number lookup on Payment Highway's host this build never lets the agent's browser send
208
+ * (pre-claim.ts, paytrail.ts). Served on the same terms as NMI's and Redsys's: only to a build that lists
209
+ * it, for a company Agentcard turned Paytrail on for.
210
+ *
209
211
  * `paddle_vgs_cards`: the card request Paddle's checkout frame sends to its VGS card
210
212
  * vault (vault.paddle.com/cards) on a checkout that names VGS, only through a prepared
211
213
  * checkout: the frame aborts the request 10 seconds after Pay and sends it once more,
@@ -322,8 +324,8 @@ export const SUPPORTED_REGISTRY_FEATURES = ['card_fields', 'checkout_sessions'];
322
324
  * This build pauses only the form's own multipart body at that exact URL; the cardholder's
323
325
  * device sends the card through the checkout relay, and the frame gets the token answer
324
326
  * payment-core's judge rebuilt, with the CORS answer for the frame's own origin, null. The
325
- * request names no amount, so the agent's pair, above zero, is the one the cardholder approves
326
- * (PAY_NL_PSP below). Served on the same terms: only to a build that lists it, for a company
327
+ * request names no amount, so the agent's pair, above zero, is the one the cardholder approves.
328
+ * Served on the same terms: only to a build that lists it, for a company
327
329
  * Agentcard turned Pay. on for.
328
330
  *
329
331
  * `paypal_card_fields`: PayPal Card Fields' confirm, the POST its v5 frame sends to
@@ -391,8 +393,8 @@ export const SUPPORTED_REGISTRY_FEATURES = ['card_fields', 'checkout_sessions'];
391
393
  * encrypted under Clover's key. This build pauses only the frame's own body at that exact URL; the
392
394
  * cardholder's device builds the request again with the real card under the key payment-core pins
393
395
  * and sends it to Clover itself, and the frame gets the token answer payment-core's judge rebuilt.
394
- * The request names no amount, so the agent's pair, above zero, is the one the cardholder approves
395
- * (CLOVER_PSP below). Served on the same terms: only to a build that lists it, for a company
396
+ * The request names no amount, so the agent's pair, above zero, is the one the cardholder approves.
397
+ * Served on the same terms: only to a build that lists it, for a company
396
398
  * Agentcard turned Clover on for.
397
399
  *
398
400
  * `eximbay_hosted_payment_page`: Eximbay's payment window, whose card-free signed entry
@@ -410,13 +412,50 @@ export const SUPPORTED_REGISTRY_FEATURES = ['card_fields', 'checkout_sessions'];
410
412
  * this build writes it over the agent's placeholder and nothing else before it
411
413
  * continues the request. Served on the same terms: only to a build that lists it, for
412
414
  * a company Agentcard turned Toast on for.
415
+ *
416
+ * `xendit_card_token`: the card token request Xendit's hosted invoice checkout
417
+ * (checkout.xendit.co/web/<invoice id>, where Xendit's payment and donation links land) sends
418
+ * when the payer presses Pay Now: Xendit.js posts the card as JSON to
419
+ * https://api.xendit.co/v2/credit_card_tokens from the page itself, under the business's
420
+ * publishable key. This build pauses only the card form's single-use token body at that exact URL
421
+ * (payment-core xendit.js); a token that keeps the card on file, Xendit.js's code-only storeCVN post
422
+ * and any other body there fail in the browser before anything is created. The cardholder's device
423
+ * sends the request itself with the real card, and the page gets the token answer payment-core's
424
+ * judge rebuilt, after which the page runs 3-D Secure and charges the token without the card. The
425
+ * token names the invoice's amount and currency, so no agent pair is needed: the API reads the
426
+ * token's and holds an agent's pair to it. Served on the same terms: only to a build that lists it,
427
+ * for a company Agentcard turned Xendit on for.
428
+ *
429
+ * `omise_card_token`: the card token request every Omise card form sends, Omise.js's pay.html frame
430
+ * or a merchant's own page calling Omise.js or Omise's Node library: a JSON POST to
431
+ * https://vault.omise.co/tokens under the merchant's public key. This build pauses only the card
432
+ * form's token body at that exact URL (payment-core omise.js); a wallet's tokenization and any other
433
+ * body there fail in the browser before anything is created. The cardholder's device sends the
434
+ * request itself with the real card, and the page gets the token answer payment-core's judge
435
+ * rebuilt. The request names no amount, so the agent's pair, above zero, is the one the cardholder
436
+ * approves, and the API pays only a merchant payment-core pins for the checkout
437
+ * page the create names. Served on the same terms: only to a build that lists it, for a company
438
+ * Agentcard turned Omise on for.
439
+ *
440
+ * `sbps_token_jsonp`: SB Payment Service's card token request, the JSONP <script>
441
+ * GET its token script sends to /token/generateToken on token.sps-system.com. This
442
+ * build pauses it only as the browser writes it, aborts any other request on that
443
+ * path, and answers the paused script with the token as the API recorded it, in the
444
+ * request's own callback. The device rebuilds the card's ciphertext and sends it
445
+ * through the checkout relay. Served on the same terms: only to a build that lists
446
+ * it, for a company Agentcard turned SB Payment Service on for.
447
+ *
448
+ * `midtrans_card_token`: the card token Midtrans' Snap popup posts as one JSON request to
449
+ * api.midtrans.com/v2/token (api.sandbox.midtrans.com in test), under the business's
450
+ * publishable client key. The cardholder's device sends it and the page gets back Midtrans'
451
+ * token, which the merchant's own server charges afterwards, card free, running 3-D Secure
452
+ * there. The token names no amount, so authorize() needs the agent's pair.
453
+ * Served on the same terms, and the API holds the lane to Agentcard's own company
454
+ * until a reviewed change binds the client key to the merchant.
455
+ *
456
+ * The list itself is capabilities.json, sorted, one per line (scripts/generate-capabilities.mjs).
413
457
  */
414
- export const SUPPORTED_CAPABILITIES = ['fiserv_card_capture', GMO_CAPABILITY, CYBERSOURCE_FLEX_CAPABILITY, JUSPAY_CAPABILITY, DATATRANS_CAPABILITY, 'authorize_net_dpm_form', PELECARD_CAPABILITY, ACI_CAPABILITY, 'creditguard_pps_process', PRIMER_CAPABILITY, PAYRAILS_CAPABILITY, CONVERGE_CAPABILITY, EPROTECT_CAPABILITY, WSPAY_CAPABILITY, SHIJI_STS_CAPABILITY, AMADEUS_CHECKOUT_CAPABILITY, 'worldline_mycheckout_form', 'verifone_card_capture', 'ekashu_hosted_payment_page', SECURE_ACCEPTANCE_CAPABILITY, 'gravy_session_fields_put', 'moneris_hosted_tokenization', PADDLE_VGS_CAPABILITY, PADDLE_TOKENEX_CAPABILITY,
415
- 'redsys_hosted_payment_page', 'lyra_krypton_payment', 'payfast_card_pay', WIX_PAYMENTS_CAPABILITY, 'paymongo_checkout_pay', PAYGENT_CAPABILITY, 'pay_nl_card_token', HIPAY_CAPABILITY, TWOC2P_CAPABILITY, 'quickpay_hosted_payment_page', 'revolut_card_field', 'paypal_card_fields', 'gopay_card_form', PAYREXX_CAPABILITY, COMGATE_CAPABILITY, PRZELEWY24_CAPABILITY, 'makecommerce_card_frame', 'poynt_collect_nonce',
416
- TOKENEX_IFRAME_CAPABILITY, TRANSBANK_CAPABILITY,
417
- 'sumup_checkout_process',
418
- 'clover_card_token',
419
- EXIMBAY_CAPABILITY, TOAST_CAPABILITY];
458
+ export const SUPPORTED_CAPABILITIES = DECLARED_CAPABILITIES;
420
459
  /**
421
460
  * Processors whose paused request names no amount at all, so the pair the
422
461
  * agent passes is the amount the cardholder approves: authorize() refuses one
@@ -436,12 +475,12 @@ export const SUPPORTED_CAPABILITIES = ['fiserv_card_capture', GMO_CAPABILITY, CY
436
475
  * carries, is the total the cardholder approves, and the card that pays can spend
437
476
  * no more than that (the API's card rule). Moneris Hosted Tokenization's
438
477
  * request.php carries the card and no price: the merchant's server charges the
439
- * token later, so the agent's pair, above zero (MONERIS_PSP below), is the one
478
+ * token later, so the agent's pair, above zero (`moneris` in the table), is the one
440
479
  * figure the approval shows. Paddle VGS's card request carries none either: Paddle
441
480
  * charges the stored card at /pay for what the checkout says, so the agent's pair,
442
481
  * which the prepared checkout carries, is the total the cardholder approves. Payfast's
443
482
  * card pay carries none either: the merchant's entry bound the total to the payment,
444
- * so the agent sends the total Payfast's page shows, above zero (PAYFAST_PSP below),
483
+ * so the agent sends the total Payfast's page shows, above zero (`payfast` in the table),
445
484
  * and the API holds it to the payment Payfast itself reports. Wix's tokenize request
446
485
  * carries none either: the merchant's page charges Wix's token for its own order, so the
447
486
  * agent's pair, which the prepared checkout carries, is the total the cardholder approves. Toast's
@@ -450,88 +489,87 @@ export const SUPPORTED_CAPABILITIES = ['fiserv_card_capture', GMO_CAPABILITY, CY
450
489
  * the one figure the approval shows.
451
490
  * PayMongo's card attach carries none either: the merchant bound the total, always in
452
491
  * Philippine pesos, to the checkout session when it created it, so the agent sends that
453
- * total, above zero (PAYMONGO_PSP below), and the API holds it to the session PayMongo's
492
+ * total, above zero (`paymongo` in the table), and the API holds it to the session PayMongo's
454
493
  * own page shows. GoPay's card post carries none either: the shop's server set the amount
455
494
  * when it created the payment at GoPay, and GoPay's gateway shows it only inside its own
456
- * session, so the agent sends the total the gateway shows, above zero (GOPAY_PSP below).
495
+ * session, so the agent sends the total the gateway shows, above zero (`gopay` in the table).
457
496
  * Paygent's token request carries none either: the merchant's server charges the token later, so
458
497
  * the agent's pair, which the prepared checkout carries, is the total the cardholder approves.
459
498
  * Payrexx's card request names the page's total, but it only mints a token: the merchant's page
460
499
  * charges its own total later, at its validateForm, so the agent sends the total that page shows,
461
- * above zero (PAYREXX_PSP), and the API holds it to the frame's figure exactly.
500
+ * above zero (`payrexx` in the table), and the API holds it to the frame's figure exactly.
462
501
  * 2C2P's Payment carries none either: the merchant bound the total to the
463
502
  * payment token when it created it, so the agent sends the total 2C2P's page shows, above
464
- * zero (TWOC2P_PSP), and the API holds it to the amount 2C2P's own PaymentOption answer names.
503
+ * zero (`twoc2p` in the table), and the API holds it to the amount 2C2P's own PaymentOption answer names.
465
504
  * Przelewy24's pay wall link carries none either: the merchant's server registered the amount
466
505
  * with Przelewy24 under the link's token, so the agent sends the amount the pay wall shows, above
467
- * zero (PRZELEWY24_PSP below), and the cardholder's device holds the pay wall to it.
506
+ * zero (`przelewy24` in the table), and the cardholder's device holds the pay wall to it.
468
507
  * HiPay's token create carries none either: the merchant's server charges
469
508
  * HiPay's token for its own order, so the agent's pair, which the prepared checkout carries,
470
509
  * is the total the cardholder approves, above zero as Moneris's is. Revolut's card payment
471
510
  * names the order's amount in minor units but not its currency, which only the order holds,
472
511
  * so the number alone is no price the cardholder can approve: the agent sends the pair, above
473
- * zero (REVOLUT_PSP below), and the API holds its amount to the body's and its currency to
512
+ * zero (`revolut` in the table), and the API holds its amount to the body's and its currency to
474
513
  * one that Revolut and the API both count in hundredths.
475
514
  * Pay.'s card token request carries none either: the shop's server charges the token later for
476
- * its own order total, so the agent's pair, above zero (PAY_NL_PSP below), is the one figure the
515
+ * its own order total, so the agent's pair, above zero (`pay_nl` in the table), is the one figure the
477
516
  * approval shows.
478
517
  * PayPal Card Fields' confirm carries none either: the merchant's server fixed the
479
- * amount when it created the order, so the agent's pair, above zero (PAYPAL_PSP
480
- * below), is the one figure the approval shows.
518
+ * amount when it created the order, so the agent's pair, above zero (`paypal` in
519
+ * the table), is the one figure the approval shows.
481
520
  * ComGate's gateway link carries none either: the merchant's server set
482
521
  * the amount when it created the payment at ComGate, so the agent's pair, above zero
483
- * (COMGATE_PSP below), is the figure the cardholder approves, and the cardholder's device
522
+ * (`comgate` in the table), is the figure the cardholder approves, and the cardholder's device
484
523
  * holds ComGate's own figure to it before any card leaves.
485
524
  * MakeCommerce's card post carries none either: MakeCommerce's transaction holds the total, in
486
- * euros, so the agent sends the total the shop's order page shows, above zero (MAKECOMMERCE_PSP
487
- * below), and the API refuses any other currency.
525
+ * euros, so the agent sends the total the shop's order page shows, above zero (`makecommerce` in
526
+ * the table), and the API refuses any other currency.
488
527
  * GoDaddy Payments' generate-nonce carries none either: GoDaddy's server charges
489
- * the nonce later, so its pair must be above zero too (POYNT_PSP below).
528
+ * the nonce later, so its pair must be above zero too (`poynt` in the table).
490
529
  * The TokenEx iframe's card post carries none either: it mints a token into the merchant's TokenEx
491
530
  * vault, which the merchant's server charges later for its own order, so the agent sends the total
492
- * the merchant's page shows, above zero (TOKENEX_IFRAME_PSP), and the API refuses a create without it.
531
+ * the merchant's page shows, above zero (`tokenex_iframe` in the table), and the API refuses a create without it.
493
532
  * Webpay's entry carries none either: the merchant's server bound the total, in Chilean pesos,
494
- * to the transaction when it created it, so the agent's pair, above zero (TRANSBANK_PSP below),
533
+ * to the transaction when it created it, so the agent's pair, above zero (`transbank_webpay` in the table),
495
534
  * is the figure the cardholder approves, and the cardholder's device holds Webpay's own
496
535
  * transaction to it before any card leaves.
497
536
  * SumUp's card request carries none either: the merchant's server bound the
498
537
  * total and its currency to the checkout when it created it, so the agent sends the total the
499
- * payment page shows, above zero (SUMUP_PSP below), and the API holds it to the checkout SumUp
538
+ * payment page shows, above zero (`sumup` in the table), and the API holds it to the checkout SumUp
500
539
  * itself reports.
501
540
  * Clover's card token request carries none either: the merchant's server charges the token
502
- * later for its own order, so the agent's pair, above zero (CLOVER_PSP below), is the one figure
541
+ * later for its own order, so the agent's pair, above zero (`clover` in the table), is the one figure
503
542
  * the approval shows.
543
+ * Omise's card token request carries none either, for the same reason: the merchant's server
544
+ * charges the token afterwards for its own order (`omise` in the table).
545
+ * Paytrail's card method entry carries none either: the merchant's server fixed the amount, in
546
+ * euros, when it created the payment, so the agent sends that amount (`paytrail` in the table), and
547
+ * the cardholder's device holds Payment Highway's card page to it.
548
+ * SB Payment Service's token request carries none either: the merchant's server
549
+ * charges the token later, so its pair must be above zero too (`sb_payment_service` in the table), and
550
+ * agree with the page's order total (PAGE_AMOUNT_PROCESSORS).
551
+ * Midtrans' Snap card token carries none either: the merchant's server charges the token
552
+ * afterwards, so the agent's pair, above zero (`midtrans` in the table), is the one figure the
553
+ * approval shows.
554
+ * The table itself is agent-amount-processors.json, sorted, one processor per line
555
+ * (scripts/generate-agent-amount.mjs). A processor added there states its reason in the API
556
+ * create route's refusal, not in this comment.
504
557
  */
505
- const MONERIS_PSP = 'moneris';
506
- const PAYFAST_PSP = 'payfast';
507
- const PAYMONGO_PSP = 'paymongo';
508
558
  const REVOLUT_PSP = 'revolut';
509
- const PAY_NL_PSP = 'pay_nl';
510
- const PAYPAL_PSP = 'paypal';
511
- const GOPAY_PSP = 'gopay';
512
- const MAKECOMMERCE_PSP = 'makecommerce';
513
- const POYNT_PSP = 'poynt';
514
- const SUMUP_PSP = 'sumup';
515
- const CLOVER_PSP = 'clover';
516
- const AGENT_AMOUNT_PROCESSORS = [GMO_PSP, PELECARD_PSP, WSPAY_PSP, SECURE_ACCEPTANCE_PSP, MONERIS_PSP, PADDLE_VGS_PSP, PAYFAST_PSP, WIX_PAYMENTS_PSP, PAYMONGO_PSP, PAYGENT_PSP, PAY_NL_PSP, HIPAY_PSP, TWOC2P_PSP, REVOLUT_PSP, PAYPAL_PSP, GOPAY_PSP, PAYREXX_PSP, COMGATE_PSP,
517
- PRZELEWY24_PSP, MAKECOMMERCE_PSP, POYNT_PSP, TOKENEX_IFRAME_PSP, TRANSBANK_PSP, SUMUP_PSP,
518
- CLOVER_PSP, TOAST_PSP];
559
+ const AGENT_AMOUNT_PROCESSORS = AGENT_AMOUNT.processors;
560
+ /** The ones a zero amount is refused for, like a missing one (authorize()). */
561
+ const ABOVE_ZERO_PROCESSORS = AGENT_AMOUNT.aboveZero;
519
562
  /** How AmountRequiredError names a processor. */
520
- const PROCESSOR_NAMES = { [GMO_PSP]: 'GMO', [PELECARD_PSP]: 'Pelecard', [WSPAY_PSP]: 'WSPay',
521
- [SECURE_ACCEPTANCE_PSP]: 'CyberSource Secure Acceptance', [MONERIS_PSP]: 'Moneris', [PADDLE_VGS_PSP]: 'Paddle', [PAYFAST_PSP]: 'Payfast', [WIX_PAYMENTS_PSP]: 'Wix', [PAYMONGO_PSP]: 'PayMongo', [PAYGENT_PSP]: 'Paygent', [PAY_NL_PSP]: 'Pay.', [HIPAY_PSP]: 'HiPay', [TWOC2P_PSP]: '2C2P',
522
- [REVOLUT_PSP]: 'Revolut', [PAYPAL_PSP]: 'PayPal', [GOPAY_PSP]: 'GoPay', [PAYREXX_PSP]: 'Payrexx',
523
- [COMGATE_PSP]: 'ComGate', [PRZELEWY24_PSP]: 'Przelewy24',
524
- [MAKECOMMERCE_PSP]: 'MakeCommerce', [POYNT_PSP]: 'GoDaddy Payments', [TOKENEX_IFRAME_PSP]: 'TokenEx', [TRANSBANK_PSP]: 'Webpay',
525
- [SUMUP_PSP]: 'SumUp',
526
- [CLOVER_PSP]: 'Clover', [TOAST_PSP]: 'Toast' };
563
+ const PROCESSOR_NAMES = AGENT_AMOUNT.names;
527
564
  /**
528
565
  * Processors whose request and answer name no amount at all, so the total the
529
566
  * payment page shows (`pageAmount`) is the one figure that ties the agent's pair
530
567
  * to what the page charges: authorize() refuses one without it
531
568
  * (PageAmountRequiredError), and the API answers 400 page_amount_required for the
532
- * same case. Pelecard only.
569
+ * same case. Pelecard, and SB Payment Service, whose token request and answer
570
+ * name no amount either.
533
571
  */
534
- const PAGE_AMOUNT_PROCESSORS = [PELECARD_PSP];
572
+ const PAGE_AMOUNT_PROCESSORS = AGENT_AMOUNT.pageAmount;
535
573
  /** An integer in the smallest unit, or a decimal string in normal units with a point; nothing else. */
536
574
  export function validAmountInput(amount) {
537
575
  if (typeof amount === 'number')
@@ -806,7 +844,9 @@ export class AmountRequiredError extends Error {
806
844
  // A Payrexx card request names the frame's total, but the merchant's page charges its own total after the token.
807
845
  const lacks = psp === REVOLUT_PSP ? 'names its amount but not its currency'
808
846
  : psp === PAYREXX_PSP ? "only mints a token the merchant's page charges later" : 'names no amount';
809
- super(`A ${processor} payment request ${lacks}, so pass amount and currency: that is the amount the cardholder approves. Nothing was created and nothing was charged.`);
847
+ // "An Omise payment request", "A Clover payment request": the article follows the name's first letter.
848
+ const article = /^[AEIOU]/.test(processor) ? 'An' : 'A';
849
+ super(`${article} ${processor} payment request ${lacks}, so pass amount and currency: that is the amount the cardholder approves. Nothing was created and nothing was charged.`);
810
850
  this.psp = psp;
811
851
  this.name = 'AmountRequiredError';
812
852
  }
@@ -824,7 +864,7 @@ export class PageAmountRequiredError extends Error {
824
864
  psp;
825
865
  code = 'page_amount_required';
826
866
  constructor(psp) {
827
- const processor = psp === PELECARD_PSP ? 'Pelecard' : psp;
867
+ const processor = PROCESSOR_NAMES[psp] ?? psp;
828
868
  super(`A ${processor} payment request names no amount, so pass the total its payment page shows as pageAmount beside amount and currency. Nothing was created and nothing was charged.`);
829
869
  this.psp = psp;
830
870
  this.name = 'PageAmountRequiredError';
@@ -1263,23 +1303,7 @@ function parseErrorEnvelope(bodyText) {
1263
1303
  }
1264
1304
  return { code: null, details: {} };
1265
1305
  }
1266
- /**
1267
- * A slash as the masks below read one: plain, or escaped once or more in either case (%2F, %2f, %252F). A path keeps
1268
- * an escape as it was written, and the id behind it is the same id, so every slash a mask names reads in any of these
1269
- * spellings. The slashes right before an id read as a run, and a doubled slash hides nothing either.
1270
- */
1271
- const SLASH = '(?:/|%(?:25)*2f)';
1272
- /** A hyphen inside an id: plain, or escaped once or more in either case (%2D, %252d). */
1273
- const HYPHEN = '(?:-|%(?:25)*2d)';
1274
- /**
1275
- * The masks that find a uuid by its shape take it in any case, with or without its hyphens, each hyphen in any
1276
- * spelling HYPHEN reads. The pattern reads a percent escape as one unit and keeps it, so the hex digits of an escaped
1277
- * separator before the id (%2F, %252F, %3D) never start a match and leave the id's last digits showing.
1278
- */
1279
- const UUID_OR_ESCAPE = new RegExp(`%(?:25)*[0-9a-f]{2}|[0-9a-f]{8}${HYPHEN}?[0-9a-f]{4}${HYPHEN}?[0-9a-f]{4}${HYPHEN}?[0-9a-f]{4}${HYPHEN}?[0-9a-f]{12}`, 'gi');
1280
- function maskUuids(path, label) {
1281
- return path.replace(UUID_OR_ESCAPE, (token) => (token.startsWith('%') ? token : label));
1282
- }
1306
+ // SLASH, HYPHEN and maskUuids, which every mask below reads, live in url-mask-parts.ts with the UrlMask shape.
1283
1307
  const CREDITGUARD_HOST = /(?:^|\.)creditguard\.co\.il\.?$/i;
1284
1308
  const CREDITGUARD_TXN = new RegExp(`(${SLASH}txn${SLASH}+)[^/]+`, 'gi');
1285
1309
  function maskCreditguardTxId(path) {
@@ -1452,14 +1476,28 @@ function maskSumupCheckout(path) {
1452
1476
  * FastSpring's checkout posts its card payment to <store>.onfastspring.com[/popup-<name>]/session/<id>/payment
1453
1477
  * (payment-core fastspring.js), and the session id in that path is a credential: the session's own document,
1454
1478
  * which anyone holding the id can read with no cookie, carries the order and the session's token. On every
1455
- * host under onfastspring.com the segment after /session/, in any case or after an escaped slash, reads
1456
- * {session}.
1479
+ * host under onfastspring.com the segment after /session/, in any case and in any spelling of the slashes around
1480
+ * /session/ that SLASH reads, reads {session}.
1457
1481
  */
1458
1482
  const FASTSPRING_HOST = /(?:^|\.)onfastspring\.com\.?$/i;
1459
- const FASTSPRING_SESSION = /(\/session(?:\/|%2f))[^/]*/gi;
1483
+ const FASTSPRING_SESSION = new RegExp(`(${SLASH}session${SLASH}+)[^/]*`, 'gi');
1460
1484
  function maskFastspringSession(path) {
1461
1485
  return path.replace(FASTSPRING_SESSION, '$1{session}');
1462
1486
  }
1487
+ /**
1488
+ * PayU Latam's WebCheckout sends the card to /ppp-web-gateway-payu/checkout/submit/<country>/credit_card/<key>
1489
+ * on its own host (payment-core payu-latam.js), and the key, 32 hex characters, is the checkout session's
1490
+ * only credential: the page's card-free routes answer it with no cookie, the order, the payer and the
1491
+ * merchant among them. Every route of the page carries the same key, so on every host under
1492
+ * payulatam.com any run of 32 or more hex characters, in any case or after an escaped slash, reads {key}. A hex
1493
+ * character escaped once or more (%66 or %2566 for f, in either case) counts as that character, since PayU's server
1494
+ * reads the same key, so an escape inside the key cannot split it into two runs too short to mask.
1495
+ */
1496
+ const PAYU_LATAM_HOST = /(?:^|\.)payulatam\.com\.?$/i;
1497
+ const PAYU_LATAM_KEY = /(?:[0-9a-f]|%(?:25)*(?:3[0-9]|4[1-6]|6[1-6])){32,}/gi;
1498
+ function maskPayuLatamKey(path) {
1499
+ return path.replace(PAYU_LATAM_KEY, '{key}');
1500
+ }
1463
1501
  /**
1464
1502
  * The processors whose card request carries its own credential in the URL path, with the hosts
1465
1503
  * that send it, the text that names those hosts anywhere else (a string that is not a URL, or a
@@ -1607,10 +1645,7 @@ const QUICKPAY_SESSION = /(\/|%2f)[0-9a-f]{32,}/gi;
1607
1645
  function maskQuickpaySession(path) {
1608
1646
  return path.replace(QUICKPAY_SESSION, '$1{session}');
1609
1647
  }
1610
- /**
1611
- * `mask` reads a text that names the processor's host; `pathMask`, where a processor has one, reads the path of a
1612
- * URL already parsed on that host, which `mask` reads otherwise.
1613
- */
1648
+ /** Today's masks here; each later processor's in its own src/url-masks/<psp>.ts (URL_MASKS). */
1614
1649
  const PATH_CREDENTIALS = [
1615
1650
  { host: PATH_SECRET_HOST, named: /(?:wspay\.biz|monri\.com)/i, mask: maskPathSecret },
1616
1651
  { host: CREDITGUARD_HOST, named: /creditguard\.co\.il/i, mask: maskCreditguardTxId },
@@ -1635,6 +1670,8 @@ const PATH_CREDENTIALS = [
1635
1670
  { host: TWOC2P_PAGE_HOST, named: /pgw-ui\.2c2p\.com/i, mask: maskTwoC2pToken, pathMask: maskTwoC2pPath },
1636
1671
  { host: QUICKPAY_HOST, named: /quickpay\.net/i, mask: maskQuickpaySession },
1637
1672
  { host: FASTSPRING_HOST, named: /onfastspring\.com/i, mask: maskFastspringSession },
1673
+ { host: PAYU_LATAM_HOST, named: /payulatam\.com/i, mask: maskPayuLatamKey },
1674
+ ...URL_MASKS,
1638
1675
  ];
1639
1676
  /**
1640
1677
  * A URL as it may appear in an error message: origin + path only. A paused
@@ -1674,6 +1711,9 @@ const PATH_CREDENTIALS = [
1674
1711
  * https://payment.quickpay.net/{session}/3ds_auth.
1675
1712
  * On FastSpring's store hosts the session id reads `{session}`:
1676
1713
  * https://daisydisk.onfastspring.com/session/{session}/payment.
1714
+ * On PayU Latam's hosts the checkout session's key reads `{key}`:
1715
+ * https://checkout.payulatam.com/ppp-web-gateway-payu/checkout/submit/co/credit_card/{key}.
1716
+ * Each mask in src/url-masks/ says what it reads in its own file.
1677
1717
  * A string that is not a URL keeps the part before any `?` or `#`, with the
1678
1718
  * same segments masked for every processor whose host it names.
1679
1719
  * A URL is read by its host only when the parser finds one. Text before a URL
@@ -2761,14 +2801,15 @@ export class VaultClient {
2761
2801
  : `checkout authorization is POST-only; got ${method} for ${redactUrl(input.request.url)}. ` +
2762
2802
  'A non-POST tokenizer needs recognizer support before it can be intercepted.');
2763
2803
  }
2764
- // A GET card request is its URL alone. This build completes two kinds: Worldpay
2765
- // eProtect's registration exactly as payment-core admits it, with no body, and a
2766
- // hosted page's entry link exactly as its rule admits it (hosted-entry.ts), with no
2767
- // body, which the cardholder's device takes over.
2804
+ // A GET card request is its URL alone. This build completes three kinds: Worldpay
2805
+ // eProtect's registration and SB Payment Service's token request, each exactly as
2806
+ // payment-core admits it, with no body, and a hosted page's entry link exactly as its
2807
+ // rule admits it (hosted-entry.ts), with no body, which the cardholder's device takes over.
2768
2808
  const eprotect = rec?.psp === EPROTECT_PSP;
2769
2809
  const hostedGetEntry = mode === 'hosted_form' && !!rec && isHostedGetEntry(rec.psp, input.request.url)
2770
2810
  && (input.request.body === undefined || input.request.body === null || input.request.body === '');
2771
- if (cardMethod === 'GET' && !(eprotect && isEprotectRegistration(input.request)) && !hostedGetEntry) {
2811
+ const sbps = rec?.psp === SBPS_PSP;
2812
+ if (cardMethod === 'GET' && !(eprotect && isEprotectRegistration(input.request)) && !hostedGetEntry && !(sbps && isSbpsTokenGet(input.request))) {
2772
2813
  throw new Error(`this ${rec?.psp} GET is not a card registration this version of @agent-cards/checkout can complete: ${redactUrl(input.request.url)}.`);
2773
2814
  }
2774
2815
  // A CyberSource Secure Acceptance token create (always prepared: its recognizer requires it). The
@@ -2811,13 +2852,9 @@ export class VaultClient {
2811
2852
  // like a missing one. So is a TokenEx iframe token, which the merchant's server charges later for its own order.
2812
2853
  // A Clover token is charged later for whatever the merchant's server decides, as a Moneris one is.
2813
2854
  // A Toast payment method is charged by the page's own confirm for whatever its intent says, the same way.
2814
- if (hasAmount && rec && rec.psp === PRZELEWY24_PSP && Number(input.amount) <= 0)
2815
- throw new AmountRequiredError(rec.psp);
2816
- if (hasAmount && rec && (rec.psp === MONERIS_PSP || rec.psp === PAYFAST_PSP || rec.psp === PAYMONGO_PSP || rec.psp === HIPAY_PSP || rec.psp === TWOC2P_PSP
2817
- || rec.psp === REVOLUT_PSP || rec.psp === PAY_NL_PSP || rec.psp === PAYPAL_PSP
2818
- || rec.psp === GOPAY_PSP || rec.psp === COMGATE_PSP || rec.psp === MAKECOMMERCE_PSP
2819
- || rec.psp === POYNT_PSP || rec.psp === TOKENEX_IFRAME_PSP || rec.psp === TRANSBANK_PSP || rec.psp === SUMUP_PSP
2820
- || rec.psp === CLOVER_PSP || rec.psp === PAYREXX_PSP || rec.psp === TOAST_PSP) && Number(input.amount) <= 0)
2855
+ // An Omise token is charged later for whatever the merchant's server decides, as a Clover one is.
2856
+ // An SB Payment Service token is charged later the same way.
2857
+ if (hasAmount && rec && ABOVE_ZERO_PROCESSORS.includes(rec.psp) && Number(input.amount) <= 0)
2821
2858
  throw new AmountRequiredError(rec.psp);
2822
2859
  // Nor is the agent's pair tied to the page by anything but the total the
2823
2860
  // page shows: without it the cardholder could approve one figure while the
@@ -3255,6 +3292,18 @@ export class VaultClient {
3255
3292
  response.headers = answer.headers;
3256
3293
  response.body = answer.body;
3257
3294
  }
3295
+ if (sbps) {
3296
+ // SB Payment Service: the paused <script> is answered the way SBPS answers it,
3297
+ // `<callback>({"tokenRes": ...})` under a script type, with the callback the paused URL named
3298
+ // and only a token payment-core's judge accepts for that URL. Anything else is not an answer to
3299
+ // hand the page, and the device may already have sent the card to SBPS.
3300
+ const answer = sbpsScriptAnswer(input.request.url, response);
3301
+ if (!answer)
3302
+ throw new PaymentOutcomeUnknownError(authorizationId, 'sbps_token_unconfirmed');
3303
+ response.status = answer.status;
3304
+ response.headers = answer.headers;
3305
+ response.body = answer.body;
3306
+ }
3258
3307
  if (secureAcceptance) {
3259
3308
  // CyberSource Secure Acceptance: the paused frame navigation is answered with CyberSource's own
3260
3309
  // reply page, byte for byte, with status 200 and its one content type, and only a page
@@ -3,7 +3,8 @@
3
3
  * processor's own page with a link (a redirect, or a page or frame location set by script) rather than a form post.
4
4
  *
5
5
  * Such an entry carries no card. The cardholder's device takes it over (mode hosted_form): it makes the processor's
6
- * own calls for the payment the link names, and the paused navigation gets this SDK's submitted_on_device notice.
6
+ * own calls for the payment the link names, and the paused navigation gets this SDK's submitted_on_device notice, or,
7
+ * for a Webpay shop Agentcard reviewed with its return page, that return page (transbank.ts transbankMerchantReturn).
7
8
  * A GET recognizer otherwise reads as a card request carried in the URL (Worldpay eProtect's registration), which
8
9
  * this build completes only for a grammar it checks, so a hosted page joins this table with the exact link
9
10
  * payment-core's resolveRecognizerForUrl admits for it, and nothing else: a URL the table does not admit is never
@@ -18,6 +18,11 @@
18
18
  * completed this payment on their own device, do not resubmit, confirm the
19
19
  * order with the merchant. This page says that, for a person and for an
20
20
  * agent, and nothing else.
21
+ *
22
+ * Webpay is the one hosted page whose merchant hears of a payment only from
23
+ * the buyer's browser, returning to the merchant's own page with Webpay's
24
+ * token. A paid Webpay entry is therefore sent to the reviewed shop's return
25
+ * page instead of this one (transbank.ts transbankMerchantReturn).
21
26
  */
22
27
  export interface HostedFormSubmittedPageInput {
23
28
  /** The approved authorization (`cauth_…`). */
@@ -18,6 +18,11 @@
18
18
  * completed this payment on their own device, do not resubmit, confirm the
19
19
  * order with the merchant. This page says that, for a person and for an
20
20
  * agent, and nothing else.
21
+ *
22
+ * Webpay is the one hosted page whose merchant hears of a payment only from
23
+ * the buyer's browser, returning to the merchant's own page with Webpay's
24
+ * token. A paid Webpay entry is therefore sent to the reviewed shop's return
25
+ * page instead of this one (transbank.ts transbankMerchantReturn).
21
26
  */
22
27
  /** The outcome word on the page, the header and the JSON: one spelling everywhere. */
23
28
  export const HOSTED_FORM_SUBMITTED_OUTCOME = 'submitted_on_device';
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Paytrail's card method (the Visa and Mastercard method on the payment wall most Finnish webshops send the buyer
3
+ * to), as this SDK reads it.
4
+ *
5
+ * The merchant's page, or Paytrail's own wall, posts a card-free entry top-level to
6
+ * https://services.paytrail.com/payments/<transaction>/click-to-pay/loading-and-redirect: seven fields Paytrail signed
7
+ * for the merchant, and no card and no amount. Paytrail answers with a loading page whose one form posts the same
8
+ * fields to .../click-to-pay/initialize-payment, which sends the browser to Payment Highway's card page
9
+ * (v1.api.paymenthighway.io, Paytrail's card platform) under a session of its own. The entry is the one request this
10
+ * SDK pauses: the cardholder's device repeats it over the end-to-end TLS relay and follows it to the card page
11
+ * (payment-core processors/paytrail.js). Everything after it in the agent's browser leads to the card the agent
12
+ * typed: the loading page's own post opens the card page, and on Payment Highway's host the card post (/card), the
13
+ * Click to Pay posts (/visa, /mastercard), the 3-D Secure step (/continue), the older card form's post and the card
14
+ * page's lookup of the typed card's first digits (GET .../acquirerData?bin=...). This SDK aborts every one of them,
15
+ * so a placeholder card never reaches Payment Highway.
16
+ *
17
+ * The hosts are payment-core's PAYTRAIL_HOSTS and PAYMENT_HIGHWAY_HOSTS; paytrail.test.mjs pins the lists together.
18
+ */
19
+ export declare const PAYTRAIL_PSP = "paytrail";
20
+ export declare const PAYTRAIL_HOSTS: readonly string[];
21
+ export declare const PAYMENT_HIGHWAY_HOSTS: readonly string[];
22
+ /** Whether this URL is on Paytrail's entry host (https, no credentials, any port, a trailing dot or not). */
23
+ export declare function isPaytrailHost(url: string): boolean;
24
+ /** Whether this URL is on Payment Highway's card page host (https, no credentials, any port, a trailing dot or not). */
25
+ export declare function isPaymentHighwayHost(url: string): boolean;
26
+ /**
27
+ * The only request that is the merchant's entry: a POST to the card method's loading-and-redirect route for one
28
+ * transaction, written exactly as the method's form action writes it, with the transaction in lowercase and no port,
29
+ * query, fragment or credentials (payment-core isPaytrailEntryUrl). The entry the SDK pauses; the gate aborts every
30
+ * other post of the card method.
31
+ */
32
+ export declare function isPaytrailEntry(url: string, method: string): boolean;
33
+ /**
34
+ * Whether a request on Paytrail's host belongs to the card method (a /click-to-pay/ route of a payment, in any letter
35
+ * case): the entry, the loading page's post to initialize-payment, which opens Payment Highway's card page for the
36
+ * transaction, and any other spelling of either. Another method's form (a bank's) is not.
37
+ */
38
+ export declare function isPaytrailCardMethodUrl(url: string): boolean;
39
+ /**
40
+ * The card page's card lookup: a GET on Payment Highway's host to .../acquirerData, which names the first digits of
41
+ * the card typed so far in its `bin` query. Any other GET there (the card page itself, its scripts and images) is not
42
+ * a card request.
43
+ */
44
+ export declare function isPaymentHighwayCardLookup(url: string, method: string): boolean;
45
+ /** Whether this build's registry serves Paytrail's entry, asked with an entry on a transaction no payment holds. */
46
+ export declare function isPaytrailServed(vault: {
47
+ isCardRequest(url: string, method?: string): boolean;
48
+ }): boolean;
49
+ /**
50
+ * Whether an adapter must hand this request to the pre-claim gates: it is on Paytrail's host or Payment Highway's, and
51
+ * this build's registry serves Paytrail's entry. The loading page's post and Payment Highway's card requests are not
52
+ * the entry, so the registry's card-request test does not name them; the CDP adapter still pauses them through the
53
+ * recognizer's host and its abort host, and attachToPlaywright's route predicate asks this, so both adapters show the
54
+ * gates every request to either host once Paytrail is armed.
55
+ */
56
+ export declare function isArmedPaytrailUrl(vault: {
57
+ isCardRequest(url: string, method?: string): boolean;
58
+ }, url: string): boolean;