Skip to content

Commit

Permalink
Make citizenship required (#47)
Browse files Browse the repository at this point in the history
* Make citizenship required

* Add citizenship to biometric verification

* Add citizenship to basic kyc
remove citizenship from basic kyc

* Add tests for citizenship

---------

Co-authored-by: tams sokari <[email protected]>
  • Loading branch information
ayinloya and tamssokari authored Sep 1, 2023
1 parent 379fcc6 commit 3d23e45
Show file tree
Hide file tree
Showing 12 changed files with 495 additions and 4 deletions.
7 changes: 5 additions & 2 deletions cypress/fixtures/products_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"NATIONAL_ID",
"ALIEN_CARD",
"PASSPORT",
"NATIONAL_ID_NO_PHOTO"
"NATIONAL_ID_NO_PHOTO",
"DRIVERS_LICENSE"
],
"NG": [
"V_NIN",
Expand Down Expand Up @@ -94,7 +95,9 @@
"NATIONAL_ID",
"ALIEN_CARD",
"PASSPORT",
"NATIONAL_ID_NO_PHOTO"
"NATIONAL_ID_NO_PHOTO",
"DRIVERS_LICENSE",
"KRA_PIN"
],
"NG": [
"V_NIN",
Expand Down
39 changes: 39 additions & 0 deletions cypress/fixtures/services.json
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,19 @@
"label": "Passport",
"test_data": "00000000",
"id_number_regex": "^[A-Z0-9]{7,9}$"
},
"DRIVERS_LICENSE": {
"required_fields": [
"country",
"id_type",
"id_number",
"citizenship",
"user_id",
"job_id"
],
"label": "Driver's License",
"test_data": "00000000",
"id_number_regex": "^[0-9]{1,9}$"
}
}
},
Expand Down Expand Up @@ -900,6 +913,32 @@
"label": "Passport",
"test_data": "00000000",
"id_number_regex": "^[A-Z0-9]{7,9}$"
},
"KRA_PIN": {
"required_fields": [
"country",
"id_type",
"id_number",
"citizenship",
"user_id",
"job_id"
],
"label": "KRA PIN",
"test_data": "00000000",
"id_number_regex": "^[0-9]{1,9}$"
},
"DRIVERS_LICENSE": {
"required_fields": [
"country",
"id_type",
"id_number",
"citizenship",
"user_id",
"job_id"
],
"label": "Driver's License",
"test_data": "00000000",
"id_number_regex": "^[0-9]{1,9}$"
}
}
},
Expand Down
49 changes: 49 additions & 0 deletions cypress/pages/kra-verification-basic-kyc.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!doctype html>
<html lang='en'>
<head>
<meta name='viewport' content='width=device-width, initial-scale=1' />
<style>
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}

body {
max-width: 100%;
min-height: 100%;
}
</style>
</head>

<body>
<script
src='js/script.min.js'>
</script>

<script>
SmileIdentity({
token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVyX3BhcmFtcyI6eyJ1c2VyX2lkIjoid2ViLXRva2VuLXRlc3QtdXNlci0wMDQiLCJqb2JfaWQiOiJ3ZWItdG9rZW4tam9iLTIwMCIsImpvYl90eXBlIjo1fSwiY2FsbGJhY2tfdXJsIjoiaHR0cHM6Ly93ZWJob29rLnNpdGUvMWFhYTdhN2ItYWNjYi00MGFjLTg2NDMtZmQ4YTg3MDNlOWJlIiwiaWF0IjoxNjQ3NjI4ODAxLCJleHAiOjE2NDkyNzY0MjN9.YJKc3LG3m36Pw1wdWksbUwqO3t9WDM9uyeIudFh0_zg',
product: 'basic_kyc',
callback_url: 'https://webhook.site/1aaa7a7b-accb-40ac-8643-fd8a8703e9be',
environment: 'sandbox',
consent_required: {
'KE': ['DRIVERS_LICENSE', 'PASSPORT']
},
partner_details: {
name: 'Test Org',
logo_url: 'https://portal.smileidentity.com/favicon.ico',
partner_id: '212',
policy_url: 'https://smileidentity.com/privacy-policy',
theme_color: '#000',
},
onSuccess: () => {
},
onClose: () => {
},
});
</script>
</body>
</html>
49 changes: 49 additions & 0 deletions cypress/pages/kra-verification-ekyc.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!doctype html>
<html lang='en'>
<head>
<meta name='viewport' content='width=device-width, initial-scale=1' />
<style>
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}

body {
max-width: 100%;
min-height: 100%;
}
</style>
</head>

<body>
<script
src='js/script.min.js'>
</script>

<script>
SmileIdentity({
token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVyX3BhcmFtcyI6eyJ1c2VyX2lkIjoid2ViLXRva2VuLXRlc3QtdXNlci0wMDQiLCJqb2JfaWQiOiJ3ZWItdG9rZW4tam9iLTIwMCIsImpvYl90eXBlIjo1fSwiY2FsbGJhY2tfdXJsIjoiaHR0cHM6Ly93ZWJob29rLnNpdGUvMWFhYTdhN2ItYWNjYi00MGFjLTg2NDMtZmQ4YTg3MDNlOWJlIiwiaWF0IjoxNjQ3NjI4ODAxLCJleHAiOjE2NDkyNzY0MjN9.YJKc3LG3m36Pw1wdWksbUwqO3t9WDM9uyeIudFh0_zg',
product: 'enhanced_kyc',
callback_url: 'https://webhook.site/1aaa7a7b-accb-40ac-8643-fd8a8703e9be',
environment: 'sandbox',
consent_required: {
'KE': ['KRA_PIN', 'DRIVERS_LICENSE']
},
partner_details: {
name: 'Test Org',
logo_url: 'https://portal.smileidentity.com/favicon.ico',
partner_id: '212',
policy_url: 'https://smileidentity.com/privacy-policy',
theme_color: '#000',
},
onSuccess: () => {
},
onClose: () => {
},
});
</script>
</body>
</html>
44 changes: 44 additions & 0 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,50 @@ Cypress.Commands.add('selectPASSPORTIDType', () => {
.click();
});

Cypress.Commands.add('selectKRAType', () => {
cy
.loadIDOptions();

cy.log('selectKRAType');

cy
.getIFrameBody()
.find('#country')
.select('KE')

cy
.getIFrameBody()
.find('#id_type')
.select('KRA_PIN')

cy
.getIFrameBody()
.find('#submitConfig')
.click();
});

Cypress.Commands.add('selectKEDriversLicenseType', () => {
cy
.loadIDOptions();

cy.log('selectDriversLicenseType');

cy
.getIFrameBody()
.find('#country')
.select('KE')

cy
.getIFrameBody()
.find('#id_type')
.select('DRIVERS_LICENSE')

cy
.getIFrameBody()
.find('#submitConfig')
.click();
});

Cypress.Commands.add('getTotpConsentApp', () => {
cy.getIFrameBody()
.find('end-user-consent')
Expand Down
Loading

0 comments on commit 3d23e45

Please sign in to comment.