v4.7.0
New
Surface error details in Profile and Digital Identity services
Surface errorReason
for identity profile receipt/activity.
Usage
Share v1 - via Profile service
Given the share is complete and token
received:
const activityDetails = await yotiClient.getActivityDetails(token);
const outcome = activityDetails.getOutcome();
const errorDetails = activityDetails.getErrorDetails();
/*
Description of errorDetails:
- errorCode: string, ie 'FRAUD_DETECTED', 'MANDATORY_DOCUMENT_NOT_PROVIDED'...
- description: string
- errorReason: optional object with 'requirementsNotMetDetails' field
errorReason: {
requirementsNotMetDetails: [
{
failureType, //string
documentType, //string
documentCountryIsoCode, //string
auditId, //string
details, //string
},
...
]
}
*/
Share v2 - via Digital Identity service
Given the share is complete (assuming the receiptId
was retrieved):
const receipt = await sdkDigitalIdentityClient.getShareReceipt(receiptId);
const receiptError = receipt.getError();
if(receiptError) {
const receiptErrorReason = receipt.getErrorReason();
/*
If defined, object of shape:
{
requirementsNotMetDetails: [
{
failureType, //string
documentType, //string
documentCountryIsoCode, //string
auditId, //string
details, //string
},
...
]
}
*/
}
Surface error details in Identity Verification service
Surface the 'requirements not met details' within the IdentityProfile FailureReasonResponse.
Usage
Given a session (with identity profile requirement) is completed and retrieved:
const sessionResult = await idvClient.getSession(sessionId);
const identityProfile = sessionResult.getIdentityProfile();
if (identityProfile) {
const failureReason = identityProfile.getFailureReason();
if (failureReason) {
const reasonCode = failureReason.getReasonCode(); // string
const requirementsNotMetDetails = failureReason.getRequirementsNotMetDetails(); // Array of RequirementsNotMetDetail
/*
RequirementsNotMetDetail shape as follows:
{
failureType, //string
documentType, //string
documentCountryIsoCode, //string
auditId, //string
details, //string
}
*/
}
}