There is a MicroformError class described in the Cybersource documentation
However, I can only catch the errors that occur during token creation (the error is returned in the callback function)
microform.createToken(options, function(err, token) {
if (err) {
// handle error
console.error(err);
...
} else {
...
}
});
});
I cannot catch other errors mentioned in the Cybersource documentation
The documentation mentions the 'error' event in some places, but in others not:
Microform Events (error event not mentioned)
Part of PDF documentation:
I've tried to subscribe to the 'error' event using something like:
field.on('error', (data: any) => console.log(data));
field.on('error', () => console.log('error occured'));
but none of them worked.
Do you know if it's possible to catch this kind of error?
PS. I'm doing it in an Angular app
