var returnPNGImage = true;
var apiKey="To be generated from CAMS API Monitor";
capture(apiKey, returnPNGImage);
...
compare(apiKey,temlate1,temlate2);
function onCaptureSuccess(data)
{
var plainData = data;
var scannerData = getScannerSuccessData(plainData);
var template = scannerData.template;
var pngImageContent = "data:image/png;base64," + scannerData.image;
}
function onCaptureFailure(data)
{
var failureData = getScannerFailureData(data);
var erroString = failureData.errorString;
}
function onCompareSuccess(data)
{
var plainData = data;
var scannerData = getScannerSuccessData(plainData);
var matchingScore = scannerData.matchScore;
}
function onCompareFailure(data)
{
var failureData = getScannerFailureData(data);
var erroString = failureData.errorString;
}