Skip to content

Commit 46f5686

Browse files
author
Rodion Liuborets
committed
SDK-2138 + change release-version
1 parent c4b2b53 commit 46f5686

File tree

9 files changed

+142
-7
lines changed

9 files changed

+142
-7
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
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"

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' => 'STANDARD'
20+
]
21+
])
22+
->build();
23+
24+
$dynamicScenario = (new DynamicScenarioBuilder())
25+
->withCallbackEndpoint("/account/connect")
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": "^3.9.1"
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

examples/profile/routes/web.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@
1818
Route::get('/profile', 'ProfileController@show');
1919

2020
Route::get('/dynamic-share', 'DynamicShareController@show');
21+
22+
Route::get('/dbs-check', 'DbsCheckController@show');

src/Constants.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Constants
2525
public const SDK_IDENTIFIER = 'PHP';
2626

2727
/** Default SDK version */
28-
public const SDK_VERSION = '3.9.1';
28+
public const SDK_VERSION = '4.0.0';
2929

3030
/** Base url for connect page (user will be redirected to this page eg. baseurl/app-id) */
3131
public const CONNECT_BASE_URL = 'https://www.yoti.com/connect';

0 commit comments

Comments
 (0)