Factory
Options
All keys are optional.card does not accept required or validate. Every visible card field is always required and validation is built in. Suppress optional atoms with fields.holderName.hidden, fields.postalCode.hidden, or fields.cardSecurityCode.hidden instead.
fields
cardNumber (secured iframe)
disabled, hidden, autoFocus, id, ariaLabel are intentionally not exposed on this field: the secured iframe does not honor them.
cardExpiration (secured iframe)
cardSecurityCode (secured iframe)
Hide the security code only for card programs that do not require CVC (for example, some private-label or corporate cards). Hiding it removes the field from validation.
holderName (native input)
autoFocus is not supported. The secured card-number iframe grabs initial focus.
postalCode (native input)
Same shape as holderName. Default label 'Postal code'.
Value
The card element emits an encrypted value envelope ononSubmit. Raw card data never leaves the secured iframes; every sensitive field is encrypted before it reaches your handler.
encrypted* fields. holderName and postalCode are present only when the corresponding field is visible and non-empty. encryptedSecurityCode is present only when fields.cardSecurityCode.hidden is not set.
Events
Every element event is supported:onReady, onChange, onSubmit, onError, onFocus, onBlur, onEscapeKeyPressed. See Events overview.
FieldError.field values
'cardNumber', 'expiryDate', 'cvc', 'holderName', 'postalCode'.
Methods
card.mount(selector)card.update(partialOptions)card.submit()card.unmount()card.destroy()card.on(event, handler)