-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from getyoti/release/1.4.0
Release 1.4.0
- Loading branch information
Showing
16 changed files
with
527 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/DocScan/Request/Check/SandboxIdDocumentComparisonCheck.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Yoti\Sandbox\DocScan\Request\Check; | ||
|
||
use Yoti\Sandbox\DocScan\Request\SandboxDocumentFilter; | ||
|
||
class SandboxIdDocumentComparisonCheck extends SandboxCheck implements \JsonSerializable | ||
{ | ||
/** | ||
* @var SandboxDocumentFilter|null | ||
*/ | ||
private $secondaryDocumentFilter; | ||
|
||
/** | ||
* @param SandboxCheckResult $result | ||
* @param SandboxDocumentFilter|null $secondaryDocumentFilter | ||
*/ | ||
public function __construct(SandboxCheckResult $result, ?SandboxDocumentFilter $secondaryDocumentFilter) | ||
{ | ||
parent::__construct($result); | ||
|
||
$this->secondaryDocumentFilter = $secondaryDocumentFilter; | ||
} | ||
|
||
/** | ||
* @return \stdClass | ||
*/ | ||
public function jsonSerialize(): \stdClass | ||
{ | ||
$jsonData = parent::jsonSerialize(); | ||
|
||
if (isset($this->secondaryDocumentFilter)) { | ||
$jsonData->secondary_document_filter = $this->secondaryDocumentFilter; | ||
} | ||
|
||
return $jsonData; | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
src/DocScan/Request/Check/SandboxIdDocumentComparisonCheckBuilder.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Yoti\Sandbox\DocScan\Request\Check; | ||
|
||
use Yoti\Sandbox\DocScan\Request\SandboxDocumentFilter; | ||
|
||
class SandboxIdDocumentComparisonCheckBuilder extends SandboxCheckBuilder | ||
{ | ||
/** | ||
* @var SandboxDocumentFilter | ||
*/ | ||
private $secondaryDocumentFilter; | ||
|
||
/** | ||
* @param SandboxDocumentFilter $secondaryDocumentFilter | ||
* | ||
* @return $this | ||
*/ | ||
public function withSecondaryDocumentFilter(SandboxDocumentFilter $secondaryDocumentFilter): self | ||
{ | ||
$this->secondaryDocumentFilter = $secondaryDocumentFilter; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return SandboxIdDocumentComparisonCheck | ||
*/ | ||
public function build(): SandboxCheck | ||
{ | ||
$result = new SandboxCheckResult($this->buildReport()); | ||
return new SandboxIdDocumentComparisonCheck($result, $this->secondaryDocumentFilter); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Yoti\Sandbox\DocScan\Request\Task; | ||
|
||
class SandboxDocumentIdPhoto implements \JsonSerializable | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
private $contentType; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $data; | ||
|
||
/** | ||
* @param string $contentType | ||
* @param string $data | ||
*/ | ||
public function __construct(string $contentType, string $data) | ||
{ | ||
$this->contentType = $contentType; | ||
$this->data = $data; | ||
} | ||
|
||
/** | ||
* @return \stdClass | ||
*/ | ||
public function jsonSerialize(): \stdClass | ||
{ | ||
return (object) [ | ||
'content_type' => $this->contentType, | ||
'data' => base64_encode($this->data), | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.