diff --git a/README.md b/README.md index 57594652..1dc6a1f5 100755 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ For each service you will need: The Yoti SDK can be used for the following products, follow the links for more information about each: 1) [Yoti app integration](/docs/PROFILE.md) - Connect with already-verified customers. -1) [Yoti Doc Scan](/docs/DOCSCAN.md) - Identity verification embedded in your website or app. +1) [Yoti Doc Scan](/docs/IDV.md) - Identity verification embedded in your website or app. ## Support diff --git a/docs/DOCSCAN.md b/docs/DOCSCAN.md index 3a34d285..b079bd8b 100644 --- a/docs/DOCSCAN.md +++ b/docs/DOCSCAN.md @@ -4,7 +4,7 @@ Yoti Doc Scan can be seamlessly integrated with your website, app or custom product so you can perform secure identity checks. You'll be able to request specific ID documents from users directly from your website or app. -See the the [Developer Docs](https://developers.yoti.com/yoti/getting-started-docscan) for more information. +See the the [Developer Docs](https://developers.yoti.com/yoti/getting-started-IDV) for more information. ## Running the example diff --git a/examples/doc-scan/app/Http/Controllers/HomeController.php b/examples/doc-scan/app/Http/Controllers/HomeController.php index 5aae0ea8..9e92ff0c 100644 --- a/examples/doc-scan/app/Http/Controllers/HomeController.php +++ b/examples/doc-scan/app/Http/Controllers/HomeController.php @@ -4,33 +4,33 @@ use Illuminate\Http\Request; use Illuminate\Routing\Controller as BaseController; -use Yoti\DocScan\DocScanClient; -use Yoti\DocScan\Session\Create\Check\Advanced\RequestedExactMatchingStrategyBuilder; -use Yoti\DocScan\Session\Create\Check\Advanced\RequestedFuzzyMatchingStrategyBuilder; -use Yoti\DocScan\Session\Create\Check\Advanced\RequestedSearchProfileSourcesBuilder; -use Yoti\DocScan\Session\Create\Check\Advanced\RequestedTypeListSourcesBuilder; -use Yoti\DocScan\Session\Create\Check\RequestedCustomAccountWatchlistAdvancedCaConfigBuilder; -use Yoti\DocScan\Session\Create\Check\RequestedDocumentAuthenticityCheckBuilder; -use Yoti\DocScan\Session\Create\Check\RequestedFaceMatchCheckBuilder; -use Yoti\DocScan\Session\Create\Check\RequestedIdDocumentComparisonCheckBuilder; -use Yoti\DocScan\Session\Create\Check\RequestedLivenessCheckBuilder; -use Yoti\DocScan\Session\Create\Check\RequestedThirdPartyIdentityCheckBuilder; -use Yoti\DocScan\Session\Create\Check\RequestedWatchlistAdvancedCaCheckBuilder; -use Yoti\DocScan\Session\Create\Check\RequestedWatchlistScreeningCheckBuilder; -use Yoti\DocScan\Session\Create\Check\RequestedWatchlistScreeningConfigBuilder; -use Yoti\DocScan\Session\Create\Check\RequestedYotiAccountWatchlistAdvancedCaConfigBuilder; -use Yoti\DocScan\Session\Create\Filters\Orthogonal\OrthogonalRestrictionsFilterBuilder; -use Yoti\DocScan\Session\Create\Filters\RequiredIdDocumentBuilder; -use Yoti\DocScan\Session\Create\Filters\RequiredSupplementaryDocumentBuilder; -use Yoti\DocScan\Session\Create\Objective\ProofOfAddressObjectiveBuilder; -use Yoti\DocScan\Session\Create\SdkConfigBuilder; -use Yoti\DocScan\Session\Create\SessionSpecificationBuilder; -use Yoti\DocScan\Session\Create\Task\RequestedSupplementaryDocTextExtractionTaskBuilder; -use Yoti\DocScan\Session\Create\Task\RequestedTextExtractionTaskBuilder; +use Yoti\IDV\IDVClient; +use Yoti\IDV\Session\Create\Check\Advanced\RequestedExactMatchingStrategyBuilder; +use Yoti\IDV\Session\Create\Check\Advanced\RequestedFuzzyMatchingStrategyBuilder; +use Yoti\IDV\Session\Create\Check\Advanced\RequestedSearchProfileSourcesBuilder; +use Yoti\IDV\Session\Create\Check\Advanced\RequestedTypeListSourcesBuilder; +use Yoti\IDV\Session\Create\Check\RequestedCustomAccountWatchlistAdvancedCaConfigBuilder; +use Yoti\IDV\Session\Create\Check\RequestedDocumentAuthenticityCheckBuilder; +use Yoti\IDV\Session\Create\Check\RequestedFaceMatchCheckBuilder; +use Yoti\IDV\Session\Create\Check\RequestedIdDocumentComparisonCheckBuilder; +use Yoti\IDV\Session\Create\Check\RequestedLivenessCheckBuilder; +use Yoti\IDV\Session\Create\Check\RequestedThirdPartyIdentityCheckBuilder; +use Yoti\IDV\Session\Create\Check\RequestedWatchlistAdvancedCaCheckBuilder; +use Yoti\IDV\Session\Create\Check\RequestedWatchlistScreeningCheckBuilder; +use Yoti\IDV\Session\Create\Check\RequestedWatchlistScreeningConfigBuilder; +use Yoti\IDV\Session\Create\Check\RequestedYotiAccountWatchlistAdvancedCaConfigBuilder; +use Yoti\IDV\Session\Create\Filters\Orthogonal\OrthogonalRestrictionsFilterBuilder; +use Yoti\IDV\Session\Create\Filters\RequiredIdDocumentBuilder; +use Yoti\IDV\Session\Create\Filters\RequiredSupplementaryDocumentBuilder; +use Yoti\IDV\Session\Create\Objective\ProofOfAddressObjectiveBuilder; +use Yoti\IDV\Session\Create\SdkConfigBuilder; +use Yoti\IDV\Session\Create\SessionSpecificationBuilder; +use Yoti\IDV\Session\Create\Task\RequestedSupplementaryDocTextExtractionTaskBuilder; +use Yoti\IDV\Session\Create\Task\RequestedTextExtractionTaskBuilder; class HomeController extends BaseController { - public function show(Request $request, DocScanClient $client) + public function show(Request $request, IDVClient $client) { //WatchScreening Config $watchScreeningConfig = (new RequestedWatchlistScreeningConfigBuilder()) diff --git a/examples/doc-scan/app/Http/Controllers/MediaController.php b/examples/doc-scan/app/Http/Controllers/MediaController.php index e21dfdd3..087d4772 100644 --- a/examples/doc-scan/app/Http/Controllers/MediaController.php +++ b/examples/doc-scan/app/Http/Controllers/MediaController.php @@ -4,11 +4,11 @@ use Illuminate\Http\Request; use Illuminate\Routing\Controller as BaseController; -use Yoti\DocScan\DocScanClient; +use Yoti\IDV\IDVClient; class MediaController extends BaseController { - public function show(string $id, Request $request, DocScanClient $client) + public function show(string $id, Request $request, IDVClient $client) { $media = $client->getMediaContent($request->session()->get('YOTI_SESSION_ID'), $id); diff --git a/examples/doc-scan/app/Http/Controllers/SuccessController.php b/examples/doc-scan/app/Http/Controllers/SuccessController.php index a73f146a..89340c2f 100644 --- a/examples/doc-scan/app/Http/Controllers/SuccessController.php +++ b/examples/doc-scan/app/Http/Controllers/SuccessController.php @@ -4,11 +4,11 @@ use Illuminate\Http\Request; use Illuminate\Routing\Controller as BaseController; -use Yoti\DocScan\DocScanClient; +use Yoti\IDV\IDVClient; class SuccessController extends BaseController { - public function show(Request $request, DocScanClient $client) + public function show(Request $request, IDVClient $client) { return view('success', [ 'sessionResult' => $client->getSession($request->session()->get('YOTI_SESSION_ID')), diff --git a/examples/doc-scan/app/Providers/YotiDocScanServiceProvider.php b/examples/doc-scan/app/Providers/YotiDocScanServiceProvider.php index 55322db2..7232bbcf 100644 --- a/examples/doc-scan/app/Providers/YotiDocScanServiceProvider.php +++ b/examples/doc-scan/app/Providers/YotiDocScanServiceProvider.php @@ -4,19 +4,19 @@ use Illuminate\Contracts\Support\DeferrableProvider; use Illuminate\Support\ServiceProvider; -use Yoti\DocScan\DocScanClient; +use Yoti\IDV\IDVClient; -class YotiDocScanServiceProvider extends ServiceProvider implements DeferrableProvider +class YotiIDVServiceProvider extends ServiceProvider implements DeferrableProvider { /** * @return void */ public function register() { - $this->app->singleton(DocScanClient::class, function ($app) { + $this->app->singleton(IDVClient::class, function ($app) { $config = $app['config']['yoti']; - return new DocScanClient($config['client.sdk.id'], $config['pem.file.path']); + return new IDVClient($config['client.sdk.id'], $config['pem.file.path']); }); } @@ -25,6 +25,6 @@ public function register() */ public function provides() { - return [DocScanClient::class]; + return [IDVClient::class]; } } diff --git a/examples/doc-scan/config/app.php b/examples/doc-scan/config/app.php index 44f7b0fc..b39dc734 100644 --- a/examples/doc-scan/config/app.php +++ b/examples/doc-scan/config/app.php @@ -169,7 +169,7 @@ /* * Application Service Providers... */ - App\Providers\YotiDocScanServiceProvider::class, + App\Providers\YotiIDVServiceProvider::class, App\Providers\RouteServiceProvider::class, ], diff --git a/src/DocScan/Exception/DocScanException.php b/src/DocScan/Exception/DocScanException.php deleted file mode 100644 index cea107db..00000000 --- a/src/DocScan/Exception/DocScanException.php +++ /dev/null @@ -1,11 +0,0 @@ - - * The {@code DocScanClient} is to be used by clients to facilitate + * The {@code IDVClient} is to be used by clients to facilitate * requests to the Yoti Doc Scan system where any signed requests are * required. Using the supplied models, clients can build requests * and perform the requests to the Doc Scan system. */ -class DocScanClient +class IDVClient { /** * @var Service */ - private $docScanService; + private $IDVService; /** - * DocScanClient constructor. + * IDVClient constructor. * * @param string $sdkId * The SDK identifier generated by Yoti Hub when you create your app. @@ -63,7 +63,7 @@ public function __construct( $config = new Config($options); - $this->docScanService = new Service($sdkId, $pemFile, $config); + $this->IDVService = new Service($sdkId, $pemFile, $config); } /** @@ -72,11 +72,11 @@ public function __construct( * * @param SessionSpecification $sessionSpecification * @return CreateSessionResult - * @throws Exception\DocScanException + * @throws Exception\IDVException */ public function createSession(SessionSpecification $sessionSpecification): CreateSessionResult { - return $this->docScanService->createSession($sessionSpecification); + return $this->IDVService->createSession($sessionSpecification); } /** @@ -84,11 +84,11 @@ public function createSession(SessionSpecification $sessionSpecification): Creat * * @param string $sessionId * @return GetSessionResult - * @throws Exception\DocScanException + * @throws Exception\IDVException */ public function getSession(string $sessionId): GetSessionResult { - return $this->docScanService->retrieveSession($sessionId); + return $this->IDVService->retrieveSession($sessionId); } /** @@ -96,11 +96,11 @@ public function getSession(string $sessionId): GetSessionResult * of its related resources. * * @param string $sessionId - * @throws Exception\DocScanException + * @throws Exception\IDVException */ public function deleteSession(string $sessionId): void { - $this->docScanService->deleteSession($sessionId); + $this->IDVService->deleteSession($sessionId); } /** @@ -110,11 +110,11 @@ public function deleteSession(string $sessionId): void * @param string $sessionId * @param string $mediaId * @return Media|null - * @throws Exception\DocScanException + * @throws Exception\IDVException */ public function getMediaContent(string $sessionId, string $mediaId): ?Media { - return $this->docScanService->getMediaContent($sessionId, $mediaId); + return $this->IDVService->getMediaContent($sessionId, $mediaId); } /** @@ -123,11 +123,11 @@ public function getMediaContent(string $sessionId, string $mediaId): ?Media * * @param string $sessionId * @param string $mediaId - * @throws Exception\DocScanException + * @throws Exception\IDVException */ public function deleteMediaContent(string $sessionId, string $mediaId): void { - $this->docScanService->deleteMediaContent($sessionId, $mediaId); + $this->IDVService->deleteMediaContent($sessionId, $mediaId); } /** @@ -135,11 +135,11 @@ public function deleteMediaContent(string $sessionId, string $mediaId): void * * @param bool $isStrictlyLatin * @return SupportedDocumentsResponse - * @throws Exception\DocScanException + * @throws Exception\IDVException */ public function getSupportedDocuments(bool $isStrictlyLatin = false): SupportedDocumentsResponse { - return $this->docScanService->getSupportedDocuments($isStrictlyLatin); + return $this->IDVService->getSupportedDocuments($isStrictlyLatin); } /** @@ -149,13 +149,13 @@ public function getSupportedDocuments(bool $isStrictlyLatin = false): SupportedD * @param string $sessionId * @param CreateFaceCaptureResourcePayload $createFaceCaptureResourcePayload * @return Session\Retrieve\CreateFaceCaptureResourceResponse - * @throws Exception\DocScanException + * @throws Exception\IDVException */ public function createFaceCaptureResource( string $sessionId, CreateFaceCaptureResourcePayload $createFaceCaptureResourcePayload ): Session\Retrieve\CreateFaceCaptureResourceResponse { - return $this->docScanService->createFaceCaptureResource($sessionId, $createFaceCaptureResourcePayload); + return $this->IDVService->createFaceCaptureResource($sessionId, $createFaceCaptureResourcePayload); } /** @@ -164,14 +164,14 @@ public function createFaceCaptureResource( * @param string $sessionId * @param string $resourceId * @param UploadFaceCaptureImagePayload $uploadFaceCaptureImagePayload - * @throws Exception\DocScanException + * @throws Exception\IDVException */ public function uploadFaceCaptureImage( string $sessionId, string $resourceId, UploadFaceCaptureImagePayload $uploadFaceCaptureImagePayload ): void { - $this->docScanService->uploadFaceCaptureImage($sessionId, $resourceId, $uploadFaceCaptureImagePayload); + $this->IDVService->uploadFaceCaptureImage($sessionId, $resourceId, $uploadFaceCaptureImagePayload); } /** @@ -179,21 +179,21 @@ public function uploadFaceCaptureImage( * * @param string $sessionId * @return SessionConfigurationResponse - * @throws Exception\DocScanException + * @throws Exception\IDVException */ public function getSessionConfiguration(string $sessionId): SessionConfigurationResponse { - return $this->docScanService->fetchSessionConfiguration($sessionId); + return $this->IDVService->fetchSessionConfiguration($sessionId); } /** * Sets the IBV instructions for the given session * - * @throws Exception\DocScanException + * @throws Exception\IDVException */ public function putIbvInstructions(string $sessionId, Instructions $instructions): void { - $this->docScanService->putIbvInstructions($sessionId, $instructions); + $this->IDVService->putIbvInstructions($sessionId, $instructions); } /** @@ -201,11 +201,11 @@ public function putIbvInstructions(string $sessionId, Instructions $instructions * * @param string $sessionId * @return InstructionsResponse - * @throws Exception\DocScanException + * @throws Exception\IDVException */ public function getIbvInstructions(string $sessionId): InstructionsResponse { - return $this->docScanService->getIbvInstructions($sessionId); + return $this->IDVService->getIbvInstructions($sessionId); } /** @@ -213,11 +213,11 @@ public function getIbvInstructions(string $sessionId): InstructionsResponse * * @param string $sessionId * @return Media - * @throws Exception\DocScanException + * @throws Exception\IDVException */ public function getIbvInstructionsPdf(string $sessionId): Media { - return $this->docScanService->getIbvInstructionsPdf($sessionId); + return $this->IDVService->getIbvInstructionsPdf($sessionId); } /** @@ -225,11 +225,11 @@ public function getIbvInstructionsPdf(string $sessionId): Media * * @param string $sessionId * @return ContactProfileResponse - * @throws Exception\DocScanException + * @throws Exception\IDVException */ public function fetchInstructionsContactProfile(string $sessionId): ContactProfileResponse { - return $this->docScanService->fetchInstructionsContactProfile($sessionId); + return $this->IDVService->fetchInstructionsContactProfile($sessionId); } /** @@ -238,10 +238,10 @@ public function fetchInstructionsContactProfile(string $sessionId): ContactProfi * - an email sent directly to the end user, using the email provided in the ContactProfile * - if requested, a backend notification using the configured notification endpoint * - * @throws Exception\DocScanException + * @throws Exception\IDVException */ public function triggerIbvEmailNotification(string $sessionId): void { - $this->docScanService->triggerIbvEmailNotification($sessionId); + $this->IDVService->triggerIbvEmailNotification($sessionId); } } diff --git a/src/DocScan/Service.php b/src/IDV/Service.php similarity index 89% rename from src/DocScan/Service.php rename to src/IDV/Service.php index 9e57feb6..280fcc82 100644 --- a/src/DocScan/Service.php +++ b/src/IDV/Service.php @@ -2,25 +2,25 @@ declare(strict_types=1); -namespace Yoti\DocScan; +namespace Yoti\IDV; use Psr\Http\Message\ResponseInterface; use Yoti\Constants; -use Yoti\DocScan\Exception\DocScanException; -use Yoti\DocScan\Session\Create\CreateSessionResult; -use Yoti\DocScan\Session\Create\FaceCapture\CreateFaceCaptureResourcePayload; -use Yoti\DocScan\Session\Create\FaceCapture\UploadFaceCaptureImagePayload; -use Yoti\DocScan\Session\Create\SessionSpecification; -use Yoti\DocScan\Session\Instructions\Instructions; -use Yoti\DocScan\Session\Retrieve\Configuration\SessionConfigurationResponse; -use Yoti\DocScan\Session\Retrieve\CreateFaceCaptureResourceResponse; -use Yoti\DocScan\Session\Retrieve\GetSessionResult; -use Yoti\DocScan\Session\Retrieve\Instructions\ContactProfileResponse; -use Yoti\DocScan\Session\Retrieve\Instructions\InstructionsResponse; -use Yoti\DocScan\Support\SupportedDocumentsResponse; use Yoti\Http\Payload; use Yoti\Http\Request; use Yoti\Http\RequestBuilder; +use Yoti\IDV\Exception\IDVException; +use Yoti\IDV\Session\Create\CreateSessionResult; +use Yoti\IDV\Session\Create\FaceCapture\CreateFaceCaptureResourcePayload; +use Yoti\IDV\Session\Create\FaceCapture\UploadFaceCaptureImagePayload; +use Yoti\IDV\Session\Create\SessionSpecification; +use Yoti\IDV\Session\Instructions\Instructions; +use Yoti\IDV\Session\Retrieve\Configuration\SessionConfigurationResponse; +use Yoti\IDV\Session\Retrieve\CreateFaceCaptureResourceResponse; +use Yoti\IDV\Session\Retrieve\GetSessionResult; +use Yoti\IDV\Session\Retrieve\Instructions\ContactProfileResponse; +use Yoti\IDV\Session\Retrieve\Instructions\InstructionsResponse; +use Yoti\IDV\Support\SupportedDocumentsResponse; use Yoti\Media\Media; use Yoti\Util\Config; use Yoti\Util\Json; @@ -72,7 +72,7 @@ public function __construct(string $sdkId, PemFile $pemFile, Config $config) * * @return CreateSessionResult * - * @throws DocScanException + * @throws IDVException */ public function createSession(SessionSpecification $sessionSpec): CreateSessionResult { @@ -99,7 +99,7 @@ public function createSession(SessionSpecification $sessionSpec): CreateSessionR * * @param string $sessionId * @return GetSessionResult - * @throws DocScanException + * @throws IDVException */ public function retrieveSession(string $sessionId): GetSessionResult { @@ -123,7 +123,7 @@ public function retrieveSession(string $sessionId): GetSessionResult * Deletes a session from the Yoti Doc Scan system. * * @param string $sessionId - * @throws DocScanException + * @throws IDVException */ public function deleteSession(string $sessionId): void { @@ -146,7 +146,7 @@ public function deleteSession(string $sessionId): void * @param string $sessionId * @param string $mediaId * @return Media|null if 204 No Content - * @throws DocScanException + * @throws IDVException */ public function getMediaContent(string $sessionId, string $mediaId): ?Media { @@ -177,7 +177,7 @@ public function getMediaContent(string $sessionId, string $mediaId): ?Media * * @param string $sessionId * @param string $mediaId - * @throws DocScanException + * @throws IDVException */ public function deleteMediaContent(string $sessionId, string $mediaId): void { @@ -196,7 +196,7 @@ public function deleteMediaContent(string $sessionId, string $mediaId): void /** * @param bool $isStrictlyLatin * @return SupportedDocumentsResponse - * @throws DocScanException + * @throws IDVException */ public function getSupportedDocuments(bool $isStrictlyLatin): SupportedDocumentsResponse { @@ -225,7 +225,7 @@ public function getSupportedDocuments(bool $isStrictlyLatin): SupportedDocuments * @param string $sessionId * @param CreateFaceCaptureResourcePayload $createFaceCaptureResourcePayload * @return CreateFaceCaptureResourceResponse - * @throws DocScanException + * @throws IDVException */ public function createFaceCaptureResource( string $sessionId, @@ -252,7 +252,7 @@ public function createFaceCaptureResource( * @param string $sessionId * @param string $resourceId * @param UploadFaceCaptureImagePayload $faceCaptureImagePayload - * @throws DocScanException + * @throws IDVException */ public function uploadFaceCaptureImage( string $sessionId, @@ -281,7 +281,7 @@ public function uploadFaceCaptureImage( /** * @param string $sessionId * @return SessionConfigurationResponse - * @throws DocScanException + * @throws IDVException */ public function fetchSessionConfiguration(string $sessionId): SessionConfigurationResponse { @@ -304,7 +304,7 @@ public function fetchSessionConfiguration(string $sessionId): SessionConfigurati /** * @param string $sessionId * @param Instructions $instructions - * @throws DocScanException + * @throws IDVException */ public function putIbvInstructions(string $sessionId, Instructions $instructions): void { @@ -323,7 +323,7 @@ public function putIbvInstructions(string $sessionId, Instructions $instructions /** * @param string $sessionId * @return InstructionsResponse - * @throws DocScanException + * @throws IDVException */ public function getIbvInstructions(string $sessionId): InstructionsResponse { @@ -345,7 +345,7 @@ public function getIbvInstructions(string $sessionId): InstructionsResponse /** * @param string $sessionId * @return Media - * @throws DocScanException + * @throws IDVException */ public function getIbvInstructionsPdf(string $sessionId): Media { @@ -368,7 +368,7 @@ public function getIbvInstructionsPdf(string $sessionId): Media /** * @param string $sessionId * @return ContactProfileResponse - * @throws DocScanException + * @throws IDVException */ public function fetchInstructionsContactProfile(string $sessionId): ContactProfileResponse { @@ -389,7 +389,7 @@ public function fetchInstructionsContactProfile(string $sessionId): ContactProfi /** * @param string $sessionId - * @throws DocScanException + * @throws IDVException */ public function triggerIbvEmailNotification(string $sessionId): void { @@ -407,13 +407,13 @@ public function triggerIbvEmailNotification(string $sessionId): void /** * @param ResponseInterface $response * - * @throws DocScanException + * @throws IDVException */ private static function assertResponseIsSuccess(ResponseInterface $response): void { $httpCode = $response->getStatusCode(); if ($httpCode < 200 || $httpCode > 299) { - throw new DocScanException("Server responded with {$httpCode}", $response); + throw new IDVException("Server responded with {$httpCode}", $response); } } } diff --git a/src/DocScan/Session/Create/AttemptsConfiguration.php b/src/IDV/Session/Create/AttemptsConfiguration.php similarity index 94% rename from src/DocScan/Session/Create/AttemptsConfiguration.php rename to src/IDV/Session/Create/AttemptsConfiguration.php index aa23dcf5..2d55401b 100644 --- a/src/DocScan/Session/Create/AttemptsConfiguration.php +++ b/src/IDV/Session/Create/AttemptsConfiguration.php @@ -1,6 +1,6 @@ $sessionData * * @throws \Yoti\Exception\DateTimeException diff --git a/src/DocScan/Session/Retrieve/IdDocumentComparisonCheckResponse.php b/src/IDV/Session/Retrieve/IdDocumentComparisonCheckResponse.php similarity index 70% rename from src/DocScan/Session/Retrieve/IdDocumentComparisonCheckResponse.php rename to src/IDV/Session/Retrieve/IdDocumentComparisonCheckResponse.php index 0f089198..8f88bfe1 100644 --- a/src/DocScan/Session/Retrieve/IdDocumentComparisonCheckResponse.php +++ b/src/IDV/Session/Retrieve/IdDocumentComparisonCheckResponse.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Yoti\DocScan\Session\Retrieve; +namespace Yoti\IDV\Session\Retrieve; class IdDocumentComparisonCheckResponse extends CheckResponse { diff --git a/src/DocScan/Session/Retrieve/IdDocumentResourceResponse.php b/src/IDV/Session/Retrieve/IdDocumentResourceResponse.php similarity index 98% rename from src/DocScan/Session/Retrieve/IdDocumentResourceResponse.php rename to src/IDV/Session/Retrieve/IdDocumentResourceResponse.php index b6e7f46a..2c0c9194 100644 --- a/src/DocScan/Session/Retrieve/IdDocumentResourceResponse.php +++ b/src/IDV/Session/Retrieve/IdDocumentResourceResponse.php @@ -1,6 +1,6 @@ expectException(\InvalidArgumentException::class); $this->expectExceptionMessage("SDK ID cannot be empty"); - new DocScanClient('', TestData::PEM_FILE); + new IDVClient('', TestData::PEM_FILE); } /** @@ -108,7 +108,7 @@ private function assertApiUrlStartsWith($expectedUrl, $clientApiUrl = null) })) ->willReturn($response); - $docScanClient = new DocScanClient(TestData::SDK_ID, TestData::PEM_FILE, [ + $IDVClient = new IDVClient(TestData::SDK_ID, TestData::PEM_FILE, [ Config::HTTP_CLIENT => $httpClient, Config::API_URL => $clientApiUrl, ]); @@ -116,7 +116,7 @@ private function assertApiUrlStartsWith($expectedUrl, $clientApiUrl = null) $sessionSpecificationMock = $this->createMock(SessionSpecification::class); $sessionSpecificationMock->method('jsonSerialize')->willReturn(new \stdClass()); - $docScanClient->createSession($sessionSpecificationMock); + $IDVClient->createSession($sessionSpecificationMock); } /** @@ -135,7 +135,7 @@ public function testCreateSession() ->method('sendRequest') ->willReturn($response); - $docScanClient = new DocScanClient(TestData::SDK_ID, TestData::PEM_FILE, [ + $IDVClient = new IDVClient(TestData::SDK_ID, TestData::PEM_FILE, [ Config::HTTP_CLIENT => $httpClient, ]); @@ -144,7 +144,7 @@ public function testCreateSession() $this->assertInstanceOf( CreateSessionResult::class, - $docScanClient->createSession($sessionSpecificationMock) + $IDVClient->createSession($sessionSpecificationMock) ); } @@ -164,13 +164,13 @@ public function testGetSession() ->method('sendRequest') ->willReturn($response); - $docScanClient = new DocScanClient(TestData::SDK_ID, TestData::PEM_FILE, [ + $IDVClient = new IDVClient(TestData::SDK_ID, TestData::PEM_FILE, [ Config::HTTP_CLIENT => $httpClient, ]); $this->assertInstanceOf( GetSessionResult::class, - $docScanClient->getSession(TestData::DOC_SCAN_SESSION_ID) + $IDVClient->getSession(TestData::DOC_SCAN_SESSION_ID) ); } @@ -189,11 +189,11 @@ public function testDeleteSessionDoesNotThrowException() ->method('sendRequest') ->willReturn($response); - $docScanClient = new DocScanClient(TestData::SDK_ID, TestData::PEM_FILE, [ + $IDVClient = new IDVClient(TestData::SDK_ID, TestData::PEM_FILE, [ Config::HTTP_CLIENT => $httpClient, ]); - $docScanClient->deleteSession(TestData::DOC_SCAN_SESSION_ID); + $IDVClient->deleteSession(TestData::DOC_SCAN_SESSION_ID); } /** @@ -213,13 +213,13 @@ public function testGetMedia() ->method('sendRequest') ->willReturn($response); - $docScanClient = new DocScanClient(TestData::SDK_ID, TestData::PEM_FILE, [ + $IDVClient = new IDVClient(TestData::SDK_ID, TestData::PEM_FILE, [ Config::HTTP_CLIENT => $httpClient, ]); $this->assertInstanceOf( Media::class, - $docScanClient->getMediaContent(TestData::DOC_SCAN_SESSION_ID, TestData::DOC_SCAN_MEDIA_ID) + $IDVClient->getMediaContent(TestData::DOC_SCAN_SESSION_ID, TestData::DOC_SCAN_MEDIA_ID) ); } @@ -239,12 +239,12 @@ public function testGetMediaIfNoContent() ->method('sendRequest') ->willReturn($response); - $docScanClient = new DocScanClient(TestData::SDK_ID, TestData::PEM_FILE, [ + $IDVClient = new IDVClient(TestData::SDK_ID, TestData::PEM_FILE, [ Config::HTTP_CLIENT => $httpClient, ]); $this->assertNull( - $docScanClient->getMediaContent(TestData::DOC_SCAN_SESSION_ID, TestData::DOC_SCAN_MEDIA_ID) + $IDVClient->getMediaContent(TestData::DOC_SCAN_SESSION_ID, TestData::DOC_SCAN_MEDIA_ID) ); } @@ -263,11 +263,11 @@ public function testDeleteMediaDoesNotThrowException() ->method('sendRequest') ->willReturn($response); - $docScanClient = new DocScanClient(TestData::SDK_ID, TestData::PEM_FILE, [ + $IDVClient = new IDVClient(TestData::SDK_ID, TestData::PEM_FILE, [ Config::HTTP_CLIENT => $httpClient, ]); - $docScanClient->deleteMediaContent(TestData::DOC_SCAN_SESSION_ID, TestData::DOC_SCAN_MEDIA_ID); + $IDVClient->deleteMediaContent(TestData::DOC_SCAN_SESSION_ID, TestData::DOC_SCAN_MEDIA_ID); } /** @@ -285,13 +285,13 @@ public function testGetSupportedDocuments() ->method('sendRequest') ->willReturn($response); - $docScanClient = new DocScanClient(TestData::SDK_ID, TestData::PEM_FILE, [ + $IDVClient = new IDVClient(TestData::SDK_ID, TestData::PEM_FILE, [ Config::HTTP_CLIENT => $httpClient, ]); $this->assertInstanceOf( SupportedDocumentsResponse::class, - $docScanClient->getSupportedDocuments() + $IDVClient->getSupportedDocuments() ); } @@ -312,13 +312,13 @@ public function testCreateFaceCaptureResource() ->method('sendRequest') ->willReturn($response); - $docScanClient = new DocScanClient(TestData::SDK_ID, TestData::PEM_FILE, [ + $IDVClient = new IDVClient(TestData::SDK_ID, TestData::PEM_FILE, [ Config::HTTP_CLIENT => $httpClient, ]); $this->assertInstanceOf( CreateFaceCaptureResourceResponse::class, - $docScanClient->createFaceCaptureResource( + $IDVClient->createFaceCaptureResource( TestData::DOC_SCAN_SESSION_ID, $createFaceCaptureResourcePayloadMock ) @@ -341,11 +341,11 @@ public function testUploadFaceCaptureImage() ->method('sendRequest') ->willReturn($response); - $docScanClient = new DocScanClient(TestData::SDK_ID, TestData::PEM_FILE, [ + $IDVClient = new IDVClient(TestData::SDK_ID, TestData::PEM_FILE, [ Config::HTTP_CLIENT => $httpClient, ]); - $docScanClient->uploadFaceCaptureImage( + $IDVClient->uploadFaceCaptureImage( TestData::DOC_SCAN_SESSION_ID, TestData::SOME_RESOURCE_ID, $uploadFaceCaptureImagePayloadMock @@ -367,13 +367,13 @@ public function testGetSessionConfiguration() ->method('sendRequest') ->willReturn($response); - $docScanClient = new DocScanClient(TestData::SDK_ID, TestData::PEM_FILE, [ + $IDVClient = new IDVClient(TestData::SDK_ID, TestData::PEM_FILE, [ Config::HTTP_CLIENT => $httpClient, ]); $this->assertInstanceOf( SessionConfigurationResponse::class, - $docScanClient->getSessionConfiguration(TestData::DOC_SCAN_SESSION_ID) + $IDVClient->getSessionConfiguration(TestData::DOC_SCAN_SESSION_ID) ); } @@ -393,11 +393,11 @@ public function testPutIbvInstructions() ->method('sendRequest') ->willReturn($response); - $docScanClient = new DocScanClient(TestData::SDK_ID, TestData::PEM_FILE, [ + $IDVClient = new IDVClient(TestData::SDK_ID, TestData::PEM_FILE, [ Config::HTTP_CLIENT => $httpClient, ]); - $docScanClient->putIbvInstructions( + $IDVClient->putIbvInstructions( TestData::DOC_SCAN_SESSION_ID, $instructionsMock ); @@ -418,11 +418,11 @@ public function testGetIbvInstructions() ->method('sendRequest') ->willReturn($response); - $docScanClient = new DocScanClient(TestData::SDK_ID, TestData::PEM_FILE, [ + $IDVClient = new IDVClient(TestData::SDK_ID, TestData::PEM_FILE, [ Config::HTTP_CLIENT => $httpClient, ]); - $docScanClient->getIbvInstructions( + $IDVClient->getIbvInstructions( TestData::DOC_SCAN_SESSION_ID ); } @@ -442,11 +442,11 @@ public function testGetIbvInstructionsPdf() ->method('sendRequest') ->willReturn($response); - $docScanClient = new DocScanClient(TestData::SDK_ID, TestData::PEM_FILE, [ + $IDVClient = new IDVClient(TestData::SDK_ID, TestData::PEM_FILE, [ Config::HTTP_CLIENT => $httpClient, ]); - $docScanClient->getIbvInstructionsPdf( + $IDVClient->getIbvInstructionsPdf( TestData::DOC_SCAN_SESSION_ID ); } @@ -466,11 +466,11 @@ public function testFetchInstructionsContactProfile() ->method('sendRequest') ->willReturn($response); - $docScanClient = new DocScanClient(TestData::SDK_ID, TestData::PEM_FILE, [ + $IDVClient = new IDVClient(TestData::SDK_ID, TestData::PEM_FILE, [ Config::HTTP_CLIENT => $httpClient, ]); - $docScanClient->fetchInstructionsContactProfile( + $IDVClient->fetchInstructionsContactProfile( TestData::DOC_SCAN_SESSION_ID ); } @@ -490,11 +490,11 @@ public function testTriggerIbvEmailNotification() ->method('sendRequest') ->willReturn($response); - $docScanClient = new DocScanClient(TestData::SDK_ID, TestData::PEM_FILE, [ + $IDVClient = new IDVClient(TestData::SDK_ID, TestData::PEM_FILE, [ Config::HTTP_CLIENT => $httpClient, ]); - $docScanClient->triggerIbvEmailNotification( + $IDVClient->triggerIbvEmailNotification( TestData::DOC_SCAN_SESSION_ID ); } diff --git a/tests/DocScan/Exception/DocScanExceptionTest.php b/tests/DocScan/Exception/DocScanExceptionTest.php index a6c67307..f335190c 100644 --- a/tests/DocScan/Exception/DocScanExceptionTest.php +++ b/tests/DocScan/Exception/DocScanExceptionTest.php @@ -1,13 +1,13 @@ assertEquals(self::SOME_MESSAGE, $docScanException->getMessage()); + $IDVException = new IDVException(self::SOME_MESSAGE); + $this->assertEquals(self::SOME_MESSAGE, $IDVException->getMessage()); } /** @@ -33,9 +33,9 @@ public function shouldStoreResponse() { $responseMock = $this->createMock(ResponseInterface::class); - $docScanException = new DocScanException(self::SOME_MESSAGE, $responseMock); - $this->assertEquals(self::SOME_MESSAGE, $docScanException->getMessage()); - $this->assertSame($responseMock, $docScanException->getResponse()); + $IDVException = new IDVException(self::SOME_MESSAGE, $responseMock); + $this->assertEquals(self::SOME_MESSAGE, $IDVException->getMessage()); + $this->assertSame($responseMock, $IDVException->getResponse()); } /** @@ -47,10 +47,10 @@ public function shouldExcludeNonJsonResponsesFromMessage() $responseMock->method('hasHeader')->willReturn(true); $responseMock->method('getHeader')->willReturn(['text/html']); - $docScanException = new DocScanException(self::SOME_MESSAGE, $responseMock); + $IDVException = new IDVException(self::SOME_MESSAGE, $responseMock); - $this->assertEquals(self::SOME_MESSAGE, $docScanException->getMessage()); - $this->assertEquals($responseMock, $docScanException->getResponse()); + $this->assertEquals(self::SOME_MESSAGE, $IDVException->getMessage()); + $this->assertEquals($responseMock, $IDVException->getResponse()); } /** @@ -65,10 +65,10 @@ public function shouldIncludeFormattedResponseInMessage($message, $jsonData, $ex $responseMock->method('getHeader')->willReturn(['application/json']); $responseMock->method('getBody')->willReturn(Psr7\Utils::streamFor(json_encode($jsonData))); - $docScanException = new DocScanException($message, $responseMock); + $IDVException = new IDVException($message, $responseMock); - $this->assertEquals($expectedMessage, $docScanException->getMessage()); - $this->assertEquals($responseMock, $docScanException->getResponse()); + $this->assertEquals($expectedMessage, $IDVException->getMessage()); + $this->assertEquals($responseMock, $IDVException->getResponse()); } /** diff --git a/tests/DocScan/ServiceTest.php b/tests/DocScan/ServiceTest.php index 5d2d48cd..16652e1f 100644 --- a/tests/DocScan/ServiceTest.php +++ b/tests/DocScan/ServiceTest.php @@ -2,25 +2,25 @@ declare(strict_types=1); -namespace Yoti\Test\DocScan; +namespace Yoti\Test\IDV; use GuzzleHttp\Psr7; use Psr\Http\Client\ClientInterface; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; -use Yoti\DocScan\Exception\DocScanException; -use Yoti\DocScan\Service; -use Yoti\DocScan\Session\Create\CreateSessionResult; -use Yoti\DocScan\Session\Create\FaceCapture\CreateFaceCaptureResourcePayload; -use Yoti\DocScan\Session\Create\FaceCapture\UploadFaceCaptureImagePayload; -use Yoti\DocScan\Session\Create\SessionSpecification; -use Yoti\DocScan\Session\Instructions\Instructions; -use Yoti\DocScan\Session\Retrieve\Configuration\SessionConfigurationResponse; -use Yoti\DocScan\Session\Retrieve\CreateFaceCaptureResourceResponse; -use Yoti\DocScan\Session\Retrieve\GetSessionResult; -use Yoti\DocScan\Session\Retrieve\Instructions\ContactProfileResponse; -use Yoti\DocScan\Support\SupportedDocumentsResponse; use Yoti\Exception\PemFileException; +use Yoti\IDV\Exception\IDVException; +use Yoti\IDV\Service; +use Yoti\IDV\Session\Create\CreateSessionResult; +use Yoti\IDV\Session\Create\FaceCapture\CreateFaceCaptureResourcePayload; +use Yoti\IDV\Session\Create\FaceCapture\UploadFaceCaptureImagePayload; +use Yoti\IDV\Session\Create\SessionSpecification; +use Yoti\IDV\Session\Instructions\Instructions; +use Yoti\IDV\Session\Retrieve\Configuration\SessionConfigurationResponse; +use Yoti\IDV\Session\Retrieve\CreateFaceCaptureResourceResponse; +use Yoti\IDV\Session\Retrieve\GetSessionResult; +use Yoti\IDV\Session\Retrieve\Instructions\ContactProfileResponse; +use Yoti\IDV\Support\SupportedDocumentsResponse; use Yoti\Media\Media; use Yoti\Test\TestCase; use Yoti\Test\TestData; @@ -28,7 +28,7 @@ use Yoti\Util\PemFile; /** - * @coversDefaultClass \Yoti\DocScan\Service + * @coversDefaultClass \Yoti\IDV\Service */ class ServiceTest extends TestCase { @@ -68,7 +68,7 @@ function (RequestInterface $requestMessage) { ) ->willReturn($this->createResponse(201, file_get_contents(TestData::DOC_SCAN_SESSION_RESPONSE))); - $docScanService = new Service( + $IDVService = new Service( TestData::SDK_ID, PemFile::fromFilePath(TestData::PEM_FILE), new Config( @@ -80,7 +80,7 @@ function (RequestInterface $requestMessage) { $this->assertInstanceOf( CreateSessionResult::class, - $docScanService->createSession($sessionSpecificationMock) + $IDVService->createSession($sessionSpecificationMock) ); } @@ -140,7 +140,7 @@ function (RequestInterface $requestMessage) { ) ->willReturn($this->createResponse(400)); - $docScanService = new Service( + $IDVService = new Service( TestData::SDK_ID, PemFile::fromFilePath(TestData::PEM_FILE), new Config( @@ -150,10 +150,10 @@ function (RequestInterface $requestMessage) { ) ); - $this->expectException(DocScanException::class); + $this->expectException(IDVException::class); $this->expectExceptionMessage("Server responded with 400"); - $docScanService->createSession($sessionSpecificationMock); + $IDVService->createSession($sessionSpecificationMock); } /** @@ -162,7 +162,7 @@ function (RequestInterface $requestMessage) { * @covers ::retrieveSession * @covers ::assertResponseIsSuccess */ - public function retrieveSessionShouldReturnDocScanSessionOnSuccessfulCall() + public function retrieveSessionShouldReturnIDVSessionOnSuccessfulCall() { $httpClient = $this->createMock(ClientInterface::class); $httpClient->expects($this->exactly(1)) @@ -185,7 +185,7 @@ function (RequestInterface $requestMessage) { ) ->willReturn($this->createResponse(200, file_get_contents(TestData::DOC_SCAN_SESSION_CREATION_RESPONSE))); - $docScanService = new Service( + $IDVService = new Service( TestData::SDK_ID, PemFile::fromFilePath(TestData::PEM_FILE), new Config( @@ -197,7 +197,7 @@ function (RequestInterface $requestMessage) { $this->assertInstanceOf( GetSessionResult::class, - $docScanService->retrieveSession(TestData::DOC_SCAN_SESSION_ID) + $IDVService->retrieveSession(TestData::DOC_SCAN_SESSION_ID) ); } @@ -230,7 +230,7 @@ function (RequestInterface $requestMessage) { ) ->willReturn($this->createResponse(404)); - $docScanService = new Service( + $IDVService = new Service( TestData::SDK_ID, PemFile::fromFilePath(TestData::PEM_FILE), new Config( @@ -240,10 +240,10 @@ function (RequestInterface $requestMessage) { ) ); - $this->expectException(DocScanException::class); + $this->expectException(IDVException::class); $this->expectExceptionMessage("Server responded with 404"); - $docScanService->retrieveSession(TestData::DOC_SCAN_SESSION_ID); + $IDVService->retrieveSession(TestData::DOC_SCAN_SESSION_ID); } /** @@ -275,7 +275,7 @@ function (RequestInterface $requestMessage) { ) ->willReturn($this->createResponse(200, file_get_contents(TestData::DOC_SCAN_SESSION_CREATION_RESPONSE))); - $docScanService = new Service( + $IDVService = new Service( TestData::SDK_ID, PemFile::fromFilePath(TestData::PEM_FILE), new Config( @@ -285,7 +285,7 @@ function (RequestInterface $requestMessage) { ) ); - $docScanService->deleteSession(TestData::DOC_SCAN_SESSION_ID); + $IDVService->deleteSession(TestData::DOC_SCAN_SESSION_ID); } /** @@ -317,7 +317,7 @@ function (RequestInterface $requestMessage) { ) ->willReturn($this->createResponse(404)); - $docScanService = new Service( + $IDVService = new Service( TestData::SDK_ID, PemFile::fromFilePath(TestData::PEM_FILE), new Config( @@ -327,10 +327,10 @@ function (RequestInterface $requestMessage) { ) ); - $this->expectException(DocScanException::class); + $this->expectException(IDVException::class); $this->expectExceptionMessage("Server responded with 404"); - $docScanService->deleteSession(TestData::DOC_SCAN_SESSION_ID); + $IDVService->deleteSession(TestData::DOC_SCAN_SESSION_ID); } /** @@ -373,7 +373,7 @@ function (RequestInterface $requestMessage) { ) ); - $docScanService = new Service( + $IDVService = new Service( TestData::SDK_ID, PemFile::fromFilePath(TestData::PEM_FILE), new Config( @@ -385,7 +385,7 @@ function (RequestInterface $requestMessage) { $this->assertInstanceOf( Media::class, - $docScanService->getMediaContent(TestData::DOC_SCAN_SESSION_ID, TestData::DOC_SCAN_MEDIA_ID) + $IDVService->getMediaContent(TestData::DOC_SCAN_SESSION_ID, TestData::DOC_SCAN_MEDIA_ID) ); } @@ -408,7 +408,7 @@ public function getMediaContentShouldReturnNullWhenResponseWithNoContent() ) ); - $docScanService = new Service( + $IDVService = new Service( TestData::SDK_ID, PemFile::fromFilePath(TestData::PEM_FILE), new Config( @@ -418,7 +418,7 @@ public function getMediaContentShouldReturnNullWhenResponseWithNoContent() ) ); - $media = $docScanService->getMediaContent(TestData::DOC_SCAN_SESSION_ID, TestData::DOC_SCAN_MEDIA_ID); + $media = $IDVService->getMediaContent(TestData::DOC_SCAN_SESSION_ID, TestData::DOC_SCAN_MEDIA_ID); $this->assertNull($media); } @@ -456,7 +456,7 @@ function (RequestInterface $requestMessage) { ) ); - $docScanService = new Service( + $IDVService = new Service( TestData::SDK_ID, PemFile::fromFilePath(TestData::PEM_FILE), new Config( @@ -466,10 +466,10 @@ function (RequestInterface $requestMessage) { ) ); - $this->expectException(DocScanException::class); + $this->expectException(IDVException::class); $this->expectExceptionMessage("Server responded with 404"); - $docScanService->getMediaContent(TestData::DOC_SCAN_SESSION_ID, TestData::DOC_SCAN_MEDIA_ID); + $IDVService->getMediaContent(TestData::DOC_SCAN_SESSION_ID, TestData::DOC_SCAN_MEDIA_ID); } /** @@ -502,7 +502,7 @@ function (RequestInterface $requestMessage) { ) ->willReturn($this->createResponse(200, file_get_contents(TestData::DOC_SCAN_SESSION_CREATION_RESPONSE))); - $docScanService = new Service( + $IDVService = new Service( TestData::SDK_ID, PemFile::fromFilePath(TestData::PEM_FILE), new Config( @@ -512,7 +512,7 @@ function (RequestInterface $requestMessage) { ) ); - $docScanService->deleteMediaContent(TestData::DOC_SCAN_SESSION_ID, TestData::DOC_SCAN_MEDIA_ID); + $IDVService->deleteMediaContent(TestData::DOC_SCAN_SESSION_ID, TestData::DOC_SCAN_MEDIA_ID); } /** @@ -545,7 +545,7 @@ function (RequestInterface $requestMessage) { ) ->willReturn($this->createResponse(404)); - $docScanService = new Service( + $IDVService = new Service( TestData::SDK_ID, PemFile::fromFilePath(TestData::PEM_FILE), new Config( @@ -555,10 +555,10 @@ function (RequestInterface $requestMessage) { ) ); - $this->expectException(DocScanException::class); + $this->expectException(IDVException::class); $this->expectExceptionMessage("Server responded with 404"); - $docScanService->deleteMediaContent(TestData::DOC_SCAN_SESSION_ID, TestData::DOC_SCAN_MEDIA_ID); + $IDVService->deleteMediaContent(TestData::DOC_SCAN_SESSION_ID, TestData::DOC_SCAN_MEDIA_ID); } /** @@ -589,7 +589,7 @@ function (RequestInterface $requestMessage) { ) ->willReturn($this->createResponse(200, json_encode((object)[]))); - $docScanService = new Service( + $IDVService = new Service( TestData::SDK_ID, PemFile::fromFilePath(TestData::PEM_FILE), new Config( @@ -601,7 +601,7 @@ function (RequestInterface $requestMessage) { $this->assertInstanceOf( SupportedDocumentsResponse::class, - $docScanService->getSupportedDocuments(TestData::INCLUDE_NON_LATIN) + $IDVService->getSupportedDocuments(TestData::INCLUDE_NON_LATIN) ); } @@ -633,7 +633,7 @@ function (RequestInterface $requestMessage) { ) ->willReturn($this->createResponse(404)); - $docScanService = new Service( + $IDVService = new Service( TestData::SDK_ID, PemFile::fromFilePath(TestData::PEM_FILE), new Config( @@ -643,10 +643,10 @@ function (RequestInterface $requestMessage) { ) ); - $this->expectException(DocScanException::class); + $this->expectException(IDVException::class); $this->expectExceptionMessage("Server responded with 404"); - $docScanService->getSupportedDocuments(TestData::INCLUDE_NON_LATIN); + $IDVService->getSupportedDocuments(TestData::INCLUDE_NON_LATIN); } /** @@ -678,7 +678,7 @@ function (RequestInterface $requestMessage) { ) ->willReturn($this->createResponse(201, json_encode((object)[]))); - $docScanService = new Service( + $IDVService = new Service( TestData::SDK_ID, PemFile::fromFilePath(TestData::PEM_FILE), new Config( @@ -690,7 +690,7 @@ function (RequestInterface $requestMessage) { $this->assertInstanceOf( CreateFaceCaptureResourceResponse::class, - $docScanService->createFaceCaptureResource( + $IDVService->createFaceCaptureResource( TestData::DOC_SCAN_SESSION_ID, $createFaceCaptureResourcePayloadMock ) @@ -726,7 +726,7 @@ function (RequestInterface $requestMessage) { ) ->willReturn($this->createResponse(404)); - $docScanService = new Service( + $IDVService = new Service( TestData::SDK_ID, PemFile::fromFilePath(TestData::PEM_FILE), new Config( @@ -736,10 +736,10 @@ function (RequestInterface $requestMessage) { ) ); - $this->expectException(DocScanException::class); + $this->expectException(IDVException::class); $this->expectExceptionMessage("Server responded with 404"); - $docScanService->createFaceCaptureResource( + $IDVService->createFaceCaptureResource( TestData::DOC_SCAN_SESSION_ID, $createFaceCaptureResourcePayloadMock ); @@ -775,7 +775,7 @@ function (RequestInterface $requestMessage) { ) ->willReturn($this->createResponse(200)); - $docScanService = new Service( + $IDVService = new Service( TestData::SDK_ID, PemFile::fromFilePath(TestData::PEM_FILE), new Config( @@ -785,7 +785,7 @@ function (RequestInterface $requestMessage) { ) ); - $docScanService->uploadFaceCaptureImage( + $IDVService->uploadFaceCaptureImage( TestData::DOC_SCAN_SESSION_ID, TestData::SOME_RESOURCE_ID, $uploadFaceCaptureImagePayloadMock @@ -822,7 +822,7 @@ function (RequestInterface $requestMessage) { ) ->willReturn($this->createResponse(404)); - $docScanService = new Service( + $IDVService = new Service( TestData::SDK_ID, PemFile::fromFilePath(TestData::PEM_FILE), new Config( @@ -832,10 +832,10 @@ function (RequestInterface $requestMessage) { ) ); - $this->expectException(DocScanException::class); + $this->expectException(IDVException::class); $this->expectExceptionMessage("Server responded with 404"); - $docScanService->uploadFaceCaptureImage( + $IDVService->uploadFaceCaptureImage( TestData::DOC_SCAN_SESSION_ID, TestData::SOME_RESOURCE_ID, $uploadFaceCaptureImagePayloadMock @@ -870,7 +870,7 @@ function (RequestInterface $requestMessage) { ) ->willReturn($this->createResponse(200, json_encode((object)[]))); - $docScanService = new Service( + $IDVService = new Service( TestData::SDK_ID, PemFile::fromFilePath(TestData::PEM_FILE), new Config( @@ -882,7 +882,7 @@ function (RequestInterface $requestMessage) { $this->assertInstanceOf( SessionConfigurationResponse::class, - $docScanService->fetchSessionConfiguration(TestData::DOC_SCAN_SESSION_ID) + $IDVService->fetchSessionConfiguration(TestData::DOC_SCAN_SESSION_ID) ); } @@ -914,7 +914,7 @@ function (RequestInterface $requestMessage) { ) ->willReturn($this->createResponse(404)); - $docScanService = new Service( + $IDVService = new Service( TestData::SDK_ID, PemFile::fromFilePath(TestData::PEM_FILE), new Config( @@ -924,10 +924,10 @@ function (RequestInterface $requestMessage) { ) ); - $this->expectException(DocScanException::class); + $this->expectException(IDVException::class); $this->expectExceptionMessage("Server responded with 404"); - $docScanService->fetchSessionConfiguration(TestData::DOC_SCAN_SESSION_ID); + $IDVService->fetchSessionConfiguration(TestData::DOC_SCAN_SESSION_ID); } /** @@ -959,7 +959,7 @@ function (RequestInterface $requestMessage) { ) ->willReturn($this->createResponse(200)); - $docScanService = new Service( + $IDVService = new Service( TestData::SDK_ID, PemFile::fromFilePath(TestData::PEM_FILE), new Config( @@ -969,7 +969,7 @@ function (RequestInterface $requestMessage) { ) ); - $docScanService->putIbvInstructions( + $IDVService->putIbvInstructions( TestData::DOC_SCAN_SESSION_ID, $instructionsMock ); @@ -1004,7 +1004,7 @@ function (RequestInterface $requestMessage) { ) ->willReturn($this->createResponse(404)); - $docScanService = new Service( + $IDVService = new Service( TestData::SDK_ID, PemFile::fromFilePath(TestData::PEM_FILE), new Config( @@ -1014,10 +1014,10 @@ function (RequestInterface $requestMessage) { ) ); - $this->expectException(DocScanException::class); + $this->expectException(IDVException::class); $this->expectExceptionMessage("Server responded with 404"); - $docScanService->putIbvInstructions( + $IDVService->putIbvInstructions( TestData::DOC_SCAN_SESSION_ID, $instructionsMock ); @@ -1051,7 +1051,7 @@ function (RequestInterface $requestMessage) { ) ->willReturn($this->createResponse(200)); - $docScanService = new Service( + $IDVService = new Service( TestData::SDK_ID, PemFile::fromFilePath(TestData::PEM_FILE), new Config( @@ -1061,7 +1061,7 @@ function (RequestInterface $requestMessage) { ) ); - $docScanService->getIbvInstructions( + $IDVService->getIbvInstructions( TestData::DOC_SCAN_SESSION_ID ); } @@ -1094,7 +1094,7 @@ function (RequestInterface $requestMessage) { ) ->willReturn($this->createResponse(404)); - $docScanService = new Service( + $IDVService = new Service( TestData::SDK_ID, PemFile::fromFilePath(TestData::PEM_FILE), new Config( @@ -1104,10 +1104,10 @@ function (RequestInterface $requestMessage) { ) ); - $this->expectException(DocScanException::class); + $this->expectException(IDVException::class); $this->expectExceptionMessage("Server responded with 404"); - $docScanService->getIbvInstructions( + $IDVService->getIbvInstructions( TestData::DOC_SCAN_SESSION_ID ); } @@ -1150,7 +1150,7 @@ function (RequestInterface $requestMessage) { ) ); - $docScanService = new Service( + $IDVService = new Service( TestData::SDK_ID, PemFile::fromFilePath(TestData::PEM_FILE), new Config( @@ -1162,7 +1162,7 @@ function (RequestInterface $requestMessage) { $this->assertInstanceOf( Media::class, - $docScanService->getIbvInstructionsPdf(TestData::DOC_SCAN_SESSION_ID) + $IDVService->getIbvInstructionsPdf(TestData::DOC_SCAN_SESSION_ID) ); } @@ -1198,7 +1198,7 @@ function (RequestInterface $requestMessage) { ) ); - $docScanService = new Service( + $IDVService = new Service( TestData::SDK_ID, PemFile::fromFilePath(TestData::PEM_FILE), new Config( @@ -1208,10 +1208,10 @@ function (RequestInterface $requestMessage) { ) ); - $this->expectException(DocScanException::class); + $this->expectException(IDVException::class); $this->expectExceptionMessage("Server responded with 404"); - $docScanService->getIbvInstructionsPdf(TestData::DOC_SCAN_SESSION_ID); + $IDVService->getIbvInstructionsPdf(TestData::DOC_SCAN_SESSION_ID); } /** @@ -1219,7 +1219,7 @@ function (RequestInterface $requestMessage) { * @covers ::__construct * @covers ::fetchInstructionsContactProfile * @covers ::assertResponseIsSuccess - * @throws DocScanException|PemFileException + * @throws IDVException|PemFileException */ public function fetchInstructionsContactProfileShouldReturnContactProfileOnSuccessfulCall() { @@ -1243,7 +1243,7 @@ function (RequestInterface $requestMessage) { ) ->willReturn($this->createResponse(200, json_encode((object)[]))); - $docScanService = new Service( + $IDVService = new Service( TestData::SDK_ID, PemFile::fromFilePath(TestData::PEM_FILE), new Config( @@ -1255,7 +1255,7 @@ function (RequestInterface $requestMessage) { $this->assertInstanceOf( ContactProfileResponse::class, - $docScanService->fetchInstructionsContactProfile(TestData::DOC_SCAN_SESSION_ID) + $IDVService->fetchInstructionsContactProfile(TestData::DOC_SCAN_SESSION_ID) ); } @@ -1287,7 +1287,7 @@ function (RequestInterface $requestMessage) { ) ->willReturn($this->createResponse(404)); - $docScanService = new Service( + $IDVService = new Service( TestData::SDK_ID, PemFile::fromFilePath(TestData::PEM_FILE), new Config( @@ -1297,10 +1297,10 @@ function (RequestInterface $requestMessage) { ) ); - $this->expectException(DocScanException::class); + $this->expectException(IDVException::class); $this->expectExceptionMessage("Server responded with 404"); - $docScanService->fetchInstructionsContactProfile(TestData::DOC_SCAN_SESSION_ID); + $IDVService->fetchInstructionsContactProfile(TestData::DOC_SCAN_SESSION_ID); } /** @@ -1331,7 +1331,7 @@ function (RequestInterface $requestMessage) { ) ->willReturn($this->createResponse(200)); - $docScanService = new Service( + $IDVService = new Service( TestData::SDK_ID, PemFile::fromFilePath(TestData::PEM_FILE), new Config( @@ -1341,7 +1341,7 @@ function (RequestInterface $requestMessage) { ) ); - $docScanService->triggerIbvEmailNotification( + $IDVService->triggerIbvEmailNotification( TestData::DOC_SCAN_SESSION_ID ); } @@ -1374,7 +1374,7 @@ function (RequestInterface $requestMessage) { ) ->willReturn($this->createResponse(404)); - $docScanService = new Service( + $IDVService = new Service( TestData::SDK_ID, PemFile::fromFilePath(TestData::PEM_FILE), new Config( @@ -1384,10 +1384,10 @@ function (RequestInterface $requestMessage) { ) ); - $this->expectException(DocScanException::class); + $this->expectException(IDVException::class); $this->expectExceptionMessage("Server responded with 404"); - $docScanService->triggerIbvEmailNotification( + $IDVService->triggerIbvEmailNotification( TestData::DOC_SCAN_SESSION_ID ); } diff --git a/tests/DocScan/Session/Create/Check/Advanced/RequestedExactMatchingStrategyTest.php b/tests/DocScan/Session/Create/Check/Advanced/RequestedExactMatchingStrategyTest.php index ec5a31ef..b8dbf6e2 100644 --- a/tests/DocScan/Session/Create/Check/Advanced/RequestedExactMatchingStrategyTest.php +++ b/tests/DocScan/Session/Create/Check/Advanced/RequestedExactMatchingStrategyTest.php @@ -1,22 +1,22 @@