Skip to content

Commit

Permalink
Merge pull request #166 from getyoti/release-3.10.0
Browse files Browse the repository at this point in the history
Release 3.10.0
  • Loading branch information
davidgrayston authored May 18, 2020
2 parents 0215623 + 9e7d003 commit 73e5ce5
Show file tree
Hide file tree
Showing 61 changed files with 1,606 additions and 194 deletions.
4 changes: 2 additions & 2 deletions config/yoti.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
const constants = require('../src/yoti_common/constants');

const yoti = {
connectApi: process.env.YOTI_CONNECT_API || `${constants.API_BASE_URL}/api/v1`,
docScanApi: process.env.YOTI_DOC_SCAN_API || `${constants.API_BASE_URL}/idverify/v1`,
connectApi: process.env.YOTI_CONNECT_API || process.env.YOTI_API_URL || `${constants.API_BASE_URL}/api/v1`,
docScanApi: process.env.YOTI_DOC_SCAN_API || process.env.YOTI_DOC_SCAN_API_URL || `${constants.API_BASE_URL}/idverify/v1`,
};

module.exports = yoti;
3 changes: 1 addition & 2 deletions examples/doc-scan/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ YOTI_CLIENT_SDK_ID=
YOTI_KEY_FILE_PATH=

# Optional configuration.
YOTI_DOC_SCAN_IFRAME_URL=
YOTI_DOC_SCAN_API=
YOTI_DOC_SCAN_API_URL=
6 changes: 4 additions & 2 deletions examples/doc-scan/config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
const fs = require('fs');

const yotiConfig = require('yoti/config').yoti;

module.exports = {
YOTI_CLIENT_SDK_ID: process.env.YOTI_CLIENT_SDK_ID,
YOTI_PEM: fs.readFileSync(process.env.YOTI_KEY_FILE_PATH),
YOTI_DOC_SCAN_IFRAME_URL: process.env.YOTI_DOC_SCAN_IFRAME_URL || 'https://api.yoti.com/idverify/v1/web/index.html',
YOTI_APP_BASE_URL: process.env.YOTI_APP_BASE_URL || 'http://localhost:3000',
YOTI_DOC_SCAN_IFRAME_URL: `${yotiConfig.docScanApi}/web/index.html`,
YOTI_APP_BASE_URL: process.env.YOTI_APP_BASE_URL || 'https://localhost:3000',
};
1 change: 1 addition & 0 deletions examples/doc-scan/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const router = express.Router();
router.get('/', controllers.indexController);
router.get('/success', controllers.successController);
router.get('/media', controllers.mediaController);
router.get('/error', controllers.errorController);

app.use('/', router);

Expand Down
9 changes: 9 additions & 0 deletions examples/doc-scan/src/controllers/error.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = async (req, res) => {
let error = 'An unknown error occurred';

if (req.query.yotiErrorCode) {
error = `Error Code: ${req.query.yotiErrorCode}`;
}

res.render('pages/error', { error });
};
2 changes: 2 additions & 0 deletions examples/doc-scan/src/controllers/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
const indexController = require('./index.controller');
const successController = require('./success.controller');
const mediaController = require('./media.controller');
const errorController = require('./error.controller');

module.exports = {
indexController,
successController,
mediaController,
errorController,
};
10 changes: 9 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ const {
RequestedLivenessCheckBuilder,
RequestedTextExtractionTaskBuilder,
DocScanConstants,
RequiredIdDocumentBuilder,
DocumentRestrictionsFilterBuilder,
DocumentRestrictionBuilder,
OrthogonalRestrictionsFilterBuilder,
} = require('./src/doc_scan_service');

module.exports = {
Expand All @@ -50,12 +54,16 @@ module.exports = {
RequestBuilder,
Payload,
YotiDate,
constants,
SessionSpecificationBuilder,
NotificationConfigBuilder,
SdkConfigBuilder,
RequestedDocumentAuthenticityCheckBuilder,
RequestedFaceMatchCheckBuilder,
RequestedLivenessCheckBuilder,
RequestedTextExtractionTaskBuilder,
constants,
RequiredIdDocumentBuilder,
DocumentRestrictionsFilterBuilder,
DocumentRestrictionBuilder,
OrthogonalRestrictionsFilterBuilder,
};
Loading

0 comments on commit 73e5ce5

Please sign in to comment.