From f071ffd74e656ebc6a2316a46031a7958fe32d46 Mon Sep 17 00:00:00 2001 From: gabino Date: Mon, 11 Aug 2025 16:20:04 -0600 Subject: [PATCH 01/10] Update proof_of_life_document to include selfie step --- mati/resources/verifications.py | 2 +- mati/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mati/resources/verifications.py b/mati/resources/verifications.py index 355f03c..53e8c6d 100644 --- a/mati/resources/verifications.py +++ b/mati/resources/verifications.py @@ -82,7 +82,7 @@ def proof_of_residency_document(self) -> Optional[VerificationDocument]: def proof_of_life_document(self) -> Optional[Liveness]: if not self.steps: return None - pol = [pol for pol in self.steps if pol.id == 'liveness'] + pol = [pol for pol in self.steps if (pol.id == 'liveness' or pol.id == 'selfie')] return pol[-1] if pol else None @property diff --git a/mati/version.py b/mati/version.py index 4b259db..08edf96 100644 --- a/mati/version.py +++ b/mati/version.py @@ -1 +1 @@ -__version__ = '2.0.7' +__version__ = '2.0.8.dev1' From c36ab3d6e1367af01a8dcbdc3b154c34ac45f2ca Mon Sep 17 00:00:00 2001 From: gabino Date: Mon, 11 Aug 2025 16:25:27 -0600 Subject: [PATCH 02/10] Format --- mati/resources/verifications.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mati/resources/verifications.py b/mati/resources/verifications.py index 53e8c6d..1edf268 100644 --- a/mati/resources/verifications.py +++ b/mati/resources/verifications.py @@ -82,7 +82,11 @@ def proof_of_residency_document(self) -> Optional[VerificationDocument]: def proof_of_life_document(self) -> Optional[Liveness]: if not self.steps: return None - pol = [pol for pol in self.steps if (pol.id == 'liveness' or pol.id == 'selfie')] + pol = [ + pol + for pol in self.steps + if (pol.id == 'liveness' or pol.id == 'selfie') + ] return pol[-1] if pol else None @property From 0d3929cfb57456fb77b64200db6608868e1807ae Mon Sep 17 00:00:00 2001 From: gabino Date: Mon, 11 Aug 2025 17:09:36 -0600 Subject: [PATCH 03/10] Update version to 2.0.8 --- mati/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mati/version.py b/mati/version.py index 08edf96..2940e26 100644 --- a/mati/version.py +++ b/mati/version.py @@ -1 +1 @@ -__version__ = '2.0.8.dev1' +__version__ = '2.0.8' From bc9222800fb9bed459a854c982c00ce7b0b3f0e2 Mon Sep 17 00:00:00 2001 From: gabino Date: Wed, 13 Aug 2025 13:26:53 -0600 Subject: [PATCH 04/10] Refactor proof_of_life_document method to use list --- mati/resources/verifications.py | 8 ++------ mati/version.py | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/mati/resources/verifications.py b/mati/resources/verifications.py index 1edf268..e625fc6 100644 --- a/mati/resources/verifications.py +++ b/mati/resources/verifications.py @@ -82,11 +82,7 @@ def proof_of_residency_document(self) -> Optional[VerificationDocument]: def proof_of_life_document(self) -> Optional[Liveness]: if not self.steps: return None - pol = [ - pol - for pol in self.steps - if (pol.id == 'liveness' or pol.id == 'selfie') - ] + pol = [pol for pol in self.steps if pol.id in ['liveness', 'selfie']] return pol[-1] if pol else None @property @@ -101,7 +97,7 @@ def proof_of_life_errors(self) -> List[Errors]: else None, ) for pol in self.steps # type: ignore - if pol.id == 'liveness' and pol.error + if pol.id in ['liveness', 'selfie'] and pol.error ] @property diff --git a/mati/version.py b/mati/version.py index 2940e26..1b52cbf 100644 --- a/mati/version.py +++ b/mati/version.py @@ -1 +1 @@ -__version__ = '2.0.8' +__version__ = '2.0.8.dev2' From eb18fcd324fce4e20e39b340cfd77fddd3ebad92 Mon Sep 17 00:00:00 2001 From: gabino Date: Wed, 13 Aug 2025 13:30:16 -0600 Subject: [PATCH 05/10] Update version to 2.0.8 --- mati/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mati/version.py b/mati/version.py index 1b52cbf..2940e26 100644 --- a/mati/version.py +++ b/mati/version.py @@ -1 +1 @@ -__version__ = '2.0.8.dev2' +__version__ = '2.0.8' From c86c06553552e08879d87d83116e0048fb62e37e Mon Sep 17 00:00:00 2001 From: gabino Date: Wed, 13 Aug 2025 14:49:37 -0600 Subject: [PATCH 06/10] Update version to 2.0.8.dev3 --- mati/resources/verifications.py | 10 ++++++++++ mati/version.py | 2 +- tests/resources/test_verifications.py | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/mati/resources/verifications.py b/mati/resources/verifications.py index e625fc6..450ba4a 100644 --- a/mati/resources/verifications.py +++ b/mati/resources/verifications.py @@ -85,6 +85,16 @@ def proof_of_life_document(self) -> Optional[Liveness]: pol = [pol for pol in self.steps if pol.id in ['liveness', 'selfie']] return pol[-1] if pol else None + @property + def proof_of_life_url(self) -> Optional[str]: + pol = self.proof_of_life_document + if not pol or not pol.data: + return None + url = pol.data.get('video_url') or pol.data.get( # type: ignore + 'selfie_photo_url' + ) + return url + @property def proof_of_life_errors(self) -> List[Errors]: return [ diff --git a/mati/version.py b/mati/version.py index 2940e26..e4d8ef5 100644 --- a/mati/version.py +++ b/mati/version.py @@ -1 +1 @@ -__version__ = '2.0.8' +__version__ = '2.0.8.dev3' diff --git a/tests/resources/test_verifications.py b/tests/resources/test_verifications.py index 64a3249..17484a6 100644 --- a/tests/resources/test_verifications.py +++ b/tests/resources/test_verifications.py @@ -21,6 +21,7 @@ def test_retrieve_full_verification(client: Client): assert verification.govt_id_validation.is_valid assert verification.proof_of_life_validation.is_valid assert verification.proof_of_residency_validation.is_valid + assert verification.proof_of_life_url assert not verification.govt_id_document.errors assert not verification.proof_of_residency_document.errors assert not verification.proof_of_life_errors From 5b787a9a0bca13023981b281432ba8863f28ecfb Mon Sep 17 00:00:00 2001 From: gabino Date: Wed, 13 Aug 2025 14:54:15 -0600 Subject: [PATCH 07/10] Refactor proof_of_life_url property --- mati/resources/verifications.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mati/resources/verifications.py b/mati/resources/verifications.py index 450ba4a..8001e9d 100644 --- a/mati/resources/verifications.py +++ b/mati/resources/verifications.py @@ -88,12 +88,9 @@ def proof_of_life_document(self) -> Optional[Liveness]: @property def proof_of_life_url(self) -> Optional[str]: pol = self.proof_of_life_document - if not pol or not pol.data: - return None - url = pol.data.get('video_url') or pol.data.get( # type: ignore + return pol.data.get('video_url') or pol.data.get( # type: ignore 'selfie_photo_url' ) - return url @property def proof_of_life_errors(self) -> List[Errors]: From 06a9ae8a153b2112da453c6482f659880ef984f2 Mon Sep 17 00:00:00 2001 From: gabino Date: Wed, 13 Aug 2025 15:05:59 -0600 Subject: [PATCH 08/10] Enhance proof_of_life_url property to handle missing documents --- mati/resources/verifications.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mati/resources/verifications.py b/mati/resources/verifications.py index 8001e9d..6f30682 100644 --- a/mati/resources/verifications.py +++ b/mati/resources/verifications.py @@ -88,9 +88,10 @@ def proof_of_life_document(self) -> Optional[Liveness]: @property def proof_of_life_url(self) -> Optional[str]: pol = self.proof_of_life_document - return pol.data.get('video_url') or pol.data.get( # type: ignore - 'selfie_photo_url' - ) + if not pol: + return None + data = getattr(pol, 'data', {}) or {} + return data.get('video_url') or data.get('selfie_photo_url') @property def proof_of_life_errors(self) -> List[Errors]: From 57cf17c5992dcb4d590a6f3f663b42e18527fbd0 Mon Sep 17 00:00:00 2001 From: gabino Date: Wed, 13 Aug 2025 15:09:30 -0600 Subject: [PATCH 09/10] Add assertion for proof_of_life_url in test_verification_without_liveness --- mati/version.py | 2 +- tests/resources/test_verifications.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mati/version.py b/mati/version.py index e4d8ef5..5a80d14 100644 --- a/mati/version.py +++ b/mati/version.py @@ -1 +1 @@ -__version__ = '2.0.8.dev3' +__version__ = '2.0.8.dev4' diff --git a/tests/resources/test_verifications.py b/tests/resources/test_verifications.py index 17484a6..681e519 100644 --- a/tests/resources/test_verifications.py +++ b/tests/resources/test_verifications.py @@ -38,6 +38,7 @@ def test_verification_without_liveness(client: Client): verification = client.verifications.retrieve('5d9fb1f5bfbfac001a349bfb') verification.steps = [] assert not verification.proof_of_life_document + assert not verification.proof_of_life_url @pytest.mark.vcr From 31198a41a0df5f2554ad235e3d92fc6822315dc6 Mon Sep 17 00:00:00 2001 From: gabino Date: Thu, 14 Aug 2025 17:56:20 -0600 Subject: [PATCH 10/10] Update version to 2.0.8 --- mati/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mati/version.py b/mati/version.py index 5a80d14..2940e26 100644 --- a/mati/version.py +++ b/mati/version.py @@ -1 +1 @@ -__version__ = '2.0.8.dev4' +__version__ = '2.0.8'