Cybersource - not able to catch Microform fields error

80 Views Asked by At

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:

 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

0

There are 0 best solutions below