From 43f91e792f5c425e0df56bfc44227c592002e6c4 Mon Sep 17 00:00:00 2001 From: mehmet-yoti Date: Fri, 7 Jul 2023 08:33:35 +0100 Subject: [PATCH 1/4] SDK-2311:Added set setting for biometric consent screen --- src/DocScan/Session/Create/SdkConfig.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/DocScan/Session/Create/SdkConfig.php b/src/DocScan/Session/Create/SdkConfig.php index 453ad44a..07bfd854 100644 --- a/src/DocScan/Session/Create/SdkConfig.php +++ b/src/DocScan/Session/Create/SdkConfig.php @@ -63,6 +63,11 @@ class SdkConfig implements \JsonSerializable */ private $attemptsConfiguration; + /** + * @var string|null + */ + private $biometricConsentFlow; + /** * @param string|null $allowedCaptureMethods * @param string|null $primaryColour @@ -75,6 +80,7 @@ class SdkConfig implements \JsonSerializable * @param string|null $privacyPolicyUrl * @param bool|null $allowHandoff * @param array|null $idDocumentTextDataExtractionRetriesConfig + * @param string|null $biometricConsentFlow */ public function __construct( ?string $allowedCaptureMethods, @@ -87,7 +93,9 @@ public function __construct( ?string $errorUrl, ?string $privacyPolicyUrl = null, ?bool $allowHandoff = null, - ?array $idDocumentTextDataExtractionRetriesConfig = null + ?array $idDocumentTextDataExtractionRetriesConfig = null, + ?string $biometricConsentFlow = null + ) { $this->allowedCaptureMethods = $allowedCaptureMethods; $this->primaryColour = $primaryColour; @@ -102,6 +110,8 @@ public function __construct( if (!is_null($idDocumentTextDataExtractionRetriesConfig)) { $this->attemptsConfiguration = new AttemptsConfiguration($idDocumentTextDataExtractionRetriesConfig); } + $this->biometricConsentFlow = $biometricConsentFlow; + } /** @@ -121,6 +131,7 @@ public function jsonSerialize(): \stdClass 'privacy_policy_url' => $this->getPrivacyPolicyUrl(), 'allow_handoff' => $this->getAllowHandoff(), 'attempts_configuration' => $this->getAttemptsConfiguration(), + 'biometric_consent_flow' => $this->getBiometricConsentFlow() ]); } @@ -211,4 +222,12 @@ public function getAttemptsConfiguration(): ?AttemptsConfiguration { return $this->attemptsConfiguration; } + + /** + * @return string|null + */ + public function getBiometricConsentFlow(): ?string + { + return $this->privacyPolicyUrl; + } } From 397c10ef78e7245fd55fb4ec1bbf6740c345b90f Mon Sep 17 00:00:00 2001 From: mehmet-yoti Date: Fri, 7 Jul 2023 08:49:11 +0100 Subject: [PATCH 2/4] SDK-2311:Added set setting for biometric consent screen --- src/DocScan/Session/Create/SdkConfig.php | 2 +- tests/DocScan/Session/Create/SdkConfigBuilderTest.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/DocScan/Session/Create/SdkConfig.php b/src/DocScan/Session/Create/SdkConfig.php index 07bfd854..51b85112 100644 --- a/src/DocScan/Session/Create/SdkConfig.php +++ b/src/DocScan/Session/Create/SdkConfig.php @@ -228,6 +228,6 @@ public function getAttemptsConfiguration(): ?AttemptsConfiguration */ public function getBiometricConsentFlow(): ?string { - return $this->privacyPolicyUrl; + return $this->biometricConsentFlow; } } diff --git a/tests/DocScan/Session/Create/SdkConfigBuilderTest.php b/tests/DocScan/Session/Create/SdkConfigBuilderTest.php index 5377c5b9..3c84f5d2 100644 --- a/tests/DocScan/Session/Create/SdkConfigBuilderTest.php +++ b/tests/DocScan/Session/Create/SdkConfigBuilderTest.php @@ -22,6 +22,8 @@ class SdkConfigBuilderTest extends TestCase private const SOME_PRIVACY_POLICY_URL = 'somePrivacyPolicyUrl'; private const SOME_CATEGORY = 'someCategory'; private const SOME_NUMBER_RETRIES = 5; + private const SOME_BIOMETRIC_CONSENT_FLOW = 'someBiometricConsentFlow'; + /** * @test @@ -118,6 +120,7 @@ public function shouldProduceTheCorrectJsonString() ->withErrorUrl(self::SOME_ERROR_URL) ->withPrivacyPolicyUrl(self::SOME_PRIVACY_POLICY_URL) ->withAllowHandoff(true) + ->withBiometricConsentFlow(self::SOME_BIOMETRIC_CONSENT_FLOW) ->build(); $expected = [ @@ -131,6 +134,7 @@ public function shouldProduceTheCorrectJsonString() 'error_url' => self::SOME_ERROR_URL, 'privacy_policy_url' => self::SOME_PRIVACY_POLICY_URL, 'allow_handoff' => true, + 'biometric_consent_flow' => self::SOME_BIOMETRIC_CONSENT_FLOW ]; $this->assertJsonStringEqualsJsonString(json_encode($expected), json_encode($result)); From 7a5fb99b5be82bd18d33774ba6d73f96be526f22 Mon Sep 17 00:00:00 2001 From: mehmet-yoti Date: Fri, 7 Jul 2023 09:32:31 +0100 Subject: [PATCH 3/4] SDK-2311:Added set setting for biometric consent screen --- examples/doc-scan/app/Http/Controllers/HomeController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/doc-scan/app/Http/Controllers/HomeController.php b/examples/doc-scan/app/Http/Controllers/HomeController.php index 5aae0ea8..bb50054b 100644 --- a/examples/doc-scan/app/Http/Controllers/HomeController.php +++ b/examples/doc-scan/app/Http/Controllers/HomeController.php @@ -136,6 +136,7 @@ public function show(Request $request, DocScanClient $client) ->withSuccessUrl(config('app.url') . '/success') ->withErrorUrl(config('app.url') . '/error') ->withPrivacyPolicyUrl(config('app.url') . '/privacy-policy') + ->withBiometricConsentFlow('EARLY') ->build() ) ->withRequiredDocument( From 7c46be2b293d0bc4f790dbd7ca1c72e94a71e7fa Mon Sep 17 00:00:00 2001 From: mehmet-yoti Date: Fri, 7 Jul 2023 10:40:07 +0100 Subject: [PATCH 4/4] SDK-2311:Added set setting for biometric consent screen --- src/DocScan/Session/Create/SdkConfigBuilder.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/DocScan/Session/Create/SdkConfigBuilder.php b/src/DocScan/Session/Create/SdkConfigBuilder.php index c91adc05..acf30fcc 100644 --- a/src/DocScan/Session/Create/SdkConfigBuilder.php +++ b/src/DocScan/Session/Create/SdkConfigBuilder.php @@ -66,6 +66,11 @@ class SdkConfigBuilder */ private $idDocumentTextDataExtractionRetriesConfig; + /** + * @var string|null + */ + private $biometricConsentFlow; + public function withAllowsCamera(): self { return $this->withAllowedCaptureMethod(self::CAMERA); @@ -136,6 +141,11 @@ public function withAllowHandoff(bool $allowHandoff): self return $this; } + public function withBiometricConsentFlow(string $biometricConsentFlow): self + { + $this->biometricConsentFlow = $biometricConsentFlow; + return $this; + } /** * Allows configuring the number of attempts permitted for text extraction on an ID document * @@ -203,7 +213,8 @@ public function build(): SdkConfig $this->errorUrl, $this->privacyPolicyUrl, $this->allowHandoff, - $this->idDocumentTextDataExtractionRetriesConfig + $this->idDocumentTextDataExtractionRetriesConfig, + $this->biometricConsentFlow ); } }