diff --git a/example/composer.lock b/example/composer.lock index f135075a..1e6141da 100644 --- a/example/composer.lock +++ b/example/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "033aba5372d11ec968aa12bf6e1b9253", + "content-hash": "54d488eb352f8f71a16e27d169ad51a6", "packages": [ { "name": "yoti/yoti-php-sdk", - "version": "1.0.6", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/getyoti/yoti-php-sdk.git", - "reference": "cd87e8a7cc81b4cf807067f98540f805acf595c6" + "reference": "45f0e18" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getyoti/yoti-php-sdk/zipball/cd87e8a7cc81b4cf807067f98540f805acf595c6", - "reference": "cd87e8a7cc81b4cf807067f98540f805acf595c6", + "url": "https://api.github.com/repos/getyoti/yoti-php-sdk/zipball/45f0e18", + "reference": "45f0e18", "shasum": "" }, "require": { @@ -67,13 +67,15 @@ "sdk", "yoti" ], - "time": "2017-12-15T11:41:46+00:00" + "time": "2018-01-16 14:58:42" } ], "packages-dev": [], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "yoti/yoti-php-sdk": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": [], diff --git a/example/css/style.css b/example/css/style.css new file mode 100644 index 00000000..414bebb6 --- /dev/null +++ b/example/css/style.css @@ -0,0 +1,31 @@ + +body { + margin-left: 33%; +} +/*DL, DT, DD TAGS LIST DATA*/ +dl { + margin-bottom:50px; +} + +dl dt { + background:#5f9be3; + color:#fff; + float:left; + font-weight:bold; + margin-right:10px; + margin-bottom: 5px; + padding:5px; + float:left; + clear:both; + width:130px; +} + +dl dd { + margin:2px 0; + padding:5px 0; + float:left; +} + +dl dd img { + width: 100px; +} \ No newline at end of file diff --git a/example/index.html b/example/index.html index 5775a578..2ae8a902 100644 --- a/example/index.html +++ b/example/index.html @@ -1,20 +1,24 @@ - Your Site + + + +

Your Site Information

- Use Yoti! + data-yoti-scenario-id="your Scenario ID"> + Use Yoti + + + - \ No newline at end of file diff --git a/example/profile.php b/example/profile.php index f3981fbe..070e234e 100755 --- a/example/profile.php +++ b/example/profile.php @@ -3,6 +3,8 @@ // Make sure you run composer update inside the example folder before trying this example out require_once './vendor/autoload.php'; +use Yoti\Helper\ActivityDetailsHelper; + // Log any error message $errorMsg = ''; // Get the token @@ -16,7 +18,10 @@ try { $yotiClient = new Yoti\YotiClient($config['sdkId'], $config['pemFile']); $profile = $yotiClient->getActivityDetails($token); - $selfie = base64_encode($profile->getSelfie()); + // Create a base 64 selfie URI to be embedded in an HTML document + $base64Selfie = ActivityDetailsHelper::getBase64Selfie($profile); + // Create selfie image file. + file_put_contents('selfie.jpeg', $profile->getSelfie(), LOCK_EX); } catch(\Exception $e) { $errorMsg = "Error - {$e->getMessage()}"; } @@ -25,22 +30,46 @@ - PROFILE PAGE + Yoti Profile + +

- Given Name(s) getGivenNames() ?>
- Family Name getFamilyName() ?>
- Phone getPhoneNumber() ?>
- Email getEmailAddress() ?>
- Date Of Birth getDateOfBirth() ?>
- Address getPostalAddress() ?>
- Gender getGender() ?>
- Nationality getNationality() ?>
- Photo
-
+

Yoti User Profile

+
+
Given Name(s)
+
getGivenNames() ?>
+ +
Family Name
+
getFamilyName() ?>
+ +
Phone
+
getPhoneNumber() ?>
+ +
Email
+
getEmailAddress() ?>
+ +
Date Of Birth
+
getDateOfBirth() ?>
+ +
Address
+
getPostalAddress() ?>
+ +
Gender
+
getGender() ?>
+ +
Nationality
+
getNationality() ?>
+ +
Selfie as base64 data
+
+ +
Selfie as image file
+
+