Is there a way to specify that only numbers can be entered into a credit card number field or a CVV iFields field? Or can the system generate an error message if the format is not valid?

Answer

As of the v2.6.1912.1301-beta, you can specify an event to trigger a callback-based on events in the iField using the function addIfieldCallback (event, callback). This callback will receive some data about events in the iField, such as whether the card number and/or CVV are valid. The card number validation is based on minimum and maximum lengths and whether it passes the Luhn check. The CVV validation is based on the length, depending on the card issuer.


You can use a callback to prevent the call to get tokens. We recommend you perform the least client-side validation necessary because a mistake in the validation logic could prevent a transaction from being processed when it would otherwise have been approved. See the iField Key Pressed Callback section in the iFields documentation for an example of a callback being used to change the iField style based on whether the data in it is valid.

You might be also interested in:

Glossary of Terms

Here is a list of some of the most commonly used payment processing terms