From 7b454faf48f48a3f85a3882add8000c0e3dbed71 Mon Sep 17 00:00:00 2001 From: Mel <78050250+mludowise-stripe@users.noreply.github.com> Date: Wed, 30 Mar 2022 21:15:08 -0700 Subject: [PATCH] Scan passport once (#935) --- .../ViewControllers/DocumentCaptureViewController.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/DocumentCaptureViewController.swift b/StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/DocumentCaptureViewController.swift index 573ce232700..b936060534a 100644 --- a/StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/DocumentCaptureViewController.swift +++ b/StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/DocumentCaptureViewController.swift @@ -562,7 +562,12 @@ extension DocumentCaptureViewController: AVCaptureVideoDataOutputSampleBufferDel @available(iOSApplicationExtension, unavailable) extension DocumentCaptureViewController: IdentityDataCollecting { var collectedFields: Set { - return Set([.idDocumentFront]).union(documentType.hasBack ? [.idDocumentBack] : []) + // Note: Always include the document back, even if the document type + // doesn't have a back. The initial VerificationPage request is made + // before the user selects which document type they've selected, so it + // will always include the back. Including `idDocumentBack` here ensures + // that the user isn't erroneously prompted to scan their document twice. + return [.idDocumentFront, .idDocumentBack] } }