@visa/cli 4.1.0-rc.150 → 4.1.0-rc.152

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.
@@ -79,6 +79,10 @@ export type CliReceiptFacts = {
79
79
  * card confirmation target exists.
80
80
  */
81
81
  processorIntentId?: string | null;
82
+ /** True only when the checkout engine recorded a credential-minted step. */
83
+ credentialIssued: boolean;
84
+ /** True only when at least one payment field was successfully filled. */
85
+ credentialDisclosed: boolean;
82
86
  };
83
87
  export type CliStartMandateInput = {
84
88
  /** Optional local card-capability selector (legacy name or exact request-key JKT). */
@@ -510,6 +510,10 @@ export function createCliCheckoutEngine(deps = {}) {
510
510
  await closeSession(reviewId);
511
511
  },
512
512
  async pay(input) {
513
+ const noCredentialFacts = {
514
+ credentialIssued: false,
515
+ credentialDisclosed: false,
516
+ };
513
517
  const session = sessions.get(input.reviewId);
514
518
  // One signal for the whole pay lifecycle. `cardTokenId` is populated only
515
519
  // by the resolved v4 card-grant authority; legacy credential-file calls
@@ -525,6 +529,7 @@ export function createCliCheckoutEngine(deps = {}) {
525
529
  vicConfirmation: null,
526
530
  source: null,
527
531
  remainingMinor: null,
532
+ ...noCredentialFacts,
528
533
  };
529
534
  }
530
535
  // The reviewId selects the prepared browser session, but the pay call also
@@ -548,6 +553,7 @@ export function createCliCheckoutEngine(deps = {}) {
548
553
  vicConfirmation: null,
549
554
  source: null,
550
555
  remainingMinor: null,
556
+ ...noCredentialFacts,
551
557
  };
552
558
  }
553
559
  if (payUrl !== reviewedUrl) {
@@ -560,6 +566,7 @@ export function createCliCheckoutEngine(deps = {}) {
560
566
  vicConfirmation: null,
561
567
  source: null,
562
568
  remainingMinor: null,
569
+ ...noCredentialFacts,
563
570
  };
564
571
  }
565
572
  if (input.currency.toUpperCase() !== session.currency.toUpperCase()) {
@@ -572,6 +579,7 @@ export function createCliCheckoutEngine(deps = {}) {
572
579
  vicConfirmation: null,
573
580
  source: null,
574
581
  remainingMinor: null,
582
+ ...noCredentialFacts,
575
583
  };
576
584
  }
577
585
  if (input.agentJkt !== session.agentJkt) {
@@ -584,6 +592,7 @@ export function createCliCheckoutEngine(deps = {}) {
584
592
  vicConfirmation: null,
585
593
  source: null,
586
594
  remainingMinor: null,
595
+ ...noCredentialFacts,
587
596
  };
588
597
  }
589
598
  // Amount-bind the confirmation: the pay-call amount must match the
@@ -601,6 +610,7 @@ export function createCliCheckoutEngine(deps = {}) {
601
610
  vicConfirmation: null,
602
611
  source: null,
603
612
  remainingMinor: null,
613
+ ...noCredentialFacts,
604
614
  };
605
615
  }
606
616
  // Reject an expired prepared checkout BEFORE running the hosted passkey
@@ -616,6 +626,7 @@ export function createCliCheckoutEngine(deps = {}) {
616
626
  vicConfirmation: null,
617
627
  source: null,
618
628
  remainingMinor: null,
629
+ ...noCredentialFacts,
619
630
  };
620
631
  }
621
632
  clearTimeout(session.cleanupTimer);
@@ -670,6 +681,7 @@ export function createCliCheckoutEngine(deps = {}) {
670
681
  vicConfirmation: null,
671
682
  source,
672
683
  remainingMinor: null,
684
+ ...noCredentialFacts,
673
685
  };
674
686
  }
675
687
  if (covering.agentJkt && capability.agentJkt !== covering.agentJkt) {
@@ -682,6 +694,7 @@ export function createCliCheckoutEngine(deps = {}) {
682
694
  vicConfirmation: null,
683
695
  source,
684
696
  remainingMinor: null,
697
+ ...noCredentialFacts,
685
698
  };
686
699
  }
687
700
  // VgsLiveInstrument mints against an EXISTING intent (the mandate) with
@@ -807,6 +820,7 @@ export function createCliCheckoutEngine(deps = {}) {
807
820
  vicConfirmation: null,
808
821
  source: null,
809
822
  remainingMinor: null,
823
+ ...noCredentialFacts,
810
824
  };
811
825
  }
812
826
  const mode = input.submit ? 'submit' : 'dry-run';
@@ -870,6 +884,9 @@ export function createCliCheckoutEngine(deps = {}) {
870
884
  source,
871
885
  remainingMinor: drawnRemaining,
872
886
  processorIntentId,
887
+ credentialIssued: result.credentialLifecycle !== 'not-requested',
888
+ credentialDisclosed: result.credentialLifecycle === 'partially-exposed' ||
889
+ result.credentialLifecycle === 'fully-filled',
873
890
  };
874
891
  }
875
892
  finally {