Skip to content

Commit d0d5555

Browse files
authored
Merge pull request #254 from getyoti/release/3.8.0
Release/3.8.0
2 parents 5dea680 + afff971 commit d0d5555

File tree

123 files changed

+1875
-108
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+1875
-108
lines changed

src/DocScan/Constants.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ class Constants
2222
public const FUZZY = 'FUZZY';
2323
public const FACE_CAPTURE = 'FACE_CAPTURE';
2424

25+
public const MANDATORY = "MANDATORY";
26+
public const NOT_ALLOWED = "NOT_ALLOWED";
27+
2528

2629
public const ADVERSE_MEDIA = 'ADVERSE-MEDIA';
2730
public const SANCTIONS = 'SANCTIONS';
@@ -40,6 +43,8 @@ class Constants
4043
public const FALLBACK = 'FALLBACK';
4144
public const NEVER = 'NEVER';
4245

46+
public const UK_POST_OFFICE = "UK_POST_OFFICE";
47+
4348
public const BASIC = 'BASIC';
4449
public const BEARER = 'BEARER';
4550

src/DocScan/DocScanClient.php

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Yoti\DocScan\Session\Create\FaceCapture\CreateFaceCaptureResourcePayload;
1010
use Yoti\DocScan\Session\Create\FaceCapture\UploadFaceCaptureImagePayload;
1111
use Yoti\DocScan\Session\Create\SessionSpecification;
12+
use Yoti\DocScan\Session\Instructions\Instructions;
1213
use Yoti\DocScan\Session\Retrieve\Configuration\SessionConfigurationResponse;
1314
use Yoti\DocScan\Session\Retrieve\GetSessionResult;
1415
use Yoti\DocScan\Support\SupportedDocumentsResponse;
@@ -29,7 +30,6 @@
2930
*/
3031
class DocScanClient
3132
{
32-
3333
/**
3434
* @var Service
3535
*/
@@ -131,14 +131,19 @@ public function deleteMediaContent(string $sessionId, string $mediaId): void
131131
/**
132132
* Gets a list of supported documents.
133133
*
134+
* @param bool $isStrictlyLatin
134135
* @return SupportedDocumentsResponse
136+
* @throws Exception\DocScanException
135137
*/
136-
public function getSupportedDocuments(): SupportedDocumentsResponse
138+
public function getSupportedDocuments(bool $isStrictlyLatin = false): SupportedDocumentsResponse
137139
{
138-
return $this->docScanService->getSupportedDocuments();
140+
return $this->docScanService->getSupportedDocuments($isStrictlyLatin);
139141
}
140142

141143
/**
144+
* Creates a Face Capture resource, that will be linked using
145+
* the supplied requirement ID
146+
*
142147
* @param string $sessionId
143148
* @param CreateFaceCaptureResourcePayload $createFaceCaptureResourcePayload
144149
* @return Session\Retrieve\CreateFaceCaptureResourceResponse
@@ -152,6 +157,8 @@ public function createFaceCaptureResource(
152157
}
153158

154159
/**
160+
* Uploads an image to the specified Face Capture resource
161+
*
155162
* @param string $sessionId
156163
* @param string $resourceId
157164
* @param UploadFaceCaptureImagePayload $uploadFaceCaptureImagePayload
@@ -176,4 +183,14 @@ public function getSessionConfiguration(string $sessionId): SessionConfiguration
176183
{
177184
return $this->docScanService->fetchSessionConfiguration($sessionId);
178185
}
186+
187+
/**
188+
* Sets the IBV instructions for the given session
189+
*
190+
* @throws Exception\DocScanException
191+
*/
192+
public function putIbvInstructions(string $sessionId, Instructions $instructions): void
193+
{
194+
$this->docScanService->putIbvInstructions($sessionId, $instructions);
195+
}
179196
}

src/DocScan/Service.php

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Yoti\DocScan\Session\Create\FaceCapture\CreateFaceCaptureResourcePayload;
1212
use Yoti\DocScan\Session\Create\FaceCapture\UploadFaceCaptureImagePayload;
1313
use Yoti\DocScan\Session\Create\SessionSpecification;
14+
use Yoti\DocScan\Session\Instructions\Instructions;
1415
use Yoti\DocScan\Session\Retrieve\Configuration\SessionConfigurationResponse;
1516
use Yoti\DocScan\Session\Retrieve\CreateFaceCaptureResourceResponse;
1617
use Yoti\DocScan\Session\Retrieve\GetSessionResult;
@@ -25,7 +26,6 @@
2526

2627
class Service
2728
{
28-
2929
/**
3030
* @var string
3131
*/
@@ -185,17 +185,23 @@ public function deleteMediaContent(string $sessionId, string $mediaId): void
185185
}
186186

187187
/**
188-
* Gets a list of supported documents.
189-
*
188+
* @param bool $isStrictlyLatin
190189
* @return SupportedDocumentsResponse
190+
* @throws DocScanException
191191
*/
192-
public function getSupportedDocuments(): SupportedDocumentsResponse
192+
public function getSupportedDocuments(bool $isStrictlyLatin): SupportedDocumentsResponse
193193
{
194-
$response = (new RequestBuilder($this->config))
194+
$requestBuilder = (new RequestBuilder($this->config))
195195
->withBaseUrl($this->apiUrl)
196196
->withEndpoint('/supported-documents')
197197
->withPemFile($this->pemFile)
198-
->withGet()
198+
->withGet();
199+
200+
if ($isStrictlyLatin) {
201+
$requestBuilder->withQueryParam('includeNonLatin', '1');
202+
}
203+
204+
$response = $requestBuilder
199205
->build()
200206
->execute();
201207

@@ -284,6 +290,25 @@ public function fetchSessionConfiguration(string $sessionId): SessionConfigurati
284290
return new SessionConfigurationResponse($result);
285291
}
286292

293+
/**
294+
* @param string $sessionId
295+
* @param Instructions $instructions
296+
* @throws DocScanException
297+
*/
298+
public function putIbvInstructions(string $sessionId, Instructions $instructions): void
299+
{
300+
$response = (new RequestBuilder($this->config))
301+
->withBaseUrl($this->apiUrl)
302+
->withPemFile($this->pemFile)
303+
->withEndpoint(sprintf('/sessions/%s/instructions', $sessionId))
304+
->withPut()
305+
->withPayload(Payload::fromJsonData($instructions))
306+
->build()
307+
->execute();
308+
309+
self::assertResponseIsSuccess($response);
310+
}
311+
287312
/**
288313
* @param ResponseInterface $response
289314
*

src/DocScan/Session/Create/Check/Contracts/Advanced/RequestedCaMatchingStrategy.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@
66

77
abstract class RequestedCaMatchingStrategy
88
{
9-
109
}

src/DocScan/Session/Create/Check/Contracts/Advanced/RequestedCaSources.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@
66

77
abstract class RequestedCaSources
88
{
9-
109
}

src/DocScan/Session/Create/Check/Contracts/RequestedWatchlistAdvancedCaConfigBuilder.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
abstract class RequestedWatchlistAdvancedCaConfigBuilder
1111
{
12-
1312
/**
1413
* @var bool
1514
*/

src/DocScan/Session/Create/Check/RequestedCheck.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
abstract class RequestedCheck implements JsonSerializable
1111
{
12-
1312
/**
1413
* @return array<string, mixed>
1514
*/

src/DocScan/Session/Create/Check/RequestedCheckConfigInterface.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@
88

99
interface RequestedCheckConfigInterface extends JsonSerializable
1010
{
11-
1211
}

src/DocScan/Session/Create/Check/RequestedFaceMatchCheck.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
class RequestedFaceMatchCheck extends RequestedCheck
1010
{
11-
1211
/**
1312
* @var RequestedFaceMatchCheckConfig
1413
*/

src/DocScan/Session/Create/Check/RequestedFaceMatchCheckConfig.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
class RequestedFaceMatchCheckConfig implements RequestedCheckConfigInterface
88
{
9-
109
/**
1110
* @var string
1211
*/

0 commit comments

Comments
 (0)