Skip to content

Commit d9c6c79

Browse files
LuborRodRodion LiuboretsecharrodtylooJulien Bonvarlet
authored
Merge master to development (#287)
* Fix version to 3.8.0 in composer json * Change version on 3.9.0 * Fix jsonSerialize in IbvOptions * Add JSON serialize methods * Release-3.9.1 Tests Covering * Add several docs for coverage * Update src/DocScan/Session/Create/Check/Contracts/RequestedWatchlistAdvancedCaConfig.php Co-authored-by: Ed Harrod <[email protected]> * Add example with yoti account type * Add WatchlistSummary response view * Add testing coverage * Make 100% testing coverage * chore(Composer): Upgraded Guzzle PSR7 to version 2.1.0 and moved psr/log to require-dev (#269) Signed-off-by: Julien Bonvarlet <[email protected]> Co-authored-by: Julien Bonvarlet <[email protected]> * Remove test with Guzzle 6 version * Update psr/log * Revert updating psr/log because of compatibility * SDK-2116: Add Third Party Identity Fraud Check Result To IDV * SDK-2116 Modify success.view * SDK-2138 + change release-version * SDK-2143: Add error code and description in failure receipt message (#284) * SDK-2143: Add error code and description in failure receipt message * SDK-2143 Add more info to ActivityDetailsException * SDK-2143 Small fix for error details * SDK-2143 Delete unnecessary method * SDK-2143 Delete unnecessary method2 Co-authored-by: Rodion Liuborets <[email protected]> * Fix version in examples in composer.json Co-authored-by: Rodion Liuborets <[email protected]> Co-authored-by: Ed Harrod <[email protected]> Co-authored-by: Julien Bonvarlet <[email protected]> Co-authored-by: Julien Bonvarlet <[email protected]>
1 parent e5656af commit d9c6c79

File tree

24 files changed

+317
-76
lines changed

24 files changed

+317
-76
lines changed

.github/workflows/tests.yaml

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -57,34 +57,6 @@ jobs:
5757

5858
- run: composer test
5959

60-
guzzle:
61-
name: Unit Tests With Guzzle 6 (php ${{ matrix.php-version }})
62-
runs-on: ubuntu-latest
63-
# always run on push events
64-
# only run on pull_request_target event when pull request pulls from fork repository
65-
if: >
66-
github.event_name == 'push' ||
67-
github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository
68-
strategy:
69-
fail-fast: false
70-
matrix:
71-
php-version: [ 7.4 ]
72-
73-
steps:
74-
- uses: actions/checkout@v2
75-
76-
- uses: shivammathur/[email protected]
77-
with:
78-
php-version: ${{ matrix.php-version }}
79-
80-
- run: composer require guzzlehttp/guzzle "^6.5"
81-
82-
- run: composer self-update
83-
84-
- run: composer install --no-interaction --prefer-source --dev
85-
86-
- run: composer test
87-
8860
protobuf:
8961
name: Unit Tests With Protobuf C Extension 3.13 (php ${{ matrix.php-version }})
9062
runs-on: ubuntu-latest

composer.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "yoti/yoti-php-sdk",
33
"description": "Yoti SDK for quickly integrating your PHP backend with Yoti",
4-
"version": "3.9.1",
4+
"version": "4.0.0",
55
"keywords": [
66
"yoti",
77
"sdk"
@@ -16,8 +16,7 @@
1616
"guzzlehttp/guzzle": "^6.4 || ^7.0",
1717
"psr/http-client": "^1.0",
1818
"psr/http-message": "^1.0",
19-
"psr/log": "^1.1",
20-
"guzzlehttp/psr7": "^1.7",
19+
"guzzlehttp/psr7": "^2.0",
2120
"ext-openssl": "*"
2221
},
2322
"autoload": {
@@ -32,6 +31,7 @@
3231
"brainmaestro/composer-git-hooks": "^2.8",
3332
"phpstan/phpstan-strict-rules": "^0.12.1",
3433
"phpstan/extension-installer": "^1.0",
34+
"psr/log": "^1.1",
3535
"symfony/phpunit-bridge": "^5.1"
3636
},
3737
"autoload-dev": {
@@ -58,7 +58,12 @@
5858
},
5959
"extra": {
6060
"hooks": {
61-
"pre-commit": "composer test && composer lint"
61+
"pre-commit": "composer test && composer lint"
62+
}
63+
},
64+
"config": {
65+
"allow-plugins": {
66+
"phpstan/extension-installer": true
6267
}
6368
}
64-
}
69+
}

examples/doc-scan/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
"php": "^8.0",
77
"fideloper/proxy": "^4.2",
88
"fruitcake/laravel-cors": "^1.0",
9-
"guzzlehttp/guzzle": "^6.3",
9+
"guzzlehttp/guzzle": "^6.4 || ^7.0",
1010
"laravel/framework": "^8.0",
1111
"laravel/tinker": "^2.3.0",
12-
"yoti/yoti-php-sdk": "^3.0"
12+
"yoti/yoti-php-sdk": "^4.0"
1313
},
1414
"require-dev": {
1515
"facade/ignition": "^2.0"

examples/doc-scan/resources/views/success.blade.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,29 @@
220220
</div>
221221
@endif
222222

223+
@if (count($sessionResult->getThirdPartyIdentityFraudOneChecks()) > 0)
224+
<div class="card">
225+
<div class="card-header" id="third-party-identity-fraud-one-checks">
226+
<h3 class="mb-0">
227+
<button class="btn btn-link" type="button" data-toggle="collapse"
228+
data-target="#collapse-third-party-identity-fraud-one-checks" aria-expanded="true"
229+
aria-controls="collapse-third-party-identity-fraud-one-checks">
230+
Third Party Identity Fraud Checks
231+
</button>
232+
</h3>
233+
</div>
234+
235+
<div id="collapse-third-party-identity-fraud-one-checks" class="collapse"
236+
aria-labelledby="third-party-identity-fraud-one-checks">
237+
<div class="card-body">
238+
@foreach($sessionResult->getThirdPartyIdentityFraudOneChecks() as $check)
239+
@include('partial/check', ['check' => $check])
240+
@endforeach
241+
</div>
242+
</div>
243+
</div>
244+
@endif
245+
223246
@if (count($sessionResult->getWatchlistScreeningChecks()) > 0)
224247
<div class="card">
225248
<div class="card-header" id="watchlist-screening-checks">

examples/profile/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ This example requires [Docker](https://docs.docker.com/)
1414
* Copy `.env.example` to `.env`
1515
* Open `.env` file and fill in the environment variables `YOTI_SCENARIO_ID`, `YOTI_SDK_ID`
1616
* Set `YOTI_KEY_FILE_PATH` to `./keys/your-application-pem-file.pem`
17+
* Install dependencies `docker-compose up composer`
1718
* Run the `docker-compose up --build` command
1819
* Visit [https://localhost:4002](https://localhost:4002)
1920
* Run the `docker-compose stop` command to stop the containers.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
3+
namespace App\Http\Controllers;
4+
5+
use Illuminate\Routing\Controller as BaseController;
6+
use Yoti\ShareUrl\DynamicScenarioBuilder;
7+
use Yoti\ShareUrl\Policy\DynamicPolicyBuilder;
8+
use Yoti\YotiClient;
9+
10+
class DbsCheckController extends BaseController
11+
{
12+
public function show(YotiClient $client)
13+
{
14+
$dynamicPolicy = (new DynamicPolicyBuilder())
15+
->withIdentityProfileRequirements((object)[
16+
'trust_framework' => 'UK_TFIDA',
17+
'scheme' => [
18+
'type' => 'DBS',
19+
'objective' => 'BASIC'
20+
]
21+
])
22+
->build();
23+
24+
$dynamicScenario = (new DynamicScenarioBuilder())
25+
->withCallbackEndpoint("/profile")
26+
->withPolicy($dynamicPolicy)
27+
->withSubject((object)[
28+
'subject_id' => "some_subject_id_string"
29+
])
30+
->build();
31+
32+
return view('dbs', [
33+
'title' => 'DBS Check Example',
34+
'buttonConfig' => [
35+
'elements' => [
36+
[
37+
'domId' => 'yoti-share-button',
38+
'clientSdkId' => config('yoti')['client.sdk.id'],
39+
'shareUrl' => $client->createShareUrl($dynamicScenario)->getShareUrl(),
40+
'button' => [
41+
'label' => 'Use Yoti',
42+
'align' => 'center',
43+
'width' => 'auto',
44+
'verticalAlign' => 'top'
45+
],
46+
'type' => 'modal'
47+
]
48+
]
49+
]
50+
]);
51+
}
52+
}

examples/profile/composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
"description": "Yoti SDK Profile Demo",
44
"license": "MIT",
55
"require": {
6-
"php": "^7.2.5",
6+
"php": "^8.0",
77
"fideloper/proxy": "^4.2",
88
"fruitcake/laravel-cors": "^1.0",
9-
"guzzlehttp/guzzle": "^6.3",
10-
"laravel/framework": "^7.0",
11-
"laravel/tinker": "^2.0",
12-
"yoti/yoti-php-sdk": "^3.0"
9+
"guzzlehttp/guzzle": "^6.4 || ^7.0",
10+
"laravel/framework": "^8.0",
11+
"laravel/tinker": "^2.3.0",
12+
"yoti/yoti-php-sdk": "^4.0"
1313
},
1414
"require-dev": {
1515
"facade/ignition": "^2.0"
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<!DOCTYPE html>
2+
<html class="yoti-html">
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
7+
<title>{{ $title }}</title>
8+
<link rel="stylesheet" type="text/css" href="assets/css/index.css">
9+
<link href="https://fonts.googleapis.com/css?family=Roboto:400,700" rel="stylesheet">
10+
</head>
11+
12+
<body class="yoti-body">
13+
<main>
14+
<section class="yoti-top-section">
15+
<div class="yoti-logo-section">
16+
<a href="https://www.yoti.com" target="_blank">
17+
<img class="yoti-logo-image" src="assets/images/logo.png" srcset="assets/images/[email protected] 2x" alt="Yoti" />
18+
</a>
19+
</div>
20+
21+
<h1 class="yoti-top-header">{{ $title }}</h1>
22+
23+
<div class="yoti-sdk-integration-section">
24+
<div id="yoti-share-button"></div>
25+
</div>
26+
27+
<div class="yoti-login-or-separator">or</div>
28+
29+
<div class="yoti-login-dialog">
30+
<h2 class="yoti-login-dialog-header">Login with your email:</h2>
31+
32+
<input class="yoti-input" type="text" placeholder="Name" />
33+
34+
<input class="yoti-input" type="text" placeholder="Email address" />
35+
36+
<div class="yoti-login-actions">
37+
<span class="yoti-login-forgot-button">forgot password?</span>
38+
39+
<button class="yoti-login-button">login</button>
40+
</div>
41+
</div>
42+
</section>
43+
44+
<section class="yoti-sponsor-app-section">
45+
<h3 class="yoti-sponsor-app-header">The Yoti app is free to download and use:</h3>
46+
47+
<div class="yoti-store-buttons-section">
48+
<a href="https://itunes.apple.com/us/app/yoti/id983980808?ls=1&mt=8" class="yoti-app-button-link">
49+
<img src="assets/images/app-store-badge.png" srcset="assets/images/[email protected] 2x" alt="Download on the App Store" />
50+
</a>
51+
52+
<a href="https://play.google.com/store/apps/details?id=com.yoti.mobile.android.live" class="yoti-app-button-link">
53+
<img src="assets/images/google-play-badge.png" srcset="assets/images/[email protected] 2x" alt="Yoti" alt="get it on Google Play" />
54+
</a>
55+
</div>
56+
</section>
57+
</main>
58+
59+
<script src="https://www.yoti.com/share/client/"></script>
60+
<script>
61+
window.Yoti.Share.init(@json($buttonConfig, JSON_PRETTY_PRINT));
62+
</script>
63+
</body>
64+
65+
</html>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<table>
2+
@foreach ($report as $key => $value)
3+
<tr>
4+
<td>{{ $key }}</td>
5+
<td>
6+
<pre>
7+
{{ $value }}
8+
</pre>
9+
</td>
10+
</tr>
11+
@endforeach
12+
</table>

examples/profile/resources/views/profile.blade.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@
7373
@case ('Structured Postal Address')
7474
@include('partial/address', ['address' => $item['obj']->getValue()])
7575
@break
76+
@case ('Identity Profile Report')
77+
@include('partial/report', ['report' => $item['obj']->getValue()])
78+
@break
7679
@default
7780
@include('partial/attribute', ['value' => $item['obj']->getValue()])
7881
@endswitch

0 commit comments

Comments
 (0)