onVindiciaFieldEvent property can be used to call your function when validation events are happening inside the iframes.
onVindiciaFieldEvent: function(event) {
if (event.detail.fieldType == 'cardNumber') {
setCardImage(event.detail.cardType); // bright or dim the card logo
} if (event.detail.fieldType == 'expirationDate') {
if (!event.detail.isValid)
{alert('vindiciaFieldEvent expirationDate not valid');
}
}
if (event.detail.fieldType == 'cvn') {
if (!event.detail.isValid && event.detail.dataLength > 0)
{
alert('vindiciaFieldEvent cvn not valid');
}
}
}
event.detail.fieldType | cardNumber, expirationDate, cvn or a custom string you provided during setup. - cardNumber—validation by Luhn check, forces all numeric characters, returns a cardType if detectable. - expirationDate—defaults to mm/yy format for validation, but you can specify another format. - cvnforces all numeric characters. Valid if character count is 3 or 4. |
|---|---|
event.detail.cardType | String property to hold the short name of the card type that was detected. It exists only on events with fieldType cardNumber. Supported values include: - amex - dankort - diners_club_carte_blanche - diners_club_international - discover - jcb - visa_electron - visa - mastercard - maestro |
event.detail.isValid | Boolean value. If True, the data is acceptable and can be submitted. If False, the value is illegal or incomplete. |
event.detail.dataLength | This method will return an integer that is a count of characters inside the input box in the iframe. A blank field returns zero. |
| Parent topic:Implementing HOA with Hosted Fields |

