Skip to content

Commit ba1fa71

Browse files
committed
SDK-1098: Update ApplicationProfile syntax and parse encrypted data into attribute list:
1 parent 0e28d7e commit ba1fa71

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

yoti_python_sdk/activity_details.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111

1212
class ActivityDetails:
1313
def __init__(self, receipt, decrypted_profile=None, decrypted_application_profile=None):
14-
self.decrypted_profile = decrypted_profile
14+
self.decrypted_profile = decrypted_profile # TODO: This isn't used, can we remove it?
1515
self.user_profile = {} # will be removed in v3.0.0
1616
self.base64_selfie_uri = None
17-
self.application_profile = None
17+
self.decrypted_application_profile = decrypted_application_profile
1818

1919
if decrypted_profile and hasattr(decrypted_profile, "attributes"):
2020
decrypted_profile_attributes = decrypted_profile.attributes
@@ -56,7 +56,6 @@ def __init__(self, receipt, decrypted_profile=None, decrypted_application_profil
5656
)
5757

5858
self.ensure_postal_address()
59-
6059

6160
if decrypted_application_profile and hasattr(decrypted_application_profile, "attributes"):
6261
decrypted_application_profile_attributes = decrypted_application_profile.attributes

yoti_python_sdk/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ def get_activity_details(self, encrypted_request_token):
9292
)
9393

9494
attribute_list = proto.attribute_list(decrypted_data)
95-
return ActivityDetails(receipt, attribute_list, decrypted_application_profile=decrypted_application_data)
95+
application_attribute_list = proto.attribute_list(decrypted_application_data)
96+
return ActivityDetails(receipt, attribute_list, decrypted_application_profile=application_attribute_list)
9697

9798
def perform_aml_check(self, aml_profile):
9899
if aml_profile is None:

yoti_python_sdk/profile.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from yoti_python_sdk.image import Image
88
from yoti_python_sdk import document_details
99

10-
class BaseProfile:
10+
class BaseProfile(object):
1111

1212
def __init__(self, profile_attributes):
1313
self.attributes = {}
@@ -57,7 +57,7 @@ def get_attribute(self, attribute_name):
5757

5858
class Profile(BaseProfile):
5959
def __init__(self, profile_attributes):
60-
BaseProfile.__init__(self, profile_attributes)
60+
super(Profile, self).__init__(profile_attributes)
6161
self.ensure_postal_address()
6262

6363
@property
@@ -179,10 +179,10 @@ def ensure_postal_address(self):
179179
structured_postal_address.anchors,
180180
)
181181

182-
def ApplicationProfile(BaseProfile):
183182

183+
class ApplicationProfile(BaseProfile):
184184
def __init__(self, profile_attributes):
185-
BaseProfile.__init__(self, profile_attributes)
185+
super(ApplicationProfile, self).__init__(profile_attributes)
186186

187187
@property
188188
def application_name(self):

0 commit comments

Comments
 (0)