@visa/cli 4.1.0-rc.146 → 4.1.0-rc.147

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.
@@ -16,6 +16,15 @@ import type { Contact, OtpResolver } from './types.js';
16
16
  * is classified by its underlying gateway error. Exported for tests.
17
17
  */
18
18
  export declare function isTransientDrawFailure(err: unknown): boolean;
19
+ /**
20
+ * A verdict refusal may be wrapped by drawFromMandate after its local
21
+ * reservation is released. Walk the cause chain so the original auth status +
22
+ * reasons still decide whether the mandate is permanently disabled.
23
+ */
24
+ export declare function classifyCardDrawVerdictFailure(err: unknown): {
25
+ transient: boolean;
26
+ reasons: string[];
27
+ } | null;
19
28
  export type CliReviewInput = {
20
29
  url: string;
21
30
  amount: string;
@@ -66,7 +66,12 @@ export function isTransientDrawFailure(err) {
66
66
  * reservation is released. Walk the cause chain so the original auth status +
67
67
  * reasons still decide whether the mandate is permanently disabled.
68
68
  */
69
- function classifyCardDrawVerdictFailure(err) {
69
+ // Exported for the cross-package pin in test/cli-engine.test.ts: the CLI's
70
+ // card-draw client decides the `status` this reads, so the two move together
71
+ // and a test that spans the boundary is the only one that would catch a drift.
72
+ // Not re-exported from index.ts — the public @visa/checkout-engine surface is
73
+ // the explicit allowlist there, same as isTransientDrawFailure above.
74
+ export function classifyCardDrawVerdictFailure(err) {
70
75
  const transientReasons = new Set(['challenge_failed', 'challenge_malformed', 'verdict_refused']);
71
76
  let current = err;
72
77
  for (let i = 0; i < 5 && current; i++) {