Skip to content

Commit ca9a005

Browse files
Add verification attempt-assets endpoints and card scheduled_activation_date
1 parent 605a3da commit ca9a005

23 files changed

Lines changed: 1129 additions & 36 deletions

‎checkout_sdk/identities/addressdocumentverification/addressdocumentverification.py‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,41 @@
22

33

44
class DeclaredData:
5+
"""The personal details provided by the applicant.
6+
7+
Maps IdvDeclaredData. The identity verification requests take the larger
8+
IdvIdentityDeclaredData shape and keep their own copy of this class.
9+
"""
10+
# The applicant's name.
11+
# [Required]
12+
# min 2 characters, max 255 characters
13+
# Example: Hannah Bret
514
name: str
15+
# The applicant's birth date.
16+
# [Optional]
17+
# Format: YYYY-MM-DD
18+
# Example: 1994-10-15
19+
birth_date: str
620

721

822
class AddressDocumentVerificationRequest:
23+
"""Request body for POST /address-document-verifications."""
24+
# The applicant's unique identifier.
25+
# [Required]
26+
# ^aplt_\w+$
927
applicant_id: str
28+
# Your configuration ID.
29+
# [Required]
30+
# ^usj_[a-z2-7]{26}$
1031
user_journey_id: str
32+
# The personal details provided by the applicant.
33+
# [Optional]
1134
declared_data: DeclaredData
1235

1336

1437
class AddressDocumentVerificationAttemptRequest:
38+
"""Request body for POST /address-document-verifications/{id}/attempts."""
39+
# The address document image to verify, as a binary upload.
40+
# [Required]
41+
# Format: binary
1542
document: str

‎checkout_sdk/identities/addressdocumentverification/addressdocumentverification_client.py‎

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from checkout_sdk.authorization_type import AuthorizationType
55
from checkout_sdk.checkout_configuration import CheckoutConfiguration
66
from checkout_sdk.client import Client
7+
from checkout_sdk.identities.entities import AttemptAssetsQueryFilter, AttemptsQueryFilter
78
from checkout_sdk.identities.addressdocumentverification.addressdocumentverification import (
89
AddressDocumentVerificationRequest, AddressDocumentVerificationAttemptRequest
910
)
@@ -14,6 +15,7 @@ class AddressDocumentVerificationClient(Client):
1415
__ANONYMIZE_PATH = 'anonymize'
1516
__ATTEMPTS_PATH = 'attempts'
1617
__PDF_REPORT_PATH = 'pdf-report'
18+
__ASSETS_PATH = 'assets'
1719

1820
def __init__(self, api_client: ApiClient, configuration: CheckoutConfiguration):
1921
super().__init__(api_client=api_client,
@@ -44,11 +46,23 @@ def create_address_document_verification_attempt(self, address_document_verifica
4446
self._sdk_authorization(),
4547
request)
4648

47-
def get_address_document_verification_attempts(self, address_document_verification_id: str):
49+
def get_address_document_verification_attempts(self, address_document_verification_id: str,
50+
query: AttemptsQueryFilter = None):
51+
"""Get the details of all attempts for a specific address document verification.
52+
53+
Results are paginated. Beta.
54+
55+
Args:
56+
address_document_verification_id: The address document verification's unique identifier.
57+
query: Optional skip and limit pagination parameters.
58+
Returns:
59+
ResponseWrapper with the paginated attempt list.
60+
"""
4861
return self._api_client.get(
4962
self.build_path(self.__ADDRESS_DOCUMENT_VERIFICATIONS_PATH, address_document_verification_id,
5063
self.__ATTEMPTS_PATH),
51-
self._sdk_authorization())
64+
self._sdk_authorization(),
65+
query)
5266

5367
def get_address_document_verification_attempt(self, address_document_verification_id: str, attempt_id: str):
5468
return self._api_client.get(
@@ -61,3 +75,23 @@ def get_address_document_verification_report(self, address_document_verification
6175
self.build_path(self.__ADDRESS_DOCUMENT_VERIFICATIONS_PATH, address_document_verification_id,
6276
self.__PDF_REPORT_PATH),
6377
self._sdk_authorization())
78+
79+
def get_address_document_verification_attempt_assets(self, address_document_verification_id: str,
80+
attempt_id: str,
81+
query: AttemptAssetsQueryFilter = None):
82+
"""Get the assets (the document image) uploaded for an address document verification attempt.
83+
84+
Results are paginated. Beta.
85+
86+
Args:
87+
address_document_verification_id: The address document verification's unique identifier.
88+
attempt_id: The attempt's unique identifier.
89+
query: Optional skip and limit pagination parameters.
90+
Returns:
91+
ResponseWrapper with the paginated asset list.
92+
"""
93+
return self._api_client.get(
94+
self.build_path(self.__ADDRESS_DOCUMENT_VERIFICATIONS_PATH, address_document_verification_id,
95+
self.__ATTEMPTS_PATH, attempt_id, self.__ASSETS_PATH),
96+
self._sdk_authorization(),
97+
query)
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,74 @@
1+
from __future__ import absolute_import
2+
3+
4+
class AttemptsQueryFilter:
5+
"""Pagination for the list-attempts endpoints."""
6+
# The number of attempts to skip.
7+
# [Optional]
8+
# Default: 0
9+
skip: int
10+
# The maximum number of attempts to return.
11+
# [Optional]
12+
# Default: 10
13+
limit: int
14+
15+
116
class AttemptAssetsQueryFilter:
17+
"""Pagination for the attempt-assets endpoints."""
18+
# The number of assets to skip.
19+
# [Optional]
20+
# Default: 0
221
skip: int
22+
# The maximum number of assets to return.
23+
# [Optional]
24+
# Default: 10
325
limit: int
26+
27+
28+
class PhoneNumber:
29+
"""The applicant's mobile phone number, if sharing the attempt URL via SMS."""
30+
# The international phone country code. This is a dialling prefix, not an ISO country code.
31+
# [Required]
32+
# ^\+(\d+)$
33+
# Example: +33
34+
country_code: str
35+
# The applicant's mobile number, without the country code.
36+
# [Required]
37+
# ^\d{1,14}$
38+
# Example: 5555550102
39+
number: str
40+
41+
42+
class IdvAddress:
43+
"""The applicant's address."""
44+
# The first line of the address.
45+
# [Optional]
46+
# max 250 characters
47+
# Example: 123 Main Street
48+
address_line1: str
49+
# The second line of the address.
50+
# [Optional]
51+
# max 250 characters
52+
# Example: Apt 4B
53+
address_line2: str
54+
# The city or town.
55+
# [Optional]
56+
# max 50 characters
57+
# Example: London
58+
city: str
59+
# The state, county, or province.
60+
# [Optional]
61+
# max 50 characters
62+
# Example: Greater London
63+
state: str
64+
# The postal or ZIP code.
65+
# [Optional]
66+
# max 50 characters
67+
# Example: SW1A 1AA
68+
zip: str
69+
# The two-letter ISO country code of the address.
70+
# [Optional]
71+
# Standard: ISO 3166-1 alpha-2 country code
72+
# max 2 characters
73+
# Example: GB
74+
country: str
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,48 @@
11
from __future__ import absolute_import
22

3+
from checkout_sdk.identities.entities import PhoneNumber
4+
35

46
class ClientInformation:
7+
"""The applicant's details for a face authentication attempt.
8+
9+
Maps FavClientInformation. Deliberately smaller than the identity verification copy in
10+
checkout_sdk.identities.identityverification: the face authentication attempt schema does not
11+
declare pre_selected_document_issuing_country or pre_selected_document_type, so sending them
12+
here would be a request the API rejects.
13+
"""
14+
# The applicant's residence country.
15+
# [Optional]
16+
# Standard: ISO 3166-1 alpha-2 country code
17+
# ^[A-Z]{2}
18+
# Example: FR
519
pre_selected_residence_country: str
20+
# The language you want to use for the user interface.
21+
# [Optional]
22+
# Format: IETF BCP 47 language tag
23+
# Example: en-US
624
pre_selected_language: str
725

826

927
class FaceAuthenticationRequest:
28+
"""Request body for POST /face-authentications."""
29+
# The applicant's unique identifier.
30+
# [Required]
1031
applicant_id: str
32+
# Your configuration ID.
33+
# [Optional]
1134
user_journey_id: str
1235

1336

1437
class FaceAuthenticationAttemptRequest:
38+
"""Request body for POST /face-authentications/{id}/attempts."""
39+
# The URL to redirect the applicant to after the attempt.
40+
# [Required]
41+
# Format: uri
1542
redirect_url: str
43+
# The applicant's mobile phone number, if sharing the attempt URL via SMS.
44+
# [Optional]
45+
phone_number: PhoneNumber
46+
# The applicant's details.
47+
# [Optional]
1648
client_information: ClientInformation

‎checkout_sdk/identities/faceauthentication/faceauthentication_client.py‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from checkout_sdk.authorization_type import AuthorizationType
55
from checkout_sdk.checkout_configuration import CheckoutConfiguration
66
from checkout_sdk.client import Client
7-
from checkout_sdk.identities.entities import AttemptAssetsQueryFilter
7+
from checkout_sdk.identities.entities import AttemptAssetsQueryFilter, AttemptsQueryFilter
88
from checkout_sdk.identities.faceauthentication.faceauthentication import (
99
FaceAuthenticationRequest, FaceAuthenticationAttemptRequest
1010
)
@@ -42,10 +42,22 @@ def create_face_authentication_attempt(self, face_authentication_id: str,
4242
self._sdk_authorization(),
4343
request)
4444

45-
def get_face_authentication_attempts(self, face_authentication_id: str):
45+
def get_face_authentication_attempts(self, face_authentication_id: str,
46+
query: AttemptsQueryFilter = None):
47+
"""Get the details of all attempts for a specific face authentication.
48+
49+
Results are paginated. Beta.
50+
51+
Args:
52+
face_authentication_id: The face authentication's unique identifier.
53+
query: Optional skip and limit pagination parameters.
54+
Returns:
55+
ResponseWrapper with the paginated attempt list.
56+
"""
4657
return self._api_client.get(
4758
self.build_path(self.__FACE_AUTHENTICATIONS_PATH, face_authentication_id, self.__ATTEMPTS_PATH),
48-
self._sdk_authorization())
59+
self._sdk_authorization(),
60+
query)
4961

5062
def get_face_authentication_attempt(self, face_authentication_id: str, attempt_id: str):
5163
return self._api_client.get(

‎checkout_sdk/identities/iddocumentverification/iddocumentverification.py‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,43 @@
22

33

44
class DeclaredData:
5+
"""The personal details provided by the applicant.
6+
7+
Maps IdvDeclaredData. The identity verification requests take the larger
8+
IdvIdentityDeclaredData shape and keep their own copy of this class.
9+
"""
10+
# The applicant's name.
11+
# [Required]
12+
# min 2 characters, max 255 characters
13+
# Example: Hannah Bret
514
name: str
15+
# The applicant's birth date.
16+
# [Optional]
17+
# Format: YYYY-MM-DD
18+
# Example: 1994-10-15
19+
birth_date: str
620

721

822
class IdDocumentVerificationRequest:
23+
"""Request body for POST /id-document-verifications."""
24+
# The applicant's unique identifier.
25+
# [Required]
926
applicant_id: str
27+
# Your configuration ID.
28+
# [Optional]
1029
user_journey_id: str
30+
# The personal details provided by the applicant.
31+
# [Optional]
1132
declared_data: DeclaredData
1233

1334

1435
class IdDocumentVerificationAttemptRequest:
36+
"""Request body for POST /id-document-verifications/{id}/attempts."""
37+
# The front image of the identity document, as a binary upload.
38+
# [Required]
39+
# Format: binary
1540
document_front: str
41+
# The back image of the identity document, as a binary upload.
42+
# [Optional]
43+
# Format: binary
1644
document_back: str

‎checkout_sdk/identities/iddocumentverification/iddocumentverification_client.py‎

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from checkout_sdk.authorization_type import AuthorizationType
55
from checkout_sdk.checkout_configuration import CheckoutConfiguration
66
from checkout_sdk.client import Client
7+
from checkout_sdk.identities.entities import AttemptAssetsQueryFilter, AttemptsQueryFilter
78
from checkout_sdk.identities.iddocumentverification.iddocumentverification import (
89
IdDocumentVerificationRequest, IdDocumentVerificationAttemptRequest
910
)
@@ -14,6 +15,7 @@ class IdDocumentVerificationClient(Client):
1415
__ANONYMIZE_PATH = 'anonymize'
1516
__ATTEMPTS_PATH = 'attempts'
1617
__PDF_REPORT_PATH = 'pdf-report'
18+
__ASSETS_PATH = 'assets'
1719

1820
def __init__(self, api_client: ApiClient, configuration: CheckoutConfiguration):
1921
super().__init__(api_client=api_client,
@@ -44,11 +46,23 @@ def create_id_document_verification_attempt(self, id_document_verification_id: s
4446
self._sdk_authorization(),
4547
request)
4648

47-
def get_id_document_verification_attempts(self, id_document_verification_id: str):
49+
def get_id_document_verification_attempts(self, id_document_verification_id: str,
50+
query: AttemptsQueryFilter = None):
51+
"""Get the details of all attempts for a specific ID document verification.
52+
53+
Results are paginated. Beta.
54+
55+
Args:
56+
id_document_verification_id: The ID document verification's unique identifier.
57+
query: Optional skip and limit pagination parameters.
58+
Returns:
59+
ResponseWrapper with the paginated attempt list.
60+
"""
4861
return self._api_client.get(
4962
self.build_path(self.__ID_DOCUMENT_VERIFICATIONS_PATH, id_document_verification_id,
5063
self.__ATTEMPTS_PATH),
51-
self._sdk_authorization())
64+
self._sdk_authorization(),
65+
query)
5266

5367
def get_id_document_verification_attempt(self, id_document_verification_id: str, attempt_id: str):
5468
return self._api_client.get(
@@ -61,3 +75,23 @@ def get_id_document_verification_report(self, id_document_verification_id: str):
6175
self.build_path(self.__ID_DOCUMENT_VERIFICATIONS_PATH, id_document_verification_id,
6276
self.__PDF_REPORT_PATH),
6377
self._sdk_authorization())
78+
79+
def get_id_document_verification_attempt_assets(self, id_document_verification_id: str, attempt_id: str,
80+
query: AttemptAssetsQueryFilter = None):
81+
"""Get the assets (the front and back images of the document) uploaded for an ID document
82+
verification attempt.
83+
84+
Results are paginated. Beta.
85+
86+
Args:
87+
id_document_verification_id: The ID document verification's unique identifier.
88+
attempt_id: The attempt's unique identifier.
89+
query: Optional skip and limit pagination parameters.
90+
Returns:
91+
ResponseWrapper with the paginated asset list.
92+
"""
93+
return self._api_client.get(
94+
self.build_path(self.__ID_DOCUMENT_VERIFICATIONS_PATH, id_document_verification_id,
95+
self.__ATTEMPTS_PATH, attempt_id, self.__ASSETS_PATH),
96+
self._sdk_authorization(),
97+
query)

0 commit comments

Comments
 (0)