-
Notifications
You must be signed in to change notification settings - Fork 19
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 #338 from getyoti/release/4.2.1
**Added** - Updated session config to configure consent screen location **Requested with** ```php ->withSdkConfig( (new SdkConfigBuilder()) ->withAllowsCameraAndUpload() ->withPrimaryColour('#2d9fff') ->withSecondaryColour('#FFFFFF') ->withFontColour('#FFFFFF') ->withLocale('en-GB') ->withPresetIssuingCountry('GBR') ->withSuccessUrl(config('app.url') . '/success') ->withErrorUrl(config('app.url') . '/error') ->withPrivacyPolicyUrl(config('app.url') . '/privacy-policy') ->withBiometricConsentFlow('EARLY') ->build() ) ``` **Added** - Support for show enable expanded document fields media **Requested with** ```php ->withRequestedTask( (new RequestedTextExtractionTaskBuilder()) ->withManualCheckAlways() ->withChipDataDesired() ->withCreateExpandedDocumentFields(true) ->build() ) ``` ### Fixed - Fixed a bug that occurs when retrieving advanced checks
- Loading branch information
Showing
24 changed files
with
571 additions
and
16 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
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,51 @@ | ||
<?php | ||
|
||
namespace Yoti\DocScan\Session\Create; | ||
|
||
use JsonSerializable; | ||
use Yoti\DocScan\Exception\DocScanException; | ||
use Yoti\Util\Json; | ||
|
||
class ImportToken implements JsonSerializable | ||
{ | ||
private const MIN_TTL = 3600 * 24 * 30; | ||
private const MAX_TTL = 3600 * 24 * 365; | ||
|
||
private int $ttl; | ||
|
||
/** | ||
* @throws DocScanException | ||
*/ | ||
public function __construct(int $ttl) | ||
{ | ||
$this->validate($ttl); | ||
$this->ttl = $ttl; | ||
} | ||
|
||
public function jsonSerialize(): \stdClass | ||
{ | ||
return (object)Json::withoutNullValues([ | ||
'ttl' => $this->getTtl(), | ||
]); | ||
} | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getTtl(): int | ||
{ | ||
return $this->ttl; | ||
} | ||
|
||
/** | ||
* @throws DocScanException | ||
*/ | ||
private function validate(int $ttl): void | ||
{ | ||
if (self::MAX_TTL < $ttl || self::MIN_TTL > $ttl) { | ||
throw new DocScanException( | ||
'Your TTL is invalid. Min value - ' . self::MIN_TTL . '.Max value - ' . self::MAX_TTL . '.' | ||
); | ||
} | ||
} | ||
} |
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,27 @@ | ||
<?php | ||
|
||
namespace Yoti\DocScan\Session\Create; | ||
|
||
use Yoti\DocScan\Exception\DocScanException; | ||
|
||
class ImportTokenBuilder | ||
{ | ||
private const DEFAULT_TTL = 3600 * 24 * 365; | ||
|
||
private int $ttl; | ||
|
||
public function withTtl(int $ttl = null): ImportTokenBuilder | ||
{ | ||
$this->ttl = $ttl ?? self::DEFAULT_TTL; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @throws DocScanException | ||
*/ | ||
public function build(): ImportToken | ||
{ | ||
return new ImportToken($this->ttl); | ||
} | ||
} |
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
Oops, something went wrong.