@visa/cli 4.1.0-rc.102 → 4.1.0-rc.103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/checkout-engine/cli-engine.d.ts +3 -0
- package/dist/checkout-engine/cli-engine.js +14 -0
- package/dist/checkout-engine/mandate/mandate-ledger.d.ts +2 -0
- package/dist/checkout-engine/mandate/mandate-ledger.js +1 -0
- package/dist/cli.js +73 -73
- package/dist/mcp-server/index.js +46 -46
- package/native/bin/win32-x64/visa-keychain-win.exe +0 -0
- package/package.json +1 -1
- package/server.json +2 -2
|
@@ -23,6 +23,8 @@ export type CliReviewInput = {
|
|
|
23
23
|
credentialPath: string;
|
|
24
24
|
/** See {@link CardInstrumentSource}. */
|
|
25
25
|
cardTokenId?: string;
|
|
26
|
+
/** Exact request-key identity selected by the caller. */
|
|
27
|
+
agentJkt?: string;
|
|
26
28
|
contact: Contact;
|
|
27
29
|
approvalBaseUrl: string;
|
|
28
30
|
merchantName?: string;
|
|
@@ -121,6 +123,7 @@ type Session = {
|
|
|
121
123
|
amountMinor: number;
|
|
122
124
|
currency: string;
|
|
123
125
|
contact: Contact;
|
|
126
|
+
agentJkt?: string;
|
|
124
127
|
cleanupTimer: ReturnType<typeof setTimeout>;
|
|
125
128
|
};
|
|
126
129
|
export interface CardDrawVerdictDraw {
|
|
@@ -395,6 +395,7 @@ export function createCliCheckoutEngine(deps = {}) {
|
|
|
395
395
|
amountMinor,
|
|
396
396
|
currency: input.currency,
|
|
397
397
|
contact: input.contact,
|
|
398
|
+
...(input.agentJkt ? { agentJkt: input.agentJkt } : {}),
|
|
398
399
|
cleanupTimer,
|
|
399
400
|
});
|
|
400
401
|
return {
|
|
@@ -471,6 +472,18 @@ export function createCliCheckoutEngine(deps = {}) {
|
|
|
471
472
|
remainingMinor: null,
|
|
472
473
|
};
|
|
473
474
|
}
|
|
475
|
+
if (input.agentJkt !== session.agentJkt) {
|
|
476
|
+
await closeSession(input.reviewId);
|
|
477
|
+
return {
|
|
478
|
+
outcome: 'failed',
|
|
479
|
+
confirmationRef: null,
|
|
480
|
+
receiptPath: null,
|
|
481
|
+
detail: 'pay agent authority does not match the reviewed request key — start a fresh review',
|
|
482
|
+
vicConfirmation: null,
|
|
483
|
+
source: null,
|
|
484
|
+
remainingMinor: null,
|
|
485
|
+
};
|
|
486
|
+
}
|
|
474
487
|
// Amount-bind the confirmation: the pay-call amount must match the
|
|
475
488
|
// reviewed amount. The reviewId already locks the immutable mandate, but
|
|
476
489
|
// re-checking here makes the confirmation explicitly amount-bound so a
|
|
@@ -519,6 +532,7 @@ export function createCliCheckoutEngine(deps = {}) {
|
|
|
519
532
|
merchantHost: host,
|
|
520
533
|
currencyCode: session.currency,
|
|
521
534
|
amountMinor: session.amountMinor,
|
|
535
|
+
agentJkt: session.agentJkt,
|
|
522
536
|
now: now(),
|
|
523
537
|
});
|
|
524
538
|
let source;
|
|
@@ -77,6 +77,8 @@ export type CoverQuery = {
|
|
|
77
77
|
merchantHost: string;
|
|
78
78
|
currencyCode: string;
|
|
79
79
|
amountMinor: number;
|
|
80
|
+
/** Exact selected request key; omitted means legacy unbound mandates only. */
|
|
81
|
+
agentJkt?: string;
|
|
80
82
|
now?: Date;
|
|
81
83
|
};
|
|
82
84
|
/** Available headroom = ceiling - committed - reserved. Integer minor units. */
|
|
@@ -199,6 +199,7 @@ export class MandateLedger {
|
|
|
199
199
|
// one only matches its own host. Network Retail/5999 eligibility is
|
|
200
200
|
// enforced downstream and is not inferred from a website hostname.
|
|
201
201
|
(m.crossMerchant || m.merchantHost === query.merchantHost) &&
|
|
202
|
+
m.agentJkt === query.agentJkt &&
|
|
202
203
|
m.currencyCode.toUpperCase() === query.currencyCode.toUpperCase() &&
|
|
203
204
|
!m.unhonoredAt &&
|
|
204
205
|
!m.registerFailedAt &&
|