From 6dee68f6588445ad3d3426790d536a78d32e8ee7 Mon Sep 17 00:00:00 2001 From: Edward Harrod Date: Tue, 6 Feb 2018 13:56:13 +0000 Subject: [PATCH 1/4] [SDK-260]: Added full_name attribute --- README.md | 2 ++ .../yoti_example/templates/profile.html | 7 +++++++ examples/yoti_example_flask/templates/profile.html | 7 +++++++ .../django_yoti/django_yoti/templates/yoti_profile.html | 7 +++++++ plugins/flask_yoti/flask_yoti/templates/yoti_profile.html | 7 +++++++ 5 files changed, 30 insertions(+) diff --git a/README.md b/README.md index fa1a85ad..fd2ff7b1 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,7 @@ user_id = user_profile.get('user_id') selfie = user_profile.get('selfie') given_names = user_profile.get('given_names') family_name = user_profile.get('family_name') +full_name = user_profile.get('full_name') phone_number = user_profile.get('phone_number') date_of_birth = user_profile.get('date_of_birth') postal_address = user_profile.get('postal_address') @@ -187,6 +188,7 @@ For information on testing with multiple Python versions, see [VERSION-SUPPORT.m * [X] Photo `selfie` * [X] Given Names `given_names` * [X] Family Name `family_name` + * [X] Full Name `full_name` * [X] Mobile Number `phone_number` * [X] Email address `email_address` * [X] Date of Birth `date_of_birth` diff --git a/examples/yoti_example_django/yoti_example/templates/profile.html b/examples/yoti_example_django/yoti_example/templates/profile.html index 09f36452..67f2e8bd 100644 --- a/examples/yoti_example_django/yoti_example/templates/profile.html +++ b/examples/yoti_example_django/yoti_example/templates/profile.html @@ -39,6 +39,13 @@

Home

{% endif %} + {% if full_name %} + + Full Name: + {{full_name}} + + {% endif %} + {% if phone_number %} Phone Number: diff --git a/examples/yoti_example_flask/templates/profile.html b/examples/yoti_example_flask/templates/profile.html index eb7fca22..ac80d77b 100644 --- a/examples/yoti_example_flask/templates/profile.html +++ b/examples/yoti_example_flask/templates/profile.html @@ -39,6 +39,13 @@

Home

{% endif %} + {% if full_name %} + + Full Name: + {{full_name}} + + {% endif %} + {% if phone_number %} Phone Number: diff --git a/plugins/django_yoti/django_yoti/templates/yoti_profile.html b/plugins/django_yoti/django_yoti/templates/yoti_profile.html index 9577b653..8f805ced 100644 --- a/plugins/django_yoti/django_yoti/templates/yoti_profile.html +++ b/plugins/django_yoti/django_yoti/templates/yoti_profile.html @@ -35,6 +35,13 @@

Home

{% endif %} + {% if full_name %} + + Full Name: + {{full_name}} + + {% endif %} + {% if phone_number %} Phone Number: diff --git a/plugins/flask_yoti/flask_yoti/templates/yoti_profile.html b/plugins/flask_yoti/flask_yoti/templates/yoti_profile.html index 386fd1a3..1827f16a 100644 --- a/plugins/flask_yoti/flask_yoti/templates/yoti_profile.html +++ b/plugins/flask_yoti/flask_yoti/templates/yoti_profile.html @@ -35,6 +35,13 @@

Home

{% endif %} + {% if full_name %} + + Full Name: + {{full_name}} + + {% endif %} + {% if phone_number %} Phone Number: From 5497932ff1ca416a0d111f593f043625c95375da Mon Sep 17 00:00:00 2001 From: Edward Harrod Date: Tue, 6 Feb 2018 15:37:42 +0000 Subject: [PATCH 2/4] [SDK-260]: Added age_verified attribute structure --- README.md | 4 +++- .../yoti_example/templates/profile.html | 7 +++++++ examples/yoti_example_django/yoti_example/views.py | 4 ++++ examples/yoti_example_flask/app.py | 4 ++++ examples/yoti_example_flask/templates/profile.html | 7 +++++++ 5 files changed, 25 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fd2ff7b1..d2fd8335 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,7 @@ family_name = user_profile.get('family_name') full_name = user_profile.get('full_name') phone_number = user_profile.get('phone_number') date_of_birth = user_profile.get('date_of_birth') +age_verified = user_profile.get('age_verified') postal_address = user_profile.get('postal_address') gender = user_profile.get('gender') nationality = user_profile.get('nationality') @@ -191,7 +192,8 @@ For information on testing with multiple Python versions, see [VERSION-SUPPORT.m * [X] Full Name `full_name` * [X] Mobile Number `phone_number` * [X] Email address `email_address` - * [X] Date of Birth `date_of_birth` + * [X] Age / Date of Birth `date_of_birth` + * [X] Age / Verify Condition `age_[over|under]:[1-999]` * [X] Address `postal_address` * [X] Gender `gender` * [X] Nationality `nationality` diff --git a/examples/yoti_example_django/yoti_example/templates/profile.html b/examples/yoti_example_django/yoti_example/templates/profile.html index 67f2e8bd..8dc25741 100644 --- a/examples/yoti_example_django/yoti_example/templates/profile.html +++ b/examples/yoti_example_django/yoti_example/templates/profile.html @@ -60,6 +60,13 @@

Home

{% endif %} + {% if age_verified %} + + Age Verified: + {{age_verified}} + + {% endif %} + {% if postal_address %} Postal Address: diff --git a/examples/yoti_example_django/yoti_example/views.py b/examples/yoti_example_django/yoti_example/views.py index d41b91be..14dc5f5c 100644 --- a/examples/yoti_example_django/yoti_example/views.py +++ b/examples/yoti_example_django/yoti_example/views.py @@ -25,6 +25,10 @@ def get(self, request, *args, **kwargs): activity_details = client.get_activity_details(request.GET['token']) context = activity_details.user_profile context['base64_selfie_uri'] = getattr(activity_details, 'base64_selfie_uri') + + # This key uses the format: age_[over|under]:[1-999] and is dynamically + # generated based on the dashboard attribute Age / Verify Condition + context['age_verified'] = context.get('age_over:18') selfie = context.get('selfie') if selfie is not None: self.save_image(selfie) diff --git a/examples/yoti_example_flask/app.py b/examples/yoti_example_flask/app.py index bbc25f43..7427a084 100644 --- a/examples/yoti_example_flask/app.py +++ b/examples/yoti_example_flask/app.py @@ -37,6 +37,10 @@ def auth(): activity_details = client.get_activity_details(request.args['token']) user_profile = activity_details.user_profile user_profile['base64_selfie_uri'] = getattr(activity_details, 'base64_selfie_uri') + + # This key uses the format: age_[over|under]:[1-999] and is dynamically + # generated based on the dashboard attribute Age / Verify Condition + user_profile['age_verified'] = user_profile.get('age_over:18') selfie = user_profile.get('selfie') if selfie is not None: save_image(selfie) diff --git a/examples/yoti_example_flask/templates/profile.html b/examples/yoti_example_flask/templates/profile.html index ac80d77b..b4a0f457 100644 --- a/examples/yoti_example_flask/templates/profile.html +++ b/examples/yoti_example_flask/templates/profile.html @@ -60,6 +60,13 @@

Home

{% endif %} + {% if age_verified %} + + Age Verified: + {{age_verified}} + + {% endif %} + {% if postal_address %} Postal Address: From 1b78a0ba9847ae05b423866a75874df213e0dc12 Mon Sep 17 00:00:00 2001 From: Edward Harrod Date: Tue, 6 Feb 2018 15:44:13 +0000 Subject: [PATCH 3/4] Corrected spacing & indentation --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d2fd8335..be178933 100644 --- a/README.md +++ b/README.md @@ -191,9 +191,9 @@ For information on testing with multiple Python versions, see [VERSION-SUPPORT.m * [X] Family Name `family_name` * [X] Full Name `full_name` * [X] Mobile Number `phone_number` - * [X] Email address `email_address` + * [X] Email Address `email_address` * [X] Age / Date of Birth `date_of_birth` - * [X] Age / Verify Condition `age_[over|under]:[1-999]` + * [X] Age / Verify Condition `age_[over|under]:[1-999]` * [X] Address `postal_address` * [X] Gender `gender` * [X] Nationality `nationality` From c9bd950e036fcbc08253526bc7930080a3419adb Mon Sep 17 00:00:00 2001 From: Edward Harrod Date: Tue, 6 Feb 2018 15:57:20 +0000 Subject: [PATCH 4/4] [SDK-260]: Corrected README - removed age_verified --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index be178933..56c0258d 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,6 @@ family_name = user_profile.get('family_name') full_name = user_profile.get('full_name') phone_number = user_profile.get('phone_number') date_of_birth = user_profile.get('date_of_birth') -age_verified = user_profile.get('age_verified') postal_address = user_profile.get('postal_address') gender = user_profile.get('gender') nationality = user_profile.get('nationality')