@agent-cards/sdk 0.23.17 → 0.23.18
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 +9 -1
- package/README.md +5 -1
- package/dist/card-fields.generated.js +471 -4
- package/dist/client.d.ts +11 -0
- package/dist/client.js +93 -31
- package/dist/primer.generated.js +495 -28
- package/dist/stripe-checkout.generated.js +295 -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: 7140b6eee18986c07c3393c1a950467cd13a86c32f47813ab57af11c7cd3fa02
|
|
4
4
|
// src/deep-freeze.js
|
|
5
5
|
function deepFreeze(value) {
|
|
6
6
|
if (value && typeof value === "object" && !Object.isFrozen(value)) {
|
|
@@ -394,6 +394,114 @@ 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
|
+
},
|
|
397
505
|
// ── Verified tokenizers (plaintext PAN in the body) ───────────────────────
|
|
398
506
|
// Each entry below was checked against the PSP's own shipped browser SDK or a
|
|
399
507
|
// live probe, then run through resolveRecognizerForUrl with positive, sibling
|
|
@@ -1743,6 +1851,125 @@ var PROCESSOR_DEFINITIONS = deepFreeze([
|
|
|
1743
1851
|
// The frame's own Accept rides as it sent it; origin, referer and cookies never do.
|
|
1744
1852
|
passthroughHeaders: ["^accept$"],
|
|
1745
1853
|
jsonCardFields: [["cardData", "cardNumber"]]
|
|
1854
|
+
},
|
|
1855
|
+
{
|
|
1856
|
+
psp: "payrexx",
|
|
1857
|
+
// Payrexx Pay (Payrexx AG, Switzerland): the card frame every Payrexx payment page loads from
|
|
1858
|
+
// checkout.payrexx.com/?pspId=44&lang=<xx>, Payrexx's own card acceptance (`Native_PSP`; the page's
|
|
1859
|
+
// config names Credorax as its acquirer). The frame posts the number, name, expiry and code with one
|
|
1860
|
+
// axios XHR to its own URL, form encoded, no encryption, beside the merchant's instance, the provider
|
|
1861
|
+
// id, the page's total in minor units, its currency, and four flags that say whether Payrexx keeps the
|
|
1862
|
+
// card. payrexx.js holds the rule the pause decision reads: the exact frame URL and the first card
|
|
1863
|
+
// request's body key for key, with a 3-D Secure resend, a Click to Pay card, another provider's card,
|
|
1864
|
+
// a kept card and a hold each refused. A body with no card value (a wallet's own encryptedCard)
|
|
1865
|
+
// continues untouched. The route answers no browser origin, so the card leaves only through the
|
|
1866
|
+
// checkout relay. Payrexx Pay Plus sends its card to Stripe from Stripe's own frame, which the stripe
|
|
1867
|
+
// entry covers.
|
|
1868
|
+
// Ships dark: served only to a client that declares `payrexx_card_frame`, gated off for every org
|
|
1869
|
+
// until an operator lists one (`payrexx:<org>`), and autopilot never sends this request (autopilot.js
|
|
1870
|
+
// DEVICE_REPLAY_REFUSED_OPERATIONS). No sandbox host: Payrexx's test mode is chosen per merchant on
|
|
1871
|
+
// this same host, so the device's test-card rule cannot tell a test payment from a live one here.
|
|
1872
|
+
capability: "payrexx_card_frame",
|
|
1873
|
+
match: "checkout\\.payrexx\\.com/",
|
|
1874
|
+
hosts: ["^checkout\\.payrexx\\.com$"],
|
|
1875
|
+
encoding: "form",
|
|
1876
|
+
// axios's same-origin marker and its JSON Accept. Origin, Referer, cookies and the AWS WAF token never ride.
|
|
1877
|
+
passthroughHeaders: ["^x-requested-with$", "^accept$"],
|
|
1878
|
+
cardFields: ["card[number]"],
|
|
1879
|
+
passWithoutCard: "checkout\\.payrexx\\.com/"
|
|
1880
|
+
},
|
|
1881
|
+
{
|
|
1882
|
+
psp: "komoju",
|
|
1883
|
+
// KOMOJU's Hosted Fields (Japan): the card inputs live in KOMOJU's own frame on multipay.komoju.com,
|
|
1884
|
+
// which posts the card as JSON to https://komoju.com/api/v1/secure_tokens under the merchant's
|
|
1885
|
+
// publishable key (Basic authorization) to mint a 3-D Secure token before any payment. PAN@
|
|
1886
|
+
// payment_details.number, with month (MM), year (YY) and verification_value beside it; the body names
|
|
1887
|
+
// the session's amount and currency, which the token binds and the API reads (backend.js requestAmount).
|
|
1888
|
+
// komoju.js holds the rules: the pause decision reads the exact URL and the body byte for byte, a zero
|
|
1889
|
+
// amount (a card check KOMOJU keeps for a customer) refused, and the device reads those and the frame's
|
|
1890
|
+
// four headers before it writes the card. The issuer's 3-D Secure check runs after, in the
|
|
1891
|
+
// buyer's browser, and the payment that follows carries only the token's id to the session's /pay, which
|
|
1892
|
+
// continues untouched (passWithoutCard). The frame's sends without 3-D Secure (a card to the session's /pay
|
|
1893
|
+
// or to /api/v1/tokens) only ever carry the agent's placeholder, so they are refused before they leave.
|
|
1894
|
+
// KOMOJU's API answers any browser origin, so the card leaves the cardholder's device by a direct fetch.
|
|
1895
|
+
// Test and live share komoju.com: the key's prefix (pk_test_, pk_live_) names the environment, never the
|
|
1896
|
+
// host (no sandbox marker), and a test key takes only KOMOJU's test cards. Not here: KOMOJU's Hosted Page
|
|
1897
|
+
// (komoju.com/sessions/<id>), which posts the card under its session cookie and CSRF token.
|
|
1898
|
+
// KOMOJU answers a token it could not authenticate (ERRORED) inside HTTP 200, so its own judge reads every
|
|
1899
|
+
// answer by its token (komoju.js komojuAnswerOutcome), never the shared status rule. No operator lists an org
|
|
1900
|
+
// before the API's KOMOJU change lands: the device's request rule at create, the merchant pin per checkout
|
|
1901
|
+
// origin, the session read for a card kept on file and for the card method's fee and currency, and an
|
|
1902
|
+
// exception in the runtime's cancel rule, which reads a request that names an amount as a charge while a
|
|
1903
|
+
// KOMOJU token charges nothing until the payment that spends it.
|
|
1904
|
+
// Ships dark: served only to a client that declares `komoju_secure_token`, gated off for every org until
|
|
1905
|
+
// an operator lists `komoju:<org>`, and autopilot never sends it (autopilot.js
|
|
1906
|
+
// DEVICE_REPLAY_REFUSED_OPERATIONS). `(?![\w/.-])` ends the path for a consumer that tests `match`
|
|
1907
|
+
// unanchored.
|
|
1908
|
+
capability: "komoju_secure_token",
|
|
1909
|
+
match: "komoju\\.com/api/v1/(?:secure_tokens|tokens|sessions/[a-z0-9]{25}/pay)(?![\\w/.-])",
|
|
1910
|
+
hosts: ["^komoju\\.com$"],
|
|
1911
|
+
encoding: "json",
|
|
1912
|
+
// The frame's publishable key, its JSON Accept and its own marker. Origin, Referer and cookies never ride.
|
|
1913
|
+
passthroughHeaders: ["^authorization$", "^accept$", "^komoju-via$"],
|
|
1914
|
+
jsonCardFields: [["payment_details", "number"]],
|
|
1915
|
+
passWithoutCard: "komoju\\.com/api/v1/sessions/[a-z0-9]{25}/pay"
|
|
1916
|
+
},
|
|
1917
|
+
{
|
|
1918
|
+
psp: "paygent",
|
|
1919
|
+
// Paygent (Japan) token payments: the merchant's page hands its card fields to Paygent's own
|
|
1920
|
+
// PaygentToken.js (Japanese universities' Fundex donation forms, EC-CUBE and Welcart shops), which sends
|
|
1921
|
+
// them with one XHR to /n/token/request on token.paygent.co.jp (sandbox.paygent.co.jp in test), unencrypted,
|
|
1922
|
+
// as text/plain;charset=UTF-8, a CORS simple request Paygent's sandbox answers with
|
|
1923
|
+
// Access-Control-Allow-Origin * for any origin (the live host's answer is first read at an attended payment).
|
|
1924
|
+
// The answer is a single-use token the merchant's server charges later, after EMV 3-D Secure in the
|
|
1925
|
+
// buyer's browser; the request names no amount, so the agent's amount is the price the cardholder
|
|
1926
|
+
// approves. paygent.js holds the rule the pause decision and the device read: the exact URL, the
|
|
1927
|
+
// script's content type, and createToken's seven keys in its order and spelling with the token key
|
|
1928
|
+
// held to the host's environment; createCvcToken (a stored card's code) is refused. The script
|
|
1929
|
+
// abandons the XHR after 35 s; the preparation that moves the approval before the press comes with
|
|
1930
|
+
// the API's Paygent change, which sets `preparationRequired` with it.
|
|
1931
|
+
// Paygent's hosted payment page (link.paygent.co.jp) carries the card on other paths and is not paused.
|
|
1932
|
+
// Paygent answers a refused card inside HTTP 200, so its own judge reads every answer by its body
|
|
1933
|
+
// (paygent.js paygentAnswerOutcome), never the shared status rule. No operator lists an org before the
|
|
1934
|
+
// API's Paygent change lands: the amount the request does not name, the merchant pin per checkout
|
|
1935
|
+
// origin, the refusal of a second card request on one checkout, and the preparation for the 35 s window.
|
|
1936
|
+
// Ships dark: served only to a client that declares `paygent_token`, gated off for every org until an
|
|
1937
|
+
// operator lists one (`paygent:<org>`), and autopilot never sends this request (autopilot.js
|
|
1938
|
+
// DEVICE_REPLAY_REFUSED_OPERATIONS). The environment is pinned (S7): sandbox.paygent.co.jp only on
|
|
1939
|
+
// test rows and only with documented test cards.
|
|
1940
|
+
capability: "paygent_token",
|
|
1941
|
+
match: "(?:token|sandbox)\\.paygent\\.co\\.jp/n/token/request(?![\\w/.-])",
|
|
1942
|
+
hosts: ["^token\\.paygent\\.co\\.jp$", "^sandbox\\.paygent\\.co\\.jp$"],
|
|
1943
|
+
sandboxHosts: ["^sandbox\\.paygent\\.co\\.jp$"],
|
|
1944
|
+
hostEnvironmentPinned: true,
|
|
1945
|
+
// The body's shape is a form's (key=value pairs); its wire type stays the script's text/plain
|
|
1946
|
+
// (request-policy.js contentTypeFor). No header but the content type rides.
|
|
1947
|
+
encoding: "form",
|
|
1948
|
+
passthroughHeaders: [],
|
|
1949
|
+
cardFields: ["card_number"]
|
|
1950
|
+
},
|
|
1951
|
+
{
|
|
1952
|
+
psp: "pay_nl",
|
|
1953
|
+
// Pay.'s card token (pay.nl, the Dutch processor), as Weeztix's ticket shops send it from their card form
|
|
1954
|
+
// frame (cse-shop.openticket.tech) as soon as the four card fields are complete: one POST to
|
|
1955
|
+
// payment.pay.nl/v1/Payment/getCardToken/json, a fetch with a FormData body (multipart/form-data under
|
|
1956
|
+
// the browser's boundary), no other header, no credentials, unencrypted. The card sits in
|
|
1957
|
+
// payment[card][number], [name], [cvc], [expire_month] and [expire_year] beside the shop's Pay. sales
|
|
1958
|
+
// location (serviceId) and the request token its server minted. The request names no amount: the shop's
|
|
1959
|
+
// server charges the token Pay. answers for its own order total, so the agent's amount is the figure the
|
|
1960
|
+
// cardholder approves. pay-nl.js holds the rule the pause decision, the API and the device read: the
|
|
1961
|
+
// exact URL, the multipart type whose boundary is the body's own, and the frame's eight parts in its order
|
|
1962
|
+
// (multipart-form.js reads the form and refuses a file, an unknown part or a card part sent twice), and
|
|
1963
|
+
// a live request only for a sales location pinned for the checkout's own origin. Pay. serves no separate
|
|
1964
|
+
// test host, so no environment is pinned.
|
|
1965
|
+
// Ships dark: served only to a client that declares `pay_nl_card_token`, gated off for every org until
|
|
1966
|
+
// an operator lists one (`pay_nl:<org>`), and autopilot never sends this request (autopilot.js
|
|
1967
|
+
// DEVICE_REPLAY_REFUSED_OPERATIONS).
|
|
1968
|
+
capability: "pay_nl_card_token",
|
|
1969
|
+
match: "payment\\.pay\\.nl/v1/Payment/getCardToken/json",
|
|
1970
|
+
hosts: ["^payment\\.pay\\.nl$"],
|
|
1971
|
+
encoding: "multipart",
|
|
1972
|
+
passthroughHeaders: []
|
|
1746
1973
|
}
|
|
1747
1974
|
]);
|
|
1748
1975
|
var PSP_RECOGNIZERS = deepFreeze(PROCESSOR_DEFINITIONS.map(({ compose, encryptedCardFields, deviceSteps, deviceEncrypt, ...definition }) => definition));
|
|
@@ -1923,6 +2150,28 @@ var WIX_PAYMENTS_MERCHANT_PINS = /* @__PURE__ */ Object.freeze([
|
|
|
1923
2150
|
// src/paymongo.js
|
|
1924
2151
|
var PAYMONGO_CHECKOUT_HOST = "checkout.paymongo.com";
|
|
1925
2152
|
var ORIGIN = `https://${PAYMONGO_CHECKOUT_HOST}/`;
|
|
2153
|
+
// src/paygent.js
|
|
2154
|
+
var PAYGENT_PSP = "paygent";
|
|
2155
|
+
var PAYGENT_TOKEN_HOSTS = /* @__PURE__ */ Object.freeze({
|
|
2156
|
+
production: Object.freeze(["token.paygent.co.jp"]),
|
|
2157
|
+
sandbox: Object.freeze(["sandbox.paygent.co.jp"])
|
|
2158
|
+
});
|
|
2159
|
+
var PAYGENT_CONTENT_TYPE = "text/plain;charset=UTF-8";
|
|
2160
|
+
// src/multipart-form.js
|
|
2161
|
+
var BOUNDARY_CHARACTERS = "[A-Za-z0-9'+_.-]{1,70}";
|
|
2162
|
+
var BOUNDARY = new RegExp(`^${BOUNDARY_CHARACTERS}$`);
|
|
2163
|
+
var CONTENT_TYPE = new RegExp(`^multipart/form-data; ?boundary=(${BOUNDARY_CHARACTERS})$`, "i");
|
|
2164
|
+
function multipartBoundary(contentType) {
|
|
2165
|
+
const match = typeof contentType === "string" ? CONTENT_TYPE.exec(contentType) : null;
|
|
2166
|
+
return match ? match[1] : null;
|
|
2167
|
+
}
|
|
2168
|
+
// src/pay-nl.js
|
|
2169
|
+
var pin4 = (fields) => Object.freeze({ ...fields, origins: Object.freeze([...fields.origins]), serviceIds: Object.freeze([...fields.serviceIds]) });
|
|
2170
|
+
var PAY_NL_MERCHANT_PINS = /* @__PURE__ */ Object.freeze([
|
|
2171
|
+
pin4({ id: "weeztix", merchant: "Weeztix", origins: ["https://shop.weeztix.com"], serviceIds: ["SL-6399-2740"] })
|
|
2172
|
+
]);
|
|
2173
|
+
var ERROR_KEYS = /* @__PURE__ */ Object.freeze(["errorId", "errorTag", "errorMessage", "errorFieldName"]);
|
|
2174
|
+
var REQUEST_KEYS = /* @__PURE__ */ Object.freeze(["result", ...ERROR_KEYS]);
|
|
1926
2175
|
// src/cybersource-secure-acceptance.js
|
|
1927
2176
|
var SA_BODY_LIMIT = 32 * 1024;
|
|
1928
2177
|
var SA_REPLY_LIMIT = 64 * 1024;
|
|
@@ -2198,6 +2447,37 @@ var AUTH_FIELDS = Object.freeze([
|
|
|
2198
2447
|
"[auth]threeDSCompInd"
|
|
2199
2448
|
]);
|
|
2200
2449
|
var QUICKPAY_REFUSALS = Object.freeze(["quickpay_card_page", "quickpay_3ds_challenge", "quickpay_cancelled"]);
|
|
2450
|
+
// src/processors/przelewy24.js
|
|
2451
|
+
var PRZELEWY24_HOSTS = Object.freeze(["secure.przelewy24.pl", "sandbox.przelewy24.pl"]);
|
|
2452
|
+
var PRZELEWY24_SANDBOX_HOSTS = Object.freeze(["sandbox.przelewy24.pl"]);
|
|
2453
|
+
var PRZELEWY24_MERCHANTS = Object.freeze([]);
|
|
2454
|
+
var MAX_PAGE4 = 256 * 1024;
|
|
2455
|
+
var CURRENCIES3 = Object.freeze(["PLN", "EUR", "GBP", "USD", "CZK", "CHF", "DKK", "NOK", "SEK", "RON", "BGN", "HUF"]);
|
|
2456
|
+
var PRZELEWY24_AJAX_HEADERS = Object.freeze({ Accept: "*/*", "X-Requested-With": "XMLHttpRequest" });
|
|
2457
|
+
var MONTHS = Object.freeze(["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]);
|
|
2458
|
+
var CARD_TYPES = Object.freeze([
|
|
2459
|
+
{ type: "amex", lengths: [13, 15, 16], pattern: /^3[47]/ },
|
|
2460
|
+
{ type: "dinersclub", lengths: [14], pattern: /^(36|38|30[0-5])/ },
|
|
2461
|
+
{ type: "discover", lengths: [16], pattern: /^(6011|65|64[4-9]|622)/ },
|
|
2462
|
+
{ type: "jcb", lengths: [16], pattern: /^35(28|29|[3-8])/ },
|
|
2463
|
+
{ type: "laser", lengths: [16, 17, 18, 19], pattern: /^(6706|6771|6709)/ },
|
|
2464
|
+
{ type: "maestro", lengths: [12, 13, 14, 15, 16, 17, 18, 19], pattern: /^(5018|5020|5038|6304|6759|676[1-3])/ },
|
|
2465
|
+
{ type: "mastercard", lengths: [16], pattern: /^(5[1-5]|^2(?:2(?:2[1-9])|[3-6]|7(?:[01]|20)))/ },
|
|
2466
|
+
{ type: "unionpay", lengths: [16, 17, 18, 19], pattern: /^62/ },
|
|
2467
|
+
{ type: "visa", lengths: [16], pattern: /^4/ }
|
|
2468
|
+
]);
|
|
2469
|
+
var OWN_PAGES = Object.freeze(["/trnrequest/", "/trnresult/", "/saferpay/cardpaymentendpointresolver/", "/blik/", "/blikstatus/"]);
|
|
2470
|
+
var PRZELEWY24_REFUSALS = Object.freeze(["przelewy24_card_page", "przelewy24_3ds_challenge"]);
|
|
2471
|
+
// src/processors/transbank.js
|
|
2472
|
+
var TRANSBANK_HOSTS = Object.freeze(["webpay3g.transbank.cl", "webpay3gint.transbank.cl"]);
|
|
2473
|
+
var TRANSBANK_SANDBOX_HOSTS = Object.freeze(["webpay3gint.transbank.cl"]);
|
|
2474
|
+
var TOKEN = "[0-9a-f]{64}";
|
|
2475
|
+
var ENTRY_QUERY = new RegExp(`^\\?token_ws=(${TOKEN})$`);
|
|
2476
|
+
var TRANSBANK_MERCHANTS = Object.freeze([]);
|
|
2477
|
+
var MAX_PAGE5 = 64 * 1024;
|
|
2478
|
+
var JSON_HEADERS = Object.freeze({ "content-type": "application/json", accept: "application/json, text/plain, */*" });
|
|
2479
|
+
var FORM_HEADERS = Object.freeze({ "content-type": "application/x-www-form-urlencoded", accept: "application/json, text/plain, */*" });
|
|
2480
|
+
var TRANSBANK_REFUSALS = Object.freeze(["transbank_3ds_challenge", "transbank_aborted", "transbank_error"]);
|
|
2201
2481
|
// src/recognition.js
|
|
2202
2482
|
var PATTERN_WITHOUT_CARD_FIELDS = Object.freeze({
|
|
2203
2483
|
stripe: "api\\.stripe\\.com/v1/(payment_methods|tokens|setup_intents/seti_\\w+/confirm|payment_intents/pi_\\w+/confirm)"
|
|
@@ -2234,6 +2514,20 @@ function contentTypeFor(pspOrEntry, headers) {
|
|
|
2234
2514
|
}
|
|
2235
2515
|
return PADDLE_VGS_MEDIA_TYPE;
|
|
2236
2516
|
}
|
|
2517
|
+
if (rec.psp === PAYGENT_PSP) {
|
|
2518
|
+
const captured = Object.entries(headers || {}).find(([k]) => /^content-type$/i.test(k));
|
|
2519
|
+
if (!captured || typeof captured[1] !== "string" || !/^text\/plain; ?charset=utf-8$/i.test(captured[1].trim())) {
|
|
2520
|
+
throw new Error("Refusing to pay: Paygent's token script sends its card only as text/plain in UTF-8.");
|
|
2521
|
+
}
|
|
2522
|
+
return PAYGENT_CONTENT_TYPE;
|
|
2523
|
+
}
|
|
2524
|
+
if (rec.encoding === "multipart") {
|
|
2525
|
+
const captured = Object.entries(headers || {}).find(([k]) => /^content-type$/i.test(k));
|
|
2526
|
+
const value = captured && typeof captured[1] === "string" ? captured[1] : "";
|
|
2527
|
+
if (multipartBoundary(value) === null)
|
|
2528
|
+
throw new Error("Refusing to pay: this processor takes its card form only as multipart/form-data with its own boundary.");
|
|
2529
|
+
return value;
|
|
2530
|
+
}
|
|
2237
2531
|
const encoding = rec && rec.encoding === "form" ? "form" : "json";
|
|
2238
2532
|
const allowed = ALLOWED_MEDIA_TYPES[encoding];
|
|
2239
2533
|
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.18",
|
|
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",
|