cardToken throughout - the element patches the stored card in place rather than creating a new one.
Why this is needed
A card verification code can’t be stored, so the CVC captured when you tokenized a card expires while the rest of the card stays valid. Charging a stored card after that point requires a fresh CVC from the buyer. This element is how you collect it.Usage
cardToken is the token you received from a previous cardEl.submit() call - see the Card Element.
To apply the new code, call validate() then submit():
Options
cardToken string
Required. The card token identifying the stored card to update.
styles CvcStyles
Optional. Customize the appearance of the CVC input.
CvcStyles reference
cardVerification accepts the same CardElementStyle shape documented under the Card Element - base, complete, invalid, empty, container, placeholder, label, labelContainer, fonts, and the pseudo-class overrides.
Methods
validate() → Promise<boolean>
Returns true when the field contains a valid code. Use this to gate your submit button.
submit() → Promise<void>
Applies the entered code to the stored card. Resolves on success and rejects with the failure reason otherwise. The cardToken is unchanged - after this resolves you can charge it again.
destroy()
Removes the iframe and cleans up all event listeners. Call this when navigating away or unmounting a component.
Full example
React
Related
Card Element
Collect and tokenize a full card
Server SDK - Checkout
Build headless checkout flows server-side