Skip to content

Commit

Permalink
www2
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmet-yoti committed Feb 1, 2024
1 parent b508e72 commit 232bd76
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .php-cs-fixer.cache

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions src/DocScan/Session/Create/SdkConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ public function __construct(
?bool $allowHandoff = null,
?array $idDocumentTextDataExtractionRetriesConfig = null,
?string $biometricConsentFlow = null

) {
$this->allowedCaptureMethods = $allowedCaptureMethods;
$this->primaryColour = $primaryColour;
Expand All @@ -111,7 +110,6 @@ public function __construct(
$this->attemptsConfiguration = new AttemptsConfiguration($idDocumentTextDataExtractionRetriesConfig);
}
$this->biometricConsentFlow = $biometricConsentFlow;

}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ public function withManualCheck(string $manualCheck): self
private $createExpandedDocumentFields;

/**
*
* @param string $createExpandedDocumentFields
*
* @param bool $createExpandedDocumentFields
*
* @return $this
*/
Expand All @@ -82,8 +82,11 @@ public function build(): RequestedTextExtractionTask
{
Validation::notEmptyString($this->manualCheck, 'manualCheck');

$config = new RequestedTextExtractionTaskConfig($this->manualCheck, $this->chipData,
$this->createExpandedDocumentFields);
$config = new RequestedTextExtractionTaskConfig(
$this->manualCheck,
$this->chipData,
$this->createExpandedDocumentFields
);
return new RequestedTextExtractionTask($config);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ class RequestedTextExtractionTaskConfig implements RequestedTaskConfigInterface
* @param string|null $chipData
* @param bool|null $createExpandedDocumentFields
*/
public function __construct(string $manualCheck, ?string $chipData = null, ?bool $createExpandedDocumentFields = false)
{
public function __construct(
string $manualCheck,
?string $chipData = null,
?bool $createExpandedDocumentFields = false
) {
$this->manualCheck = $manualCheck;
$this->chipData = $chipData;
$this->createExpandedDocumentFields = $createExpandedDocumentFields;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function __construct(array $idDocument)
$this->documentFields = isset($idDocument['document_fields'])
? new DocumentFieldsResponse($idDocument['document_fields'])
: null;

$this->expandedDocumentFields = isset($idDocument['expanded_document_fields'])
? new ExpandedDocumentFieldsResponse($idDocument['expanded_document_fields'])
: null;
Expand Down
5 changes: 2 additions & 3 deletions src/Profile/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,9 @@ public function getActivityDetails(string $encryptedConnectToken): ActivityDetai
{
// Decrypt connect token
$token = $this->decryptConnectToken($encryptedConnectToken);
error_log("Mas->");
//error_log("Mas->".$encryptedConnectToken);
error_log($this->config->getApiUrl() ?? Constants::API_URL);
// Request endpoint
error_log(sprintf('/profile/%s', $token));

$response = (new RequestBuilder($this->config))
->withBaseUrl($this->config->getApiUrl() ?? Constants::API_URL)
->withEndpoint(sprintf('/profile/%s', $token))
Expand Down
23 changes: 0 additions & 23 deletions tests/Profile/ServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,29 +133,6 @@ public function testInvalidConnectToken()
$profileService->getActivityDetails(TestData::INVALID_YOTI_CONNECT_TOKEN);
}

/**
* Test invalid Token
*
* @covers ::getActivityDetails
* @covers ::decryptConnectToken
*/
public function testWrongPemFile()
{
$this->expectException(\Yoti\Exception\ActivityDetailsException::class);
$this->expectExceptionMessage('Could not decrypt one time use token');

$res = openssl_pkey_new([]);
openssl_pkey_export($res, $someKey);

$profileService = new Service(
TestData::SDK_ID,
PemFile::fromString($someKey),
new Config()
);

$profileService->getActivityDetails(file_get_contents(TestData::YOTI_CONNECT_TOKEN));
}

/**
* @covers ::getActivityDetails
*/
Expand Down

0 comments on commit 232bd76

Please sign in to comment.