Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
8e5ca47
Merge pull request #349 from getyoti/development
mehmet-yoti Feb 19, 2024
1e23877
Merge pull request #351 from getyoti/development
mehmet-yoti Feb 21, 2024
c9a2b35
Merge pull request #347 from getyoti/release/4.2.2
mehmet-yoti Feb 21, 2024
f752956
Release/4.3.0 (#364)
mehmet-yoti Jul 31, 2024
df0a9ee
Release 4.3.0 - Update (#366)
mehmet-yoti Aug 1, 2024
4af4eca
Master merge (#370)
mehmet-yoti Sep 10, 2024
7c52d7a
Merge Master Into Development (#368)
mehmet-yoti Sep 10, 2024
9f9b977
Release/4.3.1 (#372)
mehmet-yoti Sep 12, 2024
ce3fd6d
SDK-2472-added-php-idv-support-brand-id-in-session-config (#373)
mehmet-yoti Mar 14, 2025
530285f
Php sdk 2361 add optional attribute flag to sdk (#374)
mehmet-yoti Mar 14, 2025
4bf3fad
Sdk 2535 php sdk issue when retrieving session when a watchlist advan…
mehmet-yoti Mar 14, 2025
22c4a07
Sdk 2487 php support dark mode in idv sdk (#375)
mehmet-yoti Mar 14, 2025
046b040
Release/4.4.0 (#377)
mehmet-yoti Mar 19, 2025
17e9d91
SDK-2265 Retrieve Receipt (#323)
LuborRod Jun 21, 2024
805f520
SDK-2377 added failure reasons to idv (#356)
mehmet-yoti Jun 24, 2024
9a2f1c3
Sdk 2420 php add support for advanced identity profiles to share v 2 …
mehmet-yoti Jul 4, 2024
772a047
Added example for dbs and updated failure details (#362)
mehmet-yoti Jul 30, 2024
b90871f
Merge Master Into Development (#368)
mehmet-yoti Sep 10, 2024
3816902
SDK-2472-added-php-idv-support-brand-id-in-session-config (#373)
mehmet-yoti Mar 14, 2025
c8bda85
Php sdk 2361 add optional attribute flag to sdk (#374)
mehmet-yoti Mar 14, 2025
675a1a1
php 8.4 changes
mehmet-yoti Jun 5, 2025
4057c7e
php 8.4 changes
mehmet-yoti Jun 5, 2025
391cc5f
Merge pull request #380 from getyoti/master
mehmet-yoti Jun 10, 2025
6c7347e
updated env.template file
mehmet-yoti Jun 10, 2025
2abcbde
Merge pull request #381 from getyoti/php-8.4-dev
mehmet-yoti Jun 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,36 @@ jobs:

- run: composer test

php8-4:
name: Unit Tests php8.4 (php ${{ matrix.php-version }})
runs-on: ubuntu-latest
# always run on push events
# only run on pull_request_target event when pull request pulls from fork repository
if: >
github.event_name == 'push' ||
github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository
strategy:
fail-fast: false
matrix:
php-version: [ 8.4 ]

steps:
- uses: actions/checkout@v2

- uses: shivammathur/setup-php@2.9.0
with:
php-version: ${{ matrix.php-version }}

# Remove php-cs-fixer until compatible with PHP 8
# This step might be removable if php-cs-fixer is compatible with 8.4 by the time this runs
- run: composer remove --dev --no-update --no-interaction friendsofphp/php-cs-fixer

- run: composer self-update

- run: composer install --no-interaction --prefer-source --dev

- run: composer test

php7-4:
name: Unit Tests php7.4 (php ${{ matrix.php-version }})
runs-on: ubuntu-latest
Expand Down Expand Up @@ -109,4 +139,3 @@ jobs:
- run: composer install --no-interaction --prefer-source --dev

- run: composer test

1 change: 1 addition & 0 deletions .php-cs-fixer.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"php":"8.1.27","version":"3.22.0:v3.22.0#92b019f6c8d79aa26349d0db7671d37440dc0ff3","indent":" ","lineEnding":"\n","rules":{"array_syntax":{"syntax":"short"},"no_unused_imports":true,"ordered_imports":{"imports_order":["const","class","function"]},"php_unit_fqcn_annotation":true,"phpdoc_return_self_reference":true,"phpdoc_scalar":true},"hashes":{"\/private\/var\/folders\/b6\/tqq9d7y54ll62fjfysz50ry80000gn\/T\/PHP CS Fixertemp_folder2419\/examples\/digitalidentity\/app\/Http\/Controllers\/IdentityController.php":"369515522c3efd6cd55a8363d4e97c05","\/private\/var\/folders\/b6\/tqq9d7y54ll62fjfysz50ry80000gn\/T\/PHP CS Fixertemp_folder4308\/src\/Identity\/Policy\/Policy.php":"e1bca74eaafe5271dd1a38769fe1c3b2","\/private\/var\/folders\/b6\/tqq9d7y54ll62fjfysz50ry80000gn\/T\/PHP CS Fixertemp_folder3692\/src\/Identity\/Policy\/PolicyBuilder.php":"88302b88aba33563661d4b989b5dc429","\/private\/var\/folders\/b6\/tqq9d7y54ll62fjfysz50ry80000gn\/T\/PHP CS Fixertemp_folder2054\/tests\/Identity\/Policy\/PolicyBuilderTest.php":"a262a261102744a1acf6d5d0b421dc44","\/private\/var\/folders\/b6\/tqq9d7y54ll62fjfysz50ry80000gn\/T\/PHP CS Fixertemp_folder5221\/src\/Identity\/ReceiptBuilder.php":"2e6ef33d3401f7cbd36145ad66b3b2ef","\/private\/var\/folders\/b6\/tqq9d7y54ll62fjfysz50ry80000gn\/T\/PHP CS Fixertemp_folder289\/examples\/digitalidentity\/app\/Http\/Controllers\/ReceiptController.php":"e79ec7e1511895c954f77c713d435ad2","\/private\/var\/folders\/b6\/tqq9d7y54ll62fjfysz50ry80000gn\/T\/PHP CS Fixertemp_folder2348\/tests\/Identity\/ReceiptTest.php":"b602e6828020fef411df597e17fa7c88","\/private\/var\/folders\/b6\/tqq9d7y54ll62fjfysz50ry80000gn\/T\/PHP CS Fixertemp_folder4139\/examples\/digitalidentity\/routes\/web.php":"dcdc77843f3e59dd61467a324edf0c77","\/private\/var\/folders\/b6\/tqq9d7y54ll62fjfysz50ry80000gn\/T\/PHP CS Fixertemp_folder5396\/src\/Identity\/Receipt.php":"4744c8887009fd9ffbf084f99021eb1c","\/private\/var\/folders\/b6\/tqq9d7y54ll62fjfysz50ry80000gn\/T\/PHP CS Fixertemp_folder5193\/src\/Identity\/WrappedReceipt.php":"3a77a22be093a1da75438ea2bb9fcb20","\/private\/var\/folders\/b6\/tqq9d7y54ll62fjfysz50ry80000gn\/T\/PHP CS Fixertemp_folder4416\/examples\/digitalidentity\/app\/Http\/Controllers\/AdvancedIdentityController.php":"6b5c23f2ce8da246bc41d136d87ecdb6","\/private\/var\/folders\/b6\/tqq9d7y54ll62fjfysz50ry80000gn\/T\/PHP CS Fixertemp_folder5544\/examples\/digitalidentity\/app\/Http\/Controllers\/AdvancedIdentityController.php":"6b5c23f2ce8da246bc41d136d87ecdb6","\/private\/var\/folders\/b6\/tqq9d7y54ll62fjfysz50ry80000gn\/T\/PHP CS Fixertemp_folder4533\/src\/Identity\/Policy\/Policy.php":"bea4b7ebb268fca1ad719f933ec82cbd","\/private\/var\/folders\/b6\/tqq9d7y54ll62fjfysz50ry80000gn\/T\/PHP CS Fixertemp_folder3559\/tests\/Identity\/Policy\/PolicyBuilderTest.php":"f6d7380ae2db4eca426bb39ccfb3a900","\/private\/var\/folders\/b6\/tqq9d7y54ll62fjfysz50ry80000gn\/T\/PHP CS Fixertemp_folder2922\/examples\/digitalidentity\/routes\/web.php":"fdf260e4dfd18c8ba12078943564875a","\/private\/var\/folders\/b6\/tqq9d7y54ll62fjfysz50ry80000gn\/T\/PHP CS Fixertemp_folder3947\/src\/Constants.php":"4bb1127c9665c5d0496b90ea3211951d","\/private\/var\/folders\/b6\/tqq9d7y54ll62fjfysz50ry80000gn\/T\/PHP CS Fixertemp_folder4440\/src\/Constants.php":"99a3224f6e3fcae067362798bbab64f0","\/private\/var\/folders\/b6\/tqq9d7y54ll62fjfysz50ry80000gn\/T\/PHP CS Fixertemp_folder4745\/src\/Constants.php":"afc40e02bdc3a87ff7a874826447c604","\/private\/var\/folders\/b6\/tqq9d7y54ll62fjfysz50ry80000gn\/T\/PHP CS Fixertemp_folder1311\/src\/Constants.php":"77a8a39eac3e973495b7719ebd41509e","\/private\/var\/folders\/b6\/tqq9d7y54ll62fjfysz50ry80000gn\/T\/PHP CS Fixertemp_folder1635\/examples\/digitalidentity\/app\/Http\/Controllers\/ReceiptController.php":"10f70ffe111a0030b29762494cc5de7d"}}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ Add the Yoti SDK dependency:

```json
"require": {
"yoti/yoti-php-sdk" : "^4.3.0"
"yoti/yoti-php-sdk" : "^4.4.0"
}
```

Or run this Composer command
```console
$ composer require yoti/yoti-php-sdk "^4.3.0"
$ composer require yoti/yoti-php-sdk "^4.4.0"
```

## Setup
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "yoti/yoti-php-sdk",
"description": "Yoti SDK for quickly integrating your PHP backend with Yoti",
"version": "4.3.0",
"version": "4.4.0",
"keywords": [
"yoti",
"sdk"
],
"homepage": "https://yoti.com",
"license": "MIT",
"require": {
"php": "^7.4 || ^8.0 || ^8.1",
"php": "^7.4 || ^8.0 || ^8.1 || ^8.4",
"ext-json": "*",
"google/protobuf": "^3.10",
"phpseclib/phpseclib": "^3.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/digitalidentity/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ This example requires [Docker](https://docs.docker.com/)
## Digital Identity(Advanced) Share Example
* Visit [/generate-advanced-identity-share](https://localhost:4002/generate-advanced-identity-share)
* ## Digital Identity DBS Example
* Visit [/generate-dbs-share](https://localhost:4002/generate-dbs-share)
* Visit [/generate-dbs-share](https://localhost:4002/generate-dbs-share)
1 change: 1 addition & 0 deletions examples/digitalidentity/resources/views/dbs.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,6 @@ function onErrorListener(...data) {
await onReadyToStart()
}</script>
<script src="https://www.yoti.com/share/client/v2" onload="onClientLoaded()"></script>

</body>
</html>
2 changes: 1 addition & 1 deletion examples/digitalidentity/routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
Route::get('/generate-advanced-identity-share', 'AdvancedIdentityController@show');
Route::get('/generate-advanced-identity-session', 'AdvancedIdentityController@generateSession');
Route::get('/generate-dbs-share', 'DbsController@show');
Route::get('/generate-dbs-session', 'DbsController@generateSession');
Route::get('/generate-dbs-session', 'DbsController@generateSession');
4 changes: 3 additions & 1 deletion examples/doc-scan/app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,12 @@ public function show(Request $request, DocScanClient $client)
->withMaxRetries(3)
->build()
)
/*
->withRequestedCheck(
(new RequestedWatchlistAdvancedCaCheckBuilder())
->withConfig($customConfig)
->build()
)
)*/
->withRequestedCheck(
(new RequestedFaceMatchCheckBuilder())
->withManualCheckFallback()
Expand Down Expand Up @@ -150,6 +151,7 @@ public function show(Request $request, DocScanClient $client)
->withErrorUrl(config('app.url') . '/error')
->withPrivacyPolicyUrl(config('app.url') . '/privacy-policy')
->withBiometricConsentFlow('EARLY')
->withBrandId('brand_id')
->build()
)
->withRequiredDocument(
Expand Down
2 changes: 1 addition & 1 deletion src/Aml/Profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Profile implements \JsonSerializable
* @param \Yoti\Aml\Address $amlAddress
* @param null|string $ssn
*/
public function __construct($givenNames, $familyName, Address $amlAddress, string $ssn = null)
public function __construct(string $givenNames, string $familyName, Address $amlAddress, ?string $ssn = null)
{
$this->givenNames = $givenNames;
$this->familyName = $familyName;
Expand Down
2 changes: 1 addition & 1 deletion src/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Constants
public const SDK_IDENTIFIER = 'PHP';

/** Default SDK version */
public const SDK_VERSION = '4.3.0';
public const SDK_VERSION = '4.4.0';

/** Base url for connect page (user will be redirected to this page eg. baseurl/app-id) */
public const CONNECT_BASE_URL = 'https://www.yoti.com/connect';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class RequestedLivenessConfig implements RequestedCheckConfigInterface
*/
private $manualCheck;

public function __construct(string $livenessType, int $maxRetries, string $manualCheck = null)
public function __construct(string $livenessType, int $maxRetries, ?string $manualCheck = null)
{
$this->livenessType = $livenessType;
$this->maxRetries = $maxRetries;
Expand Down
2 changes: 1 addition & 1 deletion src/DocScan/Session/Create/ImportTokenBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ImportTokenBuilder

private int $ttl;

public function withTtl(int $ttl = null): ImportTokenBuilder
public function withTtl(?int $ttl = null): ImportTokenBuilder
{
$this->ttl = $ttl ?? self::DEFAULT_TTL;

Expand Down
55 changes: 53 additions & 2 deletions src/DocScan/Session/Create/SdkConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,21 @@ class SdkConfig implements \JsonSerializable
*/
private $biometricConsentFlow;

/**
* @var string|null
*/
private $darkMode;

/**
* @var string|null
*/
private $primaryColourDarkMode;

/**
* @var string|null
*/
private $brandId;

/**
* @param string|null $allowedCaptureMethods
* @param string|null $primaryColour
Expand All @@ -81,6 +96,9 @@ class SdkConfig implements \JsonSerializable
* @param bool|null $allowHandoff
* @param array<string, int>|null $idDocumentTextDataExtractionRetriesConfig
* @param string|null $biometricConsentFlow
* @param string|null $darkMode
* @param string|null $primaryColourDarkMode
* @param string|null $brandId
*/
public function __construct(
?string $allowedCaptureMethods,
Expand All @@ -94,7 +112,10 @@ public function __construct(
?string $privacyPolicyUrl = null,
?bool $allowHandoff = null,
?array $idDocumentTextDataExtractionRetriesConfig = null,
?string $biometricConsentFlow = null
?string $biometricConsentFlow = null,
?string $darkMode = null,
?string $primaryColourDarkMode = null,
?string $brandId = null
) {
$this->allowedCaptureMethods = $allowedCaptureMethods;
$this->primaryColour = $primaryColour;
Expand All @@ -110,6 +131,9 @@ public function __construct(
$this->attemptsConfiguration = new AttemptsConfiguration($idDocumentTextDataExtractionRetriesConfig);
}
$this->biometricConsentFlow = $biometricConsentFlow;
$this->darkMode = $darkMode;
$this->primaryColourDarkMode = $primaryColourDarkMode;
$this->brandId = $brandId;
}

/**
Expand All @@ -129,7 +153,10 @@ public function jsonSerialize(): \stdClass
'privacy_policy_url' => $this->getPrivacyPolicyUrl(),
'allow_handoff' => $this->getAllowHandoff(),
'attempts_configuration' => $this->getAttemptsConfiguration(),
'biometric_consent_flow' => $this->getBiometricConsentFlow()
'biometric_consent_flow' => $this->getBiometricConsentFlow(),
'dark_mode' => $this->getDarkMode(),
'primary_colour_dark_mode' => $this->getPrimaryColourDarkMode(),
'brand_id' => $this->getBrandId()
]);
}

Expand Down Expand Up @@ -228,4 +255,28 @@ public function getBiometricConsentFlow(): ?string
{
return $this->biometricConsentFlow;
}

/**
* @return string|null
*/
public function getDarkMode(): ?string
{
return $this->darkMode;
}

/**
* @return string|null
*/
public function getPrimaryColourDarkMode(): ?string
{
return $this->primaryColourDarkMode;
}

/**
* @return string|null
*/
public function getBrandId(): ?string
{
return $this->brandId;
}
}
56 changes: 55 additions & 1 deletion src/DocScan/Session/Create/SdkConfigBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,21 @@ class SdkConfigBuilder
*/
private $biometricConsentFlow;

/**
* @var string|null
*/
private $darkMode;

/**
* @var string|null
*/
private $primaryColourDarkMode;

/**
* @var string|null
*/
private $brandId;

public function withAllowsCamera(): self
{
return $this->withAllowedCaptureMethod(self::CAMERA);
Expand Down Expand Up @@ -146,6 +161,7 @@ public function withBiometricConsentFlow(string $biometricConsentFlow): self
$this->biometricConsentFlow = $biometricConsentFlow;
return $this;
}

/**
* Allows configuring the number of attempts permitted for text extraction on an ID document
*
Expand Down Expand Up @@ -199,6 +215,41 @@ public function withIdDocumentTextExtractionGenericAttempts(int $genericRetries)
return $this;
}

public function withDarkMode(string $darkMode): self
{
$this->darkMode = $darkMode;
return $this;
}

public function withDarkModeOn(): self
{
$this->darkMode = "ON";
return $this;
}

public function withDarkModeOff(): self
{
$this->darkMode = "OFF";
return $this;
}

public function withDarkModeAuto(): self
{
$this->darkMode = "AUTO";
return $this;
}

public function withPrimaryColourDarkMode(string $primaryColourDarkMode): self
{
$this->primaryColourDarkMode = $primaryColourDarkMode;
return $this;
}

public function withBrandId(string $brandId): self
{
$this->brandId = $brandId;
return $this;
}

public function build(): SdkConfig
{
Expand All @@ -214,7 +265,10 @@ public function build(): SdkConfig
$this->privacyPolicyUrl,
$this->allowHandoff,
$this->idDocumentTextDataExtractionRetriesConfig,
$this->biometricConsentFlow
$this->biometricConsentFlow,
$this->darkMode,
$this->primaryColourDarkMode,
$this->brandId
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ public function __construct(array $searchConfig)
$this->apiKey = $searchConfig['api_key'];
$this->monitoring = $searchConfig['monitoring'];
$this->clientRef = $searchConfig['client_ref'];
$this->tags = array_key_exists('tags', $searchConfig) ? json_decode($searchConfig['tags'], true) : [];
$this->tags = array_key_exists('tags', $searchConfig) && is_string($searchConfig['tags'])
? json_decode($searchConfig['tags'], true)
: (array_key_exists('tags', $searchConfig) && is_array($searchConfig['tags']) ? $searchConfig['tags'] : []);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/ActivityDetailsException.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct(
$message = "",
?ResponseInterface $response = null,
?array $responseBody = null,
\Throwable $previous = null
?\Throwable $previous = null
) {
parent::__construct($message, $response, $previous);

Expand Down
2 changes: 1 addition & 1 deletion src/Exception/base/YotiException.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class YotiException extends \Exception
* @param ResponseInterface|null $response
* @param \Throwable|null $previous
*/
public function __construct($message = "", ?ResponseInterface $response = null, \Throwable $previous = null)
public function __construct($message = "", ?ResponseInterface $response = null, ?\Throwable $previous = null)
{
parent::__construct($this->formatMessage($message, $response), 0, $previous);

Expand Down
2 changes: 1 addition & 1 deletion src/Http/Exception/NetworkException.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class NetworkException extends ClientException implements NetworkExceptionInterf
public function __construct(
string $message,
RequestInterface $request,
\Throwable $previous = null
?\Throwable $previous = null
) {
$this->setRequest($request);
parent::__construct($message, 0, $previous);
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Exception/RequestException.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class RequestException extends ClientException implements RequestExceptionInterf
public function __construct(
string $message,
RequestInterface $request,
\Throwable $previous = null
?\Throwable $previous = null
) {
$this->setRequest($request);
parent::__construct($message, 0, $previous);
Expand Down
4 changes: 2 additions & 2 deletions src/Http/RequestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ class RequestBuilder
private $multipartEntity;

/**
* @param \Yoti\Util\Config $config
* @param \Yoti\Util\Config|null $config
*/
public function __construct(Config $config = null)
public function __construct(?Config $config = null)
{
$this->config = $config ?? new Config();
}
Expand Down
Loading
Loading