@agent-cards/sdk 0.23.17 → 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.
- package/CHANGELOG.md +19 -1
- package/README.md +17 -4
- package/dist/aci.d.ts +0 -7
- package/dist/aci.js +0 -19
- package/dist/card-fields.generated.js +963 -33
- package/dist/client.d.ts +24 -1
- package/dist/client.js +198 -57
- package/dist/datatrans.d.ts +2 -2
- package/dist/datatrans.generated.js +16 -11
- package/dist/datatrans.js +2 -2
- package/dist/pelecard.generated.d.ts +2 -1
- package/dist/pelecard.generated.js +14 -5
- package/dist/primer.generated.js +987 -57
- package/dist/stripe-checkout.generated.js +491 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
// Generated from @agent-cards/payment-core. Do not edit.
|
|
3
|
-
// artifact-sha256:
|
|
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)) {
|
|
@@ -394,6 +394,212 @@ var PROCESSOR_DEFINITIONS = deepFreeze([
|
|
|
394
394
|
dedupe: ["merchant_id", "agreement_id", "order_id", "amount", "currency"]
|
|
395
395
|
}
|
|
396
396
|
},
|
|
397
|
+
{
|
|
398
|
+
psp: "przelewy24",
|
|
399
|
+
// Przelewy24's pay wall (PayPro SA), where most Polish shops send a buyer to pay by card, bank transfer or
|
|
400
|
+
// BLIK. The merchant's SERVER registers the transaction (the amount, its URLs and a SHA-384 sign) and sends
|
|
401
|
+
// the buyer's browser to secure.przelewy24.pl/trnRequest/{token}, a 302 the browser follows with a GET. That
|
|
402
|
+
// ENTRY is the token alone: no card, no amount and no merchant, all of which Przelewy24 bound to the token on
|
|
403
|
+
// its own server. Przelewy24 answers with its pay wall under a session of its own, whose card method opens a
|
|
404
|
+
// card form posting to /card/p24form/{token} in that session, so a card form rebuilt away from that session
|
|
405
|
+
// has no transaction to pay (processors/przelewy24.js). The paused request is therefore the entry, a
|
|
406
|
+
// Document navigation that carries no card: the cardholder's device repeats it over the end-to-end TLS relay,
|
|
407
|
+
// picks the card method and fills the card form Przelewy24 returns to it in that same session, and the
|
|
408
|
+
// runtime resolves the paused navigation with the hosted_form notice. Only the entry is matched, exactly
|
|
409
|
+
// (processors/przelewy24.js isPrzelewy24EntryUrl): the method links, the card post and Przelewy24's Saferpay
|
|
410
|
+
// card routes share the host, and the SDK keeps the agent's browser off them, so no placeholder card ever
|
|
411
|
+
// reaches Przelewy24. The entry names no merchant, so a live one is paid only from a checkout origin
|
|
412
|
+
// Agentcard reviewed (processors/przelewy24.js przelewy24MerchantRefusal). sandbox.przelewy24.pl runs the
|
|
413
|
+
// same pay wall for a merchant's test account: a live row reaches only the live host and a test row only the
|
|
414
|
+
// sandbox, which receives only documented test cards (device-replay.js). Dark: served only to a client that
|
|
415
|
+
// declares the capability, and gated off for every org the operator has not allowlisted.
|
|
416
|
+
capability: "przelewy24_hosted_payment_page",
|
|
417
|
+
match: "(?:secure|sandbox)\\.przelewy24\\.pl/trnRequest/[0-9A-F]{10}-[0-9A-F]{6}-[0-9A-F]{6}-[0-9A-F]{10}",
|
|
418
|
+
hosts: ["^secure\\.przelewy24\\.pl$", "^sandbox\\.przelewy24\\.pl$"],
|
|
419
|
+
sandboxHosts: ["^sandbox\\.przelewy24\\.pl$"],
|
|
420
|
+
hostEnvironmentPinned: true,
|
|
421
|
+
// `encoding` describes the card form the device fills on the pay wall, since the entry has no body. No
|
|
422
|
+
// captured header is ever replayed.
|
|
423
|
+
encoding: "form",
|
|
424
|
+
passthroughHeaders: [],
|
|
425
|
+
// The entry is the GET the merchant's redirect makes, and it carries no card: the card goes into the pay
|
|
426
|
+
// wall's own form on the device. A client that pauses a GET only for a processor whose request it checks
|
|
427
|
+
// (the checkout SDK's isRecognizerRequest) never pauses this one until it learns the entry.
|
|
428
|
+
request: { method: "GET", cardIn: "none", response: "html_page" },
|
|
429
|
+
mode: "hosted_form",
|
|
430
|
+
// Przelewy24 gives the merchant's server a reusable reference for the card of any payment on its pay wall
|
|
431
|
+
// (its card/info API: "a reference number that allows the card to be charged without CVV authorization"),
|
|
432
|
+
// which its card/charge API charges again without the cardholder, so the merchant keeps the card that pays,
|
|
433
|
+
// as on NMI. Only a card the person stored pays such a checkout: the API refuses a company's added card at
|
|
434
|
+
// create, card choice and lease (409 card_not_stored), and the approval says the merchant can keep it.
|
|
435
|
+
keepsCardOnFile: true,
|
|
436
|
+
hostedForm: {
|
|
437
|
+
// The card goes into the card form Przelewy24 returns to the device, never into the paused entry, which
|
|
438
|
+
// carries no body at all (processors/przelewy24.js checkPrzelewy24Entry). The device never posts a form
|
|
439
|
+
// of its own: the Vault's form-action policy leaves these hosts out.
|
|
440
|
+
cardIn: "processor_page",
|
|
441
|
+
// The entry's own rules (processors/przelewy24.js checkPrzelewy24Entry): the create runs them, and naming
|
|
442
|
+
// them here makes the cardholder's device run them again on the entry it is about to repeat (forms.js
|
|
443
|
+
// hostedFormTemplateRefusal).
|
|
444
|
+
policy: "przelewy24",
|
|
445
|
+
// The entry is a bodiless GET, so no form field is required of it.
|
|
446
|
+
required: [],
|
|
447
|
+
// The pay wall card form's own fields, which the device fills on that page (never in the entry).
|
|
448
|
+
card: { number: "sfpCardNumber", month: "sfpCardExpiryMonth", year: "sfpCardExpiryYear", cvc: "CVC" },
|
|
449
|
+
// The token in the entry's URL names one registered transaction; the policy reads it there
|
|
450
|
+
// (checkPrzelewy24Entry's dedupe), since no form field holds it.
|
|
451
|
+
dedupe: ["(token)"]
|
|
452
|
+
}
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
psp: "transbank_webpay",
|
|
456
|
+
// Transbank's Webpay Plus, the card payment form most Chilean shops send a buyer to. The merchant's SERVER
|
|
457
|
+
// creates the transaction (its commerce code, the amount and its return_url) and sends the buyer's browser to
|
|
458
|
+
// webpay3g.transbank.cl/webpayserver/initTransaction?token_ws=<token>, a GET (the official WooCommerce plugin's
|
|
459
|
+
// redirect). That ENTRY is the token alone: no card, no amount and no merchant, all of which Transbank bound to
|
|
460
|
+
// the token on its own server. Webpay answers with a page whose form submits the token to init_transaction.cgi,
|
|
461
|
+
// which binds it to a Webpay session once, and then takes the card in that session (processors/transbank.js).
|
|
462
|
+
// The paused request is therefore the entry, a Document navigation that carries no card: the cardholder's
|
|
463
|
+
// device repeats it over the end-to-end TLS relay, holds Webpay's own transaction to the approved payment, fills
|
|
464
|
+
// Webpay's card steps in that same session, and hands the browser back to the merchant's return_url. Only the
|
|
465
|
+
// entry is matched, exactly (processors/transbank.js isTransbankEntryUrl): init_transaction.cgi, the card
|
|
466
|
+
// services under /webpayserver/wswebpay/ and the card post (bp_control.cgi) share the host, and the SDK keeps
|
|
467
|
+
// the agent's browser off them, so no placeholder card ever reaches Webpay and the token stays unspent for the
|
|
468
|
+
// device. The entry names no merchant, so a live payment is made only when Webpay's own transaction names a
|
|
469
|
+
// reviewed commerce (TRANSBANK_MERCHANTS). webpay3gint.transbank.cl is Transbank's integration environment: a
|
|
470
|
+
// live row reaches only the live host and a test row only the integration host, which receives only documented
|
|
471
|
+
// test cards (device-replay.js). Dark: served only to a client that declares the capability, and gated off for
|
|
472
|
+
// every org the operator has not allowlisted.
|
|
473
|
+
capability: "transbank_webpay_hosted_payment_page",
|
|
474
|
+
match: "webpay3g(?:int)?\\.transbank\\.cl/webpayserver/initTransaction",
|
|
475
|
+
hosts: ["^webpay3g\\.transbank\\.cl$", "^webpay3gint\\.transbank\\.cl$"],
|
|
476
|
+
sandboxHosts: ["^webpay3gint\\.transbank\\.cl$"],
|
|
477
|
+
hostEnvironmentPinned: true,
|
|
478
|
+
// `encoding` describes the card post the device sends on Webpay's page, since the entry has no body. No
|
|
479
|
+
// captured header is ever replayed.
|
|
480
|
+
encoding: "form",
|
|
481
|
+
passthroughHeaders: [],
|
|
482
|
+
// The entry is the GET the merchant's redirect makes, and it carries no card: the card goes into Webpay's own
|
|
483
|
+
// steps on the device. A client that pauses a GET only for a processor whose request it checks never pauses
|
|
484
|
+
// this one until it learns the entry.
|
|
485
|
+
request: { method: "GET", cardIn: "none", response: "html_page" },
|
|
486
|
+
mode: "hosted_form",
|
|
487
|
+
hostedForm: {
|
|
488
|
+
// The card goes into Webpay's own steps on the device, never into the paused entry, which carries no body
|
|
489
|
+
// at all (processors/transbank.js checkTransbankEntry). The device never posts a form of its own: the
|
|
490
|
+
// Vault's form-action policy leaves these hosts out.
|
|
491
|
+
cardIn: "processor_page",
|
|
492
|
+
// The entry's own rules (processors/transbank.js checkTransbankEntry): the create runs them, and naming them
|
|
493
|
+
// here makes the cardholder's device run them again on the entry it is about to repeat (forms.js
|
|
494
|
+
// hostedFormTemplateRefusal).
|
|
495
|
+
policy: "transbank_webpay",
|
|
496
|
+
// The entry is a bodiless GET, so no form field is required of it.
|
|
497
|
+
required: [],
|
|
498
|
+
// Webpay's card post's own fields, which the device fills on Webpay's page (never in the entry).
|
|
499
|
+
card: { number: "TBK_NUMERO_TARJETA", month: "TBK_MES_EXPIRACION", year: "TBK_ANO_EXPIRACION", cvc: "TBK_CVV" },
|
|
500
|
+
// The token in the entry's URL names one transaction; the policy reads it there (checkTransbankEntry's
|
|
501
|
+
// dedupe), since no form field holds it.
|
|
502
|
+
dedupe: ["(token)"]
|
|
503
|
+
}
|
|
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
|
+
},
|
|
397
603
|
// ── Verified tokenizers (plaintext PAN in the body) ───────────────────────
|
|
398
604
|
// Each entry below was checked against the PSP's own shipped browser SDK or a
|
|
399
605
|
// live probe, then run through resolveRecognizerForUrl with positive, sibling
|
|
@@ -1743,6 +1949,190 @@ var PROCESSOR_DEFINITIONS = deepFreeze([
|
|
|
1743
1949
|
// The frame's own Accept rides as it sent it; origin, referer and cookies never do.
|
|
1744
1950
|
passthroughHeaders: ["^accept$"],
|
|
1745
1951
|
jsonCardFields: [["cardData", "cardNumber"]]
|
|
1952
|
+
},
|
|
1953
|
+
{
|
|
1954
|
+
psp: "payrexx",
|
|
1955
|
+
// Payrexx Pay (Payrexx AG, Switzerland): the card frame every Payrexx payment page loads from
|
|
1956
|
+
// checkout.payrexx.com/?pspId=44&lang=<xx>, Payrexx's own card acceptance (`Native_PSP`; the page's
|
|
1957
|
+
// config names Credorax as its acquirer). The frame posts the number, name, expiry and code with one
|
|
1958
|
+
// axios XHR to its own URL, form encoded, no encryption, beside the merchant's instance, the provider
|
|
1959
|
+
// id, the page's total in minor units, its currency, and four flags that say whether Payrexx keeps the
|
|
1960
|
+
// card. payrexx.js holds the rule the pause decision reads: the exact frame URL and the first card
|
|
1961
|
+
// request's body key for key, with a 3-D Secure resend, a Click to Pay card, another provider's card,
|
|
1962
|
+
// a kept card and a hold each refused. A body with no card value (a wallet's own encryptedCard)
|
|
1963
|
+
// continues untouched. The route answers no browser origin, so the card leaves only through the
|
|
1964
|
+
// checkout relay. Payrexx Pay Plus sends its card to Stripe from Stripe's own frame, which the stripe
|
|
1965
|
+
// entry covers.
|
|
1966
|
+
// Ships dark: served only to a client that declares `payrexx_card_frame`, gated off for every org
|
|
1967
|
+
// until an operator lists one (`payrexx:<org>`), and autopilot never sends this request (autopilot.js
|
|
1968
|
+
// DEVICE_REPLAY_REFUSED_OPERATIONS). No sandbox host: Payrexx's test mode is chosen per merchant on
|
|
1969
|
+
// this same host, so the device's test-card rule cannot tell a test payment from a live one here.
|
|
1970
|
+
capability: "payrexx_card_frame",
|
|
1971
|
+
match: "checkout\\.payrexx\\.com/",
|
|
1972
|
+
hosts: ["^checkout\\.payrexx\\.com$"],
|
|
1973
|
+
encoding: "form",
|
|
1974
|
+
// axios's same-origin marker and its JSON Accept. Origin, Referer, cookies and the AWS WAF token never ride.
|
|
1975
|
+
passthroughHeaders: ["^x-requested-with$", "^accept$"],
|
|
1976
|
+
cardFields: ["card[number]"],
|
|
1977
|
+
passWithoutCard: "checkout\\.payrexx\\.com/"
|
|
1978
|
+
},
|
|
1979
|
+
{
|
|
1980
|
+
psp: "komoju",
|
|
1981
|
+
// KOMOJU's Hosted Fields (Japan): the card inputs live in KOMOJU's own frame on multipay.komoju.com,
|
|
1982
|
+
// which posts the card as JSON to https://komoju.com/api/v1/secure_tokens under the merchant's
|
|
1983
|
+
// publishable key (Basic authorization) to mint a 3-D Secure token before any payment. PAN@
|
|
1984
|
+
// payment_details.number, with month (MM), year (YY) and verification_value beside it; the body names
|
|
1985
|
+
// the session's amount and currency, which the token binds and the API reads (backend.js requestAmount).
|
|
1986
|
+
// komoju.js holds the rules: the pause decision reads the exact URL and the body byte for byte, a zero
|
|
1987
|
+
// amount (a card check KOMOJU keeps for a customer) refused, and the device reads those and the frame's
|
|
1988
|
+
// four headers before it writes the card. The issuer's 3-D Secure check runs after, in the
|
|
1989
|
+
// buyer's browser, and the payment that follows carries only the token's id to the session's /pay, which
|
|
1990
|
+
// continues untouched (passWithoutCard). The frame's sends without 3-D Secure (a card to the session's /pay
|
|
1991
|
+
// or to /api/v1/tokens) only ever carry the agent's placeholder, so they are refused before they leave.
|
|
1992
|
+
// KOMOJU's API answers any browser origin, so the card leaves the cardholder's device by a direct fetch.
|
|
1993
|
+
// Test and live share komoju.com: the key's prefix (pk_test_, pk_live_) names the environment, never the
|
|
1994
|
+
// host (no sandbox marker), and a test key takes only KOMOJU's test cards. Not here: KOMOJU's Hosted Page
|
|
1995
|
+
// (komoju.com/sessions/<id>), which posts the card under its session cookie and CSRF token.
|
|
1996
|
+
// KOMOJU answers a token it could not authenticate (ERRORED) inside HTTP 200, so its own judge reads every
|
|
1997
|
+
// answer by its token (komoju.js komojuAnswerOutcome), never the shared status rule. No operator lists an org
|
|
1998
|
+
// before the API's KOMOJU change lands: the device's request rule at create, the merchant pin per checkout
|
|
1999
|
+
// origin, the session read for a card kept on file and for the card method's fee and currency, and an
|
|
2000
|
+
// exception in the runtime's cancel rule, which reads a request that names an amount as a charge while a
|
|
2001
|
+
// KOMOJU token charges nothing until the payment that spends it.
|
|
2002
|
+
// Ships dark: served only to a client that declares `komoju_secure_token`, gated off for every org until
|
|
2003
|
+
// an operator lists `komoju:<org>`, and autopilot never sends it (autopilot.js
|
|
2004
|
+
// DEVICE_REPLAY_REFUSED_OPERATIONS). `(?![\w/.-])` ends the path for a consumer that tests `match`
|
|
2005
|
+
// unanchored.
|
|
2006
|
+
capability: "komoju_secure_token",
|
|
2007
|
+
match: "komoju\\.com/api/v1/(?:secure_tokens|tokens|sessions/[a-z0-9]{25}/pay)(?![\\w/.-])",
|
|
2008
|
+
hosts: ["^komoju\\.com$"],
|
|
2009
|
+
encoding: "json",
|
|
2010
|
+
// The frame's publishable key, its JSON Accept and its own marker. Origin, Referer and cookies never ride.
|
|
2011
|
+
passthroughHeaders: ["^authorization$", "^accept$", "^komoju-via$"],
|
|
2012
|
+
jsonCardFields: [["payment_details", "number"]],
|
|
2013
|
+
passWithoutCard: "komoju\\.com/api/v1/sessions/[a-z0-9]{25}/pay"
|
|
2014
|
+
},
|
|
2015
|
+
{
|
|
2016
|
+
psp: "paygent",
|
|
2017
|
+
// Paygent (Japan) token payments: the merchant's page hands its card fields to Paygent's own
|
|
2018
|
+
// PaygentToken.js (Japanese universities' Fundex donation forms, EC-CUBE and Welcart shops), which sends
|
|
2019
|
+
// them with one XHR to /n/token/request on token.paygent.co.jp (sandbox.paygent.co.jp in test), unencrypted,
|
|
2020
|
+
// as text/plain;charset=UTF-8, a CORS simple request Paygent's sandbox answers with
|
|
2021
|
+
// Access-Control-Allow-Origin * for any origin (the live host's answer is first read at an attended payment).
|
|
2022
|
+
// The answer is a single-use token the merchant's server charges later, after EMV 3-D Secure in the
|
|
2023
|
+
// buyer's browser; the request names no amount, so the agent's amount is the price the cardholder
|
|
2024
|
+
// approves. paygent.js holds the rule the pause decision and the device read: the exact URL, the
|
|
2025
|
+
// script's content type, and createToken's seven keys in its order and spelling with the token key
|
|
2026
|
+
// held to the host's environment; createCvcToken (a stored card's code) is refused. The script
|
|
2027
|
+
// abandons the XHR after 35 s; the preparation that moves the approval before the press comes with
|
|
2028
|
+
// the API's Paygent change, which sets `preparationRequired` with it.
|
|
2029
|
+
// Paygent's hosted payment page (link.paygent.co.jp) carries the card on other paths and is not paused.
|
|
2030
|
+
// Paygent answers a refused card inside HTTP 200, so its own judge reads every answer by its body
|
|
2031
|
+
// (paygent.js paygentAnswerOutcome), never the shared status rule. No operator lists an org before the
|
|
2032
|
+
// API's Paygent change lands: the amount the request does not name, the merchant pin per checkout
|
|
2033
|
+
// origin, the refusal of a second card request on one checkout, and the preparation for the 35 s window.
|
|
2034
|
+
// Ships dark: served only to a client that declares `paygent_token`, gated off for every org until an
|
|
2035
|
+
// operator lists one (`paygent:<org>`), and autopilot never sends this request (autopilot.js
|
|
2036
|
+
// DEVICE_REPLAY_REFUSED_OPERATIONS). The environment is pinned (S7): sandbox.paygent.co.jp only on
|
|
2037
|
+
// test rows and only with documented test cards.
|
|
2038
|
+
capability: "paygent_token",
|
|
2039
|
+
match: "(?:token|sandbox)\\.paygent\\.co\\.jp/n/token/request(?![\\w/.-])",
|
|
2040
|
+
hosts: ["^token\\.paygent\\.co\\.jp$", "^sandbox\\.paygent\\.co\\.jp$"],
|
|
2041
|
+
sandboxHosts: ["^sandbox\\.paygent\\.co\\.jp$"],
|
|
2042
|
+
hostEnvironmentPinned: true,
|
|
2043
|
+
// The body's shape is a form's (key=value pairs); its wire type stays the script's text/plain
|
|
2044
|
+
// (request-policy.js contentTypeFor). No header but the content type rides.
|
|
2045
|
+
encoding: "form",
|
|
2046
|
+
passthroughHeaders: [],
|
|
2047
|
+
cardFields: ["card_number"]
|
|
2048
|
+
},
|
|
2049
|
+
{
|
|
2050
|
+
psp: "pay_nl",
|
|
2051
|
+
// Pay.'s card token (pay.nl, the Dutch processor), as Weeztix's ticket shops send it from their card form
|
|
2052
|
+
// frame (cse-shop.openticket.tech) as soon as the four card fields are complete: one POST to
|
|
2053
|
+
// payment.pay.nl/v1/Payment/getCardToken/json, a fetch with a FormData body (multipart/form-data under
|
|
2054
|
+
// the browser's boundary), no other header, no credentials, unencrypted. The card sits in
|
|
2055
|
+
// payment[card][number], [name], [cvc], [expire_month] and [expire_year] beside the shop's Pay. sales
|
|
2056
|
+
// location (serviceId) and the request token its server minted. The request names no amount: the shop's
|
|
2057
|
+
// server charges the token Pay. answers for its own order total, so the agent's amount is the figure the
|
|
2058
|
+
// cardholder approves. pay-nl.js holds the rule the pause decision, the API and the device read: the
|
|
2059
|
+
// exact URL, the multipart type whose boundary is the body's own, and the frame's eight parts in its order
|
|
2060
|
+
// (multipart-form.js reads the form and refuses a file, an unknown part or a card part sent twice), and
|
|
2061
|
+
// a live request only for a sales location pinned for the checkout's own origin. Pay. serves no separate
|
|
2062
|
+
// test host, so no environment is pinned.
|
|
2063
|
+
// Ships dark: served only to a client that declares `pay_nl_card_token`, gated off for every org until
|
|
2064
|
+
// an operator lists one (`pay_nl:<org>`), and autopilot never sends this request (autopilot.js
|
|
2065
|
+
// DEVICE_REPLAY_REFUSED_OPERATIONS).
|
|
2066
|
+
capability: "pay_nl_card_token",
|
|
2067
|
+
match: "payment\\.pay\\.nl/v1/Payment/getCardToken/json",
|
|
2068
|
+
hosts: ["^payment\\.pay\\.nl$"],
|
|
2069
|
+
encoding: "multipart",
|
|
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" }
|
|
1746
2136
|
}
|
|
1747
2137
|
]);
|
|
1748
2138
|
var PSP_RECOGNIZERS = deepFreeze(PROCESSOR_DEFINITIONS.map(({ compose, encryptedCardFields, deviceSteps, deviceEncrypt, ...definition }) => definition));
|
|
@@ -1923,6 +2313,28 @@ var WIX_PAYMENTS_MERCHANT_PINS = /* @__PURE__ */ Object.freeze([
|
|
|
1923
2313
|
// src/paymongo.js
|
|
1924
2314
|
var PAYMONGO_CHECKOUT_HOST = "checkout.paymongo.com";
|
|
1925
2315
|
var ORIGIN = `https://${PAYMONGO_CHECKOUT_HOST}/`;
|
|
2316
|
+
// src/paygent.js
|
|
2317
|
+
var PAYGENT_PSP = "paygent";
|
|
2318
|
+
var PAYGENT_TOKEN_HOSTS = /* @__PURE__ */ Object.freeze({
|
|
2319
|
+
production: Object.freeze(["token.paygent.co.jp"]),
|
|
2320
|
+
sandbox: Object.freeze(["sandbox.paygent.co.jp"])
|
|
2321
|
+
});
|
|
2322
|
+
var PAYGENT_CONTENT_TYPE = "text/plain;charset=UTF-8";
|
|
2323
|
+
// src/multipart-form.js
|
|
2324
|
+
var BOUNDARY_CHARACTERS = "[A-Za-z0-9'+_.-]{1,70}";
|
|
2325
|
+
var BOUNDARY = new RegExp(`^${BOUNDARY_CHARACTERS}$`);
|
|
2326
|
+
var CONTENT_TYPE = new RegExp(`^multipart/form-data; ?boundary=(${BOUNDARY_CHARACTERS})$`, "i");
|
|
2327
|
+
function multipartBoundary(contentType) {
|
|
2328
|
+
const match = typeof contentType === "string" ? CONTENT_TYPE.exec(contentType) : null;
|
|
2329
|
+
return match ? match[1] : null;
|
|
2330
|
+
}
|
|
2331
|
+
// src/pay-nl.js
|
|
2332
|
+
var pin4 = (fields) => Object.freeze({ ...fields, origins: Object.freeze([...fields.origins]), serviceIds: Object.freeze([...fields.serviceIds]) });
|
|
2333
|
+
var PAY_NL_MERCHANT_PINS = /* @__PURE__ */ Object.freeze([
|
|
2334
|
+
pin4({ id: "weeztix", merchant: "Weeztix", origins: ["https://shop.weeztix.com"], serviceIds: ["SL-6399-2740"] })
|
|
2335
|
+
]);
|
|
2336
|
+
var ERROR_KEYS = /* @__PURE__ */ Object.freeze(["errorId", "errorTag", "errorMessage", "errorFieldName"]);
|
|
2337
|
+
var REQUEST_KEYS = /* @__PURE__ */ Object.freeze(["result", ...ERROR_KEYS]);
|
|
1926
2338
|
// src/cybersource-secure-acceptance.js
|
|
1927
2339
|
var SA_BODY_LIMIT = 32 * 1024;
|
|
1928
2340
|
var SA_REPLY_LIMIT = 64 * 1024;
|
|
@@ -2198,6 +2610,70 @@ var AUTH_FIELDS = Object.freeze([
|
|
|
2198
2610
|
"[auth]threeDSCompInd"
|
|
2199
2611
|
]);
|
|
2200
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"]);
|
|
2625
|
+
// src/processors/przelewy24.js
|
|
2626
|
+
var PRZELEWY24_HOSTS = Object.freeze(["secure.przelewy24.pl", "sandbox.przelewy24.pl"]);
|
|
2627
|
+
var PRZELEWY24_SANDBOX_HOSTS = Object.freeze(["sandbox.przelewy24.pl"]);
|
|
2628
|
+
var PRZELEWY24_MERCHANTS = Object.freeze([]);
|
|
2629
|
+
var MAX_PAGE4 = 256 * 1024;
|
|
2630
|
+
var CURRENCIES3 = Object.freeze(["PLN", "EUR", "GBP", "USD", "CZK", "CHF", "DKK", "NOK", "SEK", "RON", "BGN", "HUF"]);
|
|
2631
|
+
var PRZELEWY24_AJAX_HEADERS = Object.freeze({ Accept: "*/*", "X-Requested-With": "XMLHttpRequest" });
|
|
2632
|
+
var MONTHS = Object.freeze(["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]);
|
|
2633
|
+
var CARD_TYPES = Object.freeze([
|
|
2634
|
+
{ type: "amex", lengths: [13, 15, 16], pattern: /^3[47]/ },
|
|
2635
|
+
{ type: "dinersclub", lengths: [14], pattern: /^(36|38|30[0-5])/ },
|
|
2636
|
+
{ type: "discover", lengths: [16], pattern: /^(6011|65|64[4-9]|622)/ },
|
|
2637
|
+
{ type: "jcb", lengths: [16], pattern: /^35(28|29|[3-8])/ },
|
|
2638
|
+
{ type: "laser", lengths: [16, 17, 18, 19], pattern: /^(6706|6771|6709)/ },
|
|
2639
|
+
{ type: "maestro", lengths: [12, 13, 14, 15, 16, 17, 18, 19], pattern: /^(5018|5020|5038|6304|6759|676[1-3])/ },
|
|
2640
|
+
{ type: "mastercard", lengths: [16], pattern: /^(5[1-5]|^2(?:2(?:2[1-9])|[3-6]|7(?:[01]|20)))/ },
|
|
2641
|
+
{ type: "unionpay", lengths: [16, 17, 18, 19], pattern: /^62/ },
|
|
2642
|
+
{ type: "visa", lengths: [16], pattern: /^4/ }
|
|
2643
|
+
]);
|
|
2644
|
+
var OWN_PAGES = Object.freeze(["/trnrequest/", "/trnresult/", "/saferpay/cardpaymentendpointresolver/", "/blik/", "/blikstatus/"]);
|
|
2645
|
+
var PRZELEWY24_REFUSALS = Object.freeze(["przelewy24_card_page", "przelewy24_3ds_challenge"]);
|
|
2646
|
+
// src/processors/transbank.js
|
|
2647
|
+
var TRANSBANK_HOSTS = Object.freeze(["webpay3g.transbank.cl", "webpay3gint.transbank.cl"]);
|
|
2648
|
+
var TRANSBANK_SANDBOX_HOSTS = Object.freeze(["webpay3gint.transbank.cl"]);
|
|
2649
|
+
var TOKEN = "[0-9a-f]{64}";
|
|
2650
|
+
var ENTRY_QUERY = new RegExp(`^\\?token_ws=(${TOKEN})$`);
|
|
2651
|
+
var TRANSBANK_MERCHANTS = Object.freeze([]);
|
|
2652
|
+
var MAX_PAGE5 = 64 * 1024;
|
|
2653
|
+
var JSON_HEADERS = Object.freeze({ "content-type": "application/json", accept: "application/json, text/plain, */*" });
|
|
2654
|
+
var FORM_HEADERS = Object.freeze({ "content-type": "application/x-www-form-urlencoded", accept: "application/json, text/plain, */*" });
|
|
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"]);
|
|
2201
2677
|
// src/recognition.js
|
|
2202
2678
|
var PATTERN_WITHOUT_CARD_FIELDS = Object.freeze({
|
|
2203
2679
|
stripe: "api\\.stripe\\.com/v1/(payment_methods|tokens|setup_intents/seti_\\w+/confirm|payment_intents/pi_\\w+/confirm)"
|
|
@@ -2234,6 +2710,20 @@ function contentTypeFor(pspOrEntry, headers) {
|
|
|
2234
2710
|
}
|
|
2235
2711
|
return PADDLE_VGS_MEDIA_TYPE;
|
|
2236
2712
|
}
|
|
2713
|
+
if (rec.psp === PAYGENT_PSP) {
|
|
2714
|
+
const captured = Object.entries(headers || {}).find(([k]) => /^content-type$/i.test(k));
|
|
2715
|
+
if (!captured || typeof captured[1] !== "string" || !/^text\/plain; ?charset=utf-8$/i.test(captured[1].trim())) {
|
|
2716
|
+
throw new Error("Refusing to pay: Paygent's token script sends its card only as text/plain in UTF-8.");
|
|
2717
|
+
}
|
|
2718
|
+
return PAYGENT_CONTENT_TYPE;
|
|
2719
|
+
}
|
|
2720
|
+
if (rec.encoding === "multipart") {
|
|
2721
|
+
const captured = Object.entries(headers || {}).find(([k]) => /^content-type$/i.test(k));
|
|
2722
|
+
const value = captured && typeof captured[1] === "string" ? captured[1] : "";
|
|
2723
|
+
if (multipartBoundary(value) === null)
|
|
2724
|
+
throw new Error("Refusing to pay: this processor takes its card form only as multipart/form-data with its own boundary.");
|
|
2725
|
+
return value;
|
|
2726
|
+
}
|
|
2237
2727
|
const encoding = rec && rec.encoding === "form" ? "form" : "json";
|
|
2238
2728
|
const allowed = ALLOWED_MEDIA_TYPES[encoding];
|
|
2239
2729
|
const fallback = allowed[0];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-cards/sdk",
|
|
3
|
-
"version": "0.23.
|
|
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",
|