@agent-cards/sdk 0.23.24 → 0.23.26
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 +14 -0
- package/README.md +34 -1
- package/dist/agent-amount.generated.js +1 -1
- package/dist/barion.d.ts +44 -0
- package/dist/barion.js +84 -0
- package/dist/capabilities.generated.js +1 -1
- package/dist/card-fields.generated.js +209 -119
- package/dist/cdp.js +4 -0
- package/dist/client.d.ts +42 -0
- package/dist/client.js +45 -1
- package/dist/hosted-entry.js +2 -0
- package/dist/pre-claim.d.ts +1 -0
- package/dist/pre-claim.js +18 -1
- package/dist/primer.generated.js +224 -134
- package/dist/stripe-checkout.generated.js +76 -46
- package/dist/tap-payments.generated.d.ts +10 -9
- package/dist/tap-payments.generated.js +28 -43
- package/dist/tokenex-iframe.generated.d.ts +18 -6
- package/dist/tokenex-iframe.generated.js +3 -3
- package/package.json +2 -2
package/dist/cdp.js
CHANGED
|
@@ -25,6 +25,7 @@ import { isArmedEkashuUrl } from './ekashu.js';
|
|
|
25
25
|
import { isArmedTransbankUrl, transbankMerchantReturn, transbankMerchantReturnAnswer } from './transbank.js';
|
|
26
26
|
import { isArmedRedsysUrl } from './redsys.js';
|
|
27
27
|
import { isArmedPrzelewy24Url } from './przelewy24.js';
|
|
28
|
+
import { isArmedBarionUrl } from './barion.js';
|
|
28
29
|
import { isArmedQuickpayUrl } from './quickpay.js';
|
|
29
30
|
import { COMGATE_CARD_PATTERNS, isArmedComgateUrl, servesComgate } from './comgate.js';
|
|
30
31
|
import { isArmedEximbayUrl } from './eximbay.js';
|
|
@@ -3980,6 +3981,9 @@ export async function attachToPlaywright(page, opts) {
|
|
|
3980
3981
|
// the hosts: the card method's post, the card form's post and the Saferpay resolver reach the Przelewy24
|
|
3981
3982
|
// gate and fail.
|
|
3982
3983
|
|| isArmedPrzelewy24Url(opts.vault, url.toString())
|
|
3984
|
+
// Every request to Barion's gateway hosts once its entry is served (barion.ts), as attachToCdp arms the hosts:
|
|
3985
|
+
// the gateway's email check, card posts and 3-D Secure post reach the Barion gate and fail.
|
|
3986
|
+
|| isArmedBarionUrl(opts.vault, url.toString())
|
|
3983
3987
|
// Every request to an NMI host whose entry is served (ekashu.ts), as attachToCdp arms the
|
|
3984
3988
|
// host: the card page's post and its 3-D Secure calls reach the NMI gate and fail.
|
|
3985
3989
|
|| isArmedEkashuUrl(opts.vault, url.toString())
|
package/dist/client.d.ts
CHANGED
|
@@ -499,6 +499,48 @@ export declare const SUPPORTED_REGISTRY_FEATURES: readonly string[];
|
|
|
499
499
|
* amount, so the agent's pair, above zero, is the one the cardholder approves.
|
|
500
500
|
* Served on the same terms: only to a build that lists it, for a company Agentcard turned APS on for.
|
|
501
501
|
*
|
|
502
|
+
* `nexi_checkout_pay`: the card payment Nexi Checkout's card frame (checkout.dibspayment.eu/v1/, formerly Nets
|
|
503
|
+
* Easy) posts as JSON to its own pay endpoint, https://checkout.dibspayment.eu/api/v1/pay (the test host for a
|
|
504
|
+
* test row), under the merchant's checkout key and the payment's id. This build pauses only the card form's own
|
|
505
|
+
* body at that exact URL ("save my card", "remember me" and a card fee are refused at the pause, and the frame's
|
|
506
|
+
* card lookup while the number is typed continues untouched); the cardholder's device reads Nexi's own record of the
|
|
507
|
+
* payment and sends the card through the checkout relay, and the frame gets Nexi's answer as payment-core's judge
|
|
508
|
+
* rebuilt it: the payment done, or Nexi's 3-D Secure step, which the frame then runs in the agent's browser. The
|
|
509
|
+
* body names the payment's amount in minor units but not its currency, so the agent's pair, above zero, is the one
|
|
510
|
+
* the cardholder approves, and the API holds its amount to the body's. Served on the same terms: only to a build
|
|
511
|
+
* that lists it, for a company Agentcard turned Nexi Checkout on for.
|
|
512
|
+
*
|
|
513
|
+
* `barion_hosted_payment_page`: Barion's Smart Gateway, whose card-free link
|
|
514
|
+
* (secure.barion.com/Pay?Id=<payment id>, a plain GET the merchant's redirect or script sends
|
|
515
|
+
* the buyer to) this build pauses for the cardholder's device by its exact link (hosted-entry.ts),
|
|
516
|
+
* and whose email check, card posts and 3-D Secure post this build never lets the agent's browser
|
|
517
|
+
* send (pre-claim.ts, barion.ts). Served on the same terms as Przelewy24's: only to a build that
|
|
518
|
+
* lists it, for a company Agentcard turned Barion on for.
|
|
519
|
+
*
|
|
520
|
+
* `paymob_checkout_pay`: the card payment Paymob's own checkout sends, from Unified Checkout
|
|
521
|
+
* (<country>.checkout.paymob.com) or from the Pixel card frame a merchant's page embeds, as JSON to
|
|
522
|
+
* https://<accept|uae|ksa|oman>.paymob.com/api/acceptance/payments/pay. This build pauses only the
|
|
523
|
+
* card form's own payment at that exact URL: a card Paymob saved, a payment that keeps the card,
|
|
524
|
+
* pays in installments, splits, converts or names a Paymob account, and a payment key that enrolls
|
|
525
|
+
* a subscription or names no amount are refused at the pause, and another method's payment with no
|
|
526
|
+
* card (a wallet, Apple Pay, cash) continues to Paymob untouched. The cardholder's device sends the
|
|
527
|
+
* payment to Paymob itself with the real card, and the checkout gets Paymob's answer as payment-core's
|
|
528
|
+
* judge rebuilt it. The payment key names the amount and currency, so an agent pair is optional and
|
|
529
|
+
* the API holds one to the key's figure. Served on the same terms: only to a build that lists it, for
|
|
530
|
+
* a company Agentcard turned Paymob on for.
|
|
531
|
+
*
|
|
532
|
+
* `payu_latam_webcheckout_card`: the card submit PayU Latam's WebCheckout page posts to
|
|
533
|
+
* checkout.payulatam.com/ppp-web-gateway-payu/checkout/submit/<country>/credit_card/<key>
|
|
534
|
+
* (sandbox.checkout.payulatam.com on PayU's test platform). This build pauses only the card form's
|
|
535
|
+
* own submit at that exact URL (a ticked save-my-card box, a card PayU saved, installments and a
|
|
536
|
+
* test order on the live host are refused at the pause); the cardholder's device writes the real
|
|
537
|
+
* card into the paused body and sends it to PayU itself, and the page gets PayU's answer as
|
|
538
|
+
* payment-core's judge reads it. The page's BIN lookup (checkout/card_info/) carries the typed
|
|
539
|
+
* placeholder and continues, as the page needs its answer to fill the card's facts. The submit's
|
|
540
|
+
* copy of the order is the browser's, so the agent's pair, above zero, is the one the cardholder
|
|
541
|
+
* approves, which the API holds to the order PayU reads back. Served on the same terms: only to a
|
|
542
|
+
* build that lists it, for a company Agentcard turned PayU Latam on for.
|
|
543
|
+
*
|
|
502
544
|
* The list itself is capabilities.json, sorted, one per line (scripts/generate-capabilities.mjs).
|
|
503
545
|
*/
|
|
504
546
|
export declare const SUPPORTED_CAPABILITIES: readonly string[];
|
package/dist/client.js
CHANGED
|
@@ -492,6 +492,48 @@ export const SUPPORTED_REGISTRY_FEATURES = ['card_fields', 'checkout_sessions'];
|
|
|
492
492
|
* amount, so the agent's pair, above zero, is the one the cardholder approves.
|
|
493
493
|
* Served on the same terms: only to a build that lists it, for a company Agentcard turned APS on for.
|
|
494
494
|
*
|
|
495
|
+
* `nexi_checkout_pay`: the card payment Nexi Checkout's card frame (checkout.dibspayment.eu/v1/, formerly Nets
|
|
496
|
+
* Easy) posts as JSON to its own pay endpoint, https://checkout.dibspayment.eu/api/v1/pay (the test host for a
|
|
497
|
+
* test row), under the merchant's checkout key and the payment's id. This build pauses only the card form's own
|
|
498
|
+
* body at that exact URL ("save my card", "remember me" and a card fee are refused at the pause, and the frame's
|
|
499
|
+
* card lookup while the number is typed continues untouched); the cardholder's device reads Nexi's own record of the
|
|
500
|
+
* payment and sends the card through the checkout relay, and the frame gets Nexi's answer as payment-core's judge
|
|
501
|
+
* rebuilt it: the payment done, or Nexi's 3-D Secure step, which the frame then runs in the agent's browser. The
|
|
502
|
+
* body names the payment's amount in minor units but not its currency, so the agent's pair, above zero, is the one
|
|
503
|
+
* the cardholder approves, and the API holds its amount to the body's. Served on the same terms: only to a build
|
|
504
|
+
* that lists it, for a company Agentcard turned Nexi Checkout on for.
|
|
505
|
+
*
|
|
506
|
+
* `barion_hosted_payment_page`: Barion's Smart Gateway, whose card-free link
|
|
507
|
+
* (secure.barion.com/Pay?Id=<payment id>, a plain GET the merchant's redirect or script sends
|
|
508
|
+
* the buyer to) this build pauses for the cardholder's device by its exact link (hosted-entry.ts),
|
|
509
|
+
* and whose email check, card posts and 3-D Secure post this build never lets the agent's browser
|
|
510
|
+
* send (pre-claim.ts, barion.ts). Served on the same terms as Przelewy24's: only to a build that
|
|
511
|
+
* lists it, for a company Agentcard turned Barion on for.
|
|
512
|
+
*
|
|
513
|
+
* `paymob_checkout_pay`: the card payment Paymob's own checkout sends, from Unified Checkout
|
|
514
|
+
* (<country>.checkout.paymob.com) or from the Pixel card frame a merchant's page embeds, as JSON to
|
|
515
|
+
* https://<accept|uae|ksa|oman>.paymob.com/api/acceptance/payments/pay. This build pauses only the
|
|
516
|
+
* card form's own payment at that exact URL: a card Paymob saved, a payment that keeps the card,
|
|
517
|
+
* pays in installments, splits, converts or names a Paymob account, and a payment key that enrolls
|
|
518
|
+
* a subscription or names no amount are refused at the pause, and another method's payment with no
|
|
519
|
+
* card (a wallet, Apple Pay, cash) continues to Paymob untouched. The cardholder's device sends the
|
|
520
|
+
* payment to Paymob itself with the real card, and the checkout gets Paymob's answer as payment-core's
|
|
521
|
+
* judge rebuilt it. The payment key names the amount and currency, so an agent pair is optional and
|
|
522
|
+
* the API holds one to the key's figure. Served on the same terms: only to a build that lists it, for
|
|
523
|
+
* a company Agentcard turned Paymob on for.
|
|
524
|
+
*
|
|
525
|
+
* `payu_latam_webcheckout_card`: the card submit PayU Latam's WebCheckout page posts to
|
|
526
|
+
* checkout.payulatam.com/ppp-web-gateway-payu/checkout/submit/<country>/credit_card/<key>
|
|
527
|
+
* (sandbox.checkout.payulatam.com on PayU's test platform). This build pauses only the card form's
|
|
528
|
+
* own submit at that exact URL (a ticked save-my-card box, a card PayU saved, installments and a
|
|
529
|
+
* test order on the live host are refused at the pause); the cardholder's device writes the real
|
|
530
|
+
* card into the paused body and sends it to PayU itself, and the page gets PayU's answer as
|
|
531
|
+
* payment-core's judge reads it. The page's BIN lookup (checkout/card_info/) carries the typed
|
|
532
|
+
* placeholder and continues, as the page needs its answer to fill the card's facts. The submit's
|
|
533
|
+
* copy of the order is the browser's, so the agent's pair, above zero, is the one the cardholder
|
|
534
|
+
* approves, which the API holds to the order PayU reads back. Served on the same terms: only to a
|
|
535
|
+
* build that lists it, for a company Agentcard turned PayU Latam on for.
|
|
536
|
+
*
|
|
495
537
|
* The list itself is capabilities.json, sorted, one per line (scripts/generate-capabilities.mjs).
|
|
496
538
|
*/
|
|
497
539
|
export const SUPPORTED_CAPABILITIES = DECLARED_CAPABILITIES;
|
|
@@ -595,6 +637,8 @@ export const SUPPORTED_CAPABILITIES = DECLARED_CAPABILITIES;
|
|
|
595
637
|
* create route's refusal, not in this comment.
|
|
596
638
|
*/
|
|
597
639
|
const REVOLUT_PSP = 'revolut';
|
|
640
|
+
/** Nexi Checkout's card payment names the payment's amount in minor units but not its currency, as Revolut's does. */
|
|
641
|
+
const NEXI_CHECKOUT_PSP = 'nexi_checkout';
|
|
598
642
|
const AGENT_AMOUNT_PROCESSORS = AGENT_AMOUNT.processors;
|
|
599
643
|
/** The ones a zero amount is refused for, like a missing one (authorize()). */
|
|
600
644
|
const ABOVE_ZERO_PROCESSORS = AGENT_AMOUNT.aboveZero;
|
|
@@ -881,7 +925,7 @@ export class AmountRequiredError extends Error {
|
|
|
881
925
|
constructor(psp) {
|
|
882
926
|
const processor = PROCESSOR_NAMES[psp] ?? psp;
|
|
883
927
|
// A Payrexx card request names the frame's total, but the merchant's page charges its own total after the token.
|
|
884
|
-
const lacks = psp === REVOLUT_PSP ? 'names its amount but not its currency'
|
|
928
|
+
const lacks = psp === REVOLUT_PSP || psp === NEXI_CHECKOUT_PSP ? 'names its amount but not its currency'
|
|
885
929
|
: psp === PAYREXX_PSP ? "only mints a token the merchant's page charges later"
|
|
886
930
|
: psp === TAP_PAYMENTS_PSP ? 'does not decide the amount charged' : 'names no amount';
|
|
887
931
|
// "An Omise payment request", "A Clover payment request": the article follows the name's first letter.
|
package/dist/hosted-entry.js
CHANGED
|
@@ -17,10 +17,12 @@
|
|
|
17
17
|
import { PRZELEWY24_PSP, isPrzelewy24EntryUrl } from './przelewy24.js';
|
|
18
18
|
import { COMGATE_PSP, isComgateEntryUrl } from './comgate.js';
|
|
19
19
|
import { TRANSBANK_PSP, isTransbankEntryUrl } from './transbank.js';
|
|
20
|
+
import { BARION_PSP, isBarionEntryUrl } from './barion.js';
|
|
20
21
|
const HOSTED_GET_ENTRIES = new Map([
|
|
21
22
|
[PRZELEWY24_PSP, isPrzelewy24EntryUrl],
|
|
22
23
|
[COMGATE_PSP, isComgateEntryUrl],
|
|
23
24
|
[TRANSBANK_PSP, isTransbankEntryUrl],
|
|
25
|
+
[BARION_PSP, isBarionEntryUrl],
|
|
24
26
|
]);
|
|
25
27
|
/** Whether this processor's hosted page is entered with a GET this build reads exactly. */
|
|
26
28
|
export function hasHostedGetEntry(psp) {
|
package/dist/pre-claim.d.ts
CHANGED
|
@@ -279,6 +279,7 @@ export declare function isArmedCreditguardCall(vault: {
|
|
|
279
279
|
recognizesProcessor?(psp: string): boolean;
|
|
280
280
|
} | undefined, url: string): boolean;
|
|
281
281
|
export declare const przelewy24PreClaim: PreClaimGate;
|
|
282
|
+
export declare const barionPreClaim: PreClaimGate;
|
|
282
283
|
export declare const ekashuPreClaim: PreClaimGate;
|
|
283
284
|
export declare const transbankPreClaim: PreClaimGate;
|
|
284
285
|
export declare const paytrailPreClaim: PreClaimGate;
|
package/dist/pre-claim.js
CHANGED
|
@@ -85,6 +85,7 @@ import { ekashuEntryUrl, isEkashuEntry, isEkashuHost } from './ekashu.js';
|
|
|
85
85
|
import { isArmedTransbankUrl } from './transbank.js';
|
|
86
86
|
import { isRedsysEntry, isRedsysHost, redsysEntryUrl } from './redsys.js';
|
|
87
87
|
import { isArmedPrzelewy24Url, isPrzelewy24PayStep } from './przelewy24.js';
|
|
88
|
+
import { isArmedBarionUrl, isBarionPayStep } from './barion.js';
|
|
88
89
|
import { isQuickpayCardLookup, isQuickpayEntry, quickpayEntryUrl } from './quickpay.js';
|
|
89
90
|
import { isArmedComgateUrl } from './comgate.js';
|
|
90
91
|
import { isArmedEximbayUrl, isEximbayEntry } from './eximbay.js';
|
|
@@ -1663,6 +1664,22 @@ export const przelewy24PreClaim = (ctx) => {
|
|
|
1663
1664
|
return undefined;
|
|
1664
1665
|
return processorPageAbort(ctx);
|
|
1665
1666
|
};
|
|
1667
|
+
// Barion's Smart Gateway (barion.ts). Once this build's registry serves Barion's entry (a capability the API serves
|
|
1668
|
+
// only to a company Agentcard turned Barion on for), every request to the gateway's two hosts pauses. The merchant's
|
|
1669
|
+
// entry, a GET of /Pay?Id=<payment id> exactly, is no step of this gate's: it defers, and the terminal arbiter pauses
|
|
1670
|
+
// it for the claim flow like any card request, so the cardholder's device pays it. Every step toward paying on the
|
|
1671
|
+
// gateway itself aborts as an unsupported checkout: every POST there (the email check, the card's two posts, the 3-D
|
|
1672
|
+
// Secure post, any form the gateway posts). So Barion never sees the card the agent typed. The agent's browser only
|
|
1673
|
+
// reaches the gateway when the entry was not paused (an attachment made too late, say), and then only the cardholder's
|
|
1674
|
+
// device can pay. The gateway's own pages, scripts, images and 3-D Secure frames are GETs this gate leaves to
|
|
1675
|
+
// continue. With Barion not served, the gate defers, and every request continues as before. Synchronous until it
|
|
1676
|
+
// must abort, like every gate. Exported for the gate registry's tests.
|
|
1677
|
+
export const barionPreClaim = (ctx) => {
|
|
1678
|
+
const { url, method } = ctx.request;
|
|
1679
|
+
if (!isBarionPayStep(url, method) || !isArmedBarionUrl(ctx.vault, url))
|
|
1680
|
+
return undefined;
|
|
1681
|
+
return processorPageAbort(ctx);
|
|
1682
|
+
};
|
|
1666
1683
|
// NMI's hosted payment page (ekashu.ts). Once this build's registry serves NMI's entry (a
|
|
1667
1684
|
// capability the API serves only to a company Agentcard turned NMI on for), every request to
|
|
1668
1685
|
// NMI's two hosts pauses, and this gate judges the POSTs:
|
|
@@ -2482,7 +2499,7 @@ async function unsupportedContinue(ctx) {
|
|
|
2482
2499
|
* arbiter runs after all of them and is not part of this list. A gate appended
|
|
2483
2500
|
* after Stripe is never offered a step Stripe claimed: Stripe answers, aborts or
|
|
2484
2501
|
* pauses each one itself. */
|
|
2485
|
-
export const PSP_PRE_CLAIM_GATES = [cardEndpointResendPreClaim, cardEndpointPreClaim, mercadoPreClaim, juspayPreClaim, braintreePreClaim, stripePreClaim, merchantHostedPreClaim, verifonePreClaim, fiservPreClaim, gmoPreClaim, cybersourceFlexPreClaim, datatransPreClaim, tokenexIframePreClaim, pelecardPreClaim, aciPreClaim, creditguardPreClaim, primerPreClaim, payrailsPreClaim, convergePreClaim, eprotectPreClaim, sbpsPreClaim, wspayPreClaim, shijiStsPreClaim, ekashuPreClaim, redsysPreClaim, quickpayPreClaim, comgatePreClaim, przelewy24PreClaim, transbankPreClaim, eximbayPreClaim, paypalHostedFieldsPreClaim,
|
|
2502
|
+
export const PSP_PRE_CLAIM_GATES = [cardEndpointResendPreClaim, cardEndpointPreClaim, mercadoPreClaim, juspayPreClaim, braintreePreClaim, stripePreClaim, merchantHostedPreClaim, verifonePreClaim, fiservPreClaim, gmoPreClaim, cybersourceFlexPreClaim, datatransPreClaim, tokenexIframePreClaim, pelecardPreClaim, aciPreClaim, creditguardPreClaim, primerPreClaim, payrailsPreClaim, convergePreClaim, eprotectPreClaim, sbpsPreClaim, wspayPreClaim, shijiStsPreClaim, ekashuPreClaim, redsysPreClaim, quickpayPreClaim, comgatePreClaim, przelewy24PreClaim, transbankPreClaim, eximbayPreClaim, barionPreClaim, paypalHostedFieldsPreClaim,
|
|
2486
2503
|
paypalCardFormsPreClaim, cybersourceSecureAcceptancePreClaim, worldlineMyCheckoutPreClaim, paddleVgsPayPreClaim, ebanxPreClaim, payrexxPreClaim, hipayPreClaim, paytrailPreClaim];
|
|
2487
2504
|
/** Run each gate in order; the first to return a decision wins. If none does,
|
|
2488
2505
|
* the terminal arbiter decides between continue, abort (unsupported) and pause.
|