Auto focus
Automatically focus a field when it loads by setting theautoFocus option to true.
This is useful for focusing the card number field when the payment form first appears.
Only one field should have
autoFocus enabled at a time.Input masking
Mask the values in the card number and security code fields to hide sensitive data. Masking replaces digits with a special character (default•).
Mask on blur
By default, masking is applied when the field loses focus and removed when it regains focus.character:
Real-time masking
To mask the input as the user types, enable themaskOnInput option.
When real-time masking is enabled, each character is briefly shown in plain text as the user types it, then redacted after a short delay. This preview behavior is always on when using real-time masking and is not configurable.
Show last four digits
For card number fields, you can keep the last four digits visible when masking a valid card number by settingshowLastFour to true.
The
showLastFour option is only available on card number fields.Mask input options
Programmatic masking
You can also mask and unmask a field programmatically using theredactValue() and
unredactValue() methods. This lets you build a custom show/hide toggle.
Auto advance
Automatically move focus to the next field when the current field’s value is complete and valid.Custom field order
By default, auto advance follows the order: card number, expiry date, security code. You can override this with thefieldOrder option.
fieldOrder are number, expiryDate, and securityCode.
Reset
Each field instance exposes aclear() method to reset its value programmatically.
Scheme icons
Display card scheme icons inside the card number field. Icons update in real-time as the user types and are refined when the API confirms the scheme. Passtrue to show the detected scheme icon along with any additional schemes
(for example co-branded cards):
Scheme icon options
A maximum of 3 icons are visible at any time. In co-branded scenarios, the primary scheme
icon is displayed first, followed by additional schemes. Each icon is 48 px wide with
4 px spacing, so reserve at least 156 px of horizontal space inside the card
number input to fit all 3 icons.