Skip to content

Commit

Permalink
Merge pull request #21 from getyoti/ProfileAttributes
Browse files Browse the repository at this point in the history
[SDK-260]: Added new profile attributes
  • Loading branch information
echarrod authored Feb 7, 2018
2 parents 241108d + c9bd950 commit 88da24c
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -187,9 +188,11 @@ 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`
* [X] Email Address `email_address`
* [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`
Expand Down
14 changes: 14 additions & 0 deletions examples/yoti_example_django/yoti_example/templates/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ <h3><a href="/">Home</a></h3>
</tr>
{% endif %}

{% if full_name %}
<tr>
<td>Full Name:</td>
<td>{{full_name}}</td>
</tr>
{% endif %}

{% if phone_number %}
<tr>
<td>Phone Number:</td>
Expand All @@ -53,6 +60,13 @@ <h3><a href="/">Home</a></h3>
</tr>
{% endif %}

{% if age_verified %}
<tr>
<td>Age Verified:</td>
<td>{{age_verified}}</td>
</tr>
{% endif %}

{% if postal_address %}
<tr>
<td>Postal Address:</td>
Expand Down
4 changes: 4 additions & 0 deletions examples/yoti_example_django/yoti_example/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions examples/yoti_example_flask/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
14 changes: 14 additions & 0 deletions examples/yoti_example_flask/templates/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ <h3><a href="/">Home</a></h3>
</tr>
{% endif %}

{% if full_name %}
<tr>
<td>Full Name:</td>
<td>{{full_name}}</td>
</tr>
{% endif %}

{% if phone_number %}
<tr>
<td>Phone Number:</td>
Expand All @@ -53,6 +60,13 @@ <h3><a href="/">Home</a></h3>
</tr>
{% endif %}

{% if age_verified %}
<tr>
<td>Age Verified:</td>
<td>{{age_verified}}</td>
</tr>
{% endif %}

{% if postal_address %}
<tr>
<td>Postal Address:</td>
Expand Down
7 changes: 7 additions & 0 deletions plugins/django_yoti/django_yoti/templates/yoti_profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ <h3><a href="/">Home</a></h3>
</tr>
{% endif %}

{% if full_name %}
<tr>
<td>Full Name:</td>
<td>{{full_name}}</td>
</tr>
{% endif %}

{% if phone_number %}
<tr>
<td>Phone Number:</td>
Expand Down
7 changes: 7 additions & 0 deletions plugins/flask_yoti/flask_yoti/templates/yoti_profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ <h3><a href="/">Home</a></h3>
</tr>
{% endif %}

{% if full_name %}
<tr>
<td>Full Name:</td>
<td>{{full_name}}</td>
</tr>
{% endif %}

{% if phone_number %}
<tr>
<td>Phone Number:</td>
Expand Down

0 comments on commit 88da24c

Please sign in to comment.