From 07a21950d60384816e410d8d041bed4120b7cd10 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 24 May 2026 13:41:26 +0000 Subject: [PATCH] feat(card): surface Didit review warnings in step-1 description Didit's duplicate IP / duplicate device filters are configured to send suspicious applicants to In Review so they don't reach Rain. Backend already maps that to kycStatus=UNDER_REVIEW with the warnings preserved on cardCustomer.diditWarnings, but step 1 of /card/activate returned the generic "being reviewed, takes a few minutes" copy regardless. Render the per-warning reasons when present so the applicant knows what's being checked; keep the original copy as the empty-warnings fallback. Also adds DUPLICATED_IP / DUPLICATED_DEVICE entries (and tightens POSSIBLE_DUPLICATED_USER) in DIDIT_WARNING_DESCRIPTIONS. Cherry-pick of #2090 onto qa. --- hooks/useCardSteps/kycDisplayHelpers.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/hooks/useCardSteps/kycDisplayHelpers.ts b/hooks/useCardSteps/kycDisplayHelpers.ts index ac873ac1..86fd0681 100644 --- a/hooks/useCardSteps/kycDisplayHelpers.ts +++ b/hooks/useCardSteps/kycDisplayHelpers.ts @@ -73,7 +73,9 @@ const DIDIT_WARNING_DESCRIPTIONS: Record = { SCREEN_CAPTURE_DETECTED: 'A photo of a screen was detected — please use the original document', PRINTED_COPY_DETECTED: 'A printed copy was detected — please use the original document', PORTRAIT_MANIPULATION_DETECTED: 'The portrait on the document appears to have been altered', - POSSIBLE_DUPLICATED_USER: 'A duplicate account was detected', + POSSIBLE_DUPLICATED_USER: 'This identity is already linked to another verified account', + DUPLICATED_IP: 'This network has already been used to verify another account', + DUPLICATED_DEVICE: 'This device has already been used to verify another account', DOCUMENT_NUMBER_NOT_DETECTED: 'Document number could not be read', NAME_NOT_DETECTED: 'Name could not be read from the document', DATE_OF_BIRTH_NOT_DETECTED: 'Date of birth could not be read from the document', @@ -239,8 +241,15 @@ export function getStepDescription( return 'Additional verification steps are required. Please continue to complete the process.'; } - // Didit under review — user should wait + // Didit under review — user should wait. Duplicate IP/device filters land + // here (Didit dashboard sets them to "review" so the suspicious applicant + // doesn't reach Rain). When warnings are attached, surface them so the user + // knows what's being checked instead of seeing a generic "few minutes" copy + // for what is actually a manual review. if (options?.kycStatus === KycStatus.UNDER_REVIEW && !isRecognizedRainStatus) { + if (warnings.length > 0) { + return `Your application is under additional review:\n- ${formatKycWarnings(warnings)}\n\nWe'll update you when the review is complete.`; + } return 'Your information is being reviewed. This usually takes a few minutes.'; }