remember Vgs Cvc Text Field State
fun rememberVgsCvcTextFieldState(collect: VGSCollect, fieldName: String, validators: List<VgsTextFieldValidator>? = null, isCardBrandValidationEnabled: Boolean = true, tokenizationConfig: VgsCvcTokenizationConfig? = null): MutableState<VgsCvcTextFieldState>
Creates and remembers a VgsCvcTextFieldState for use with a VgsCvcTextField. This is the only way to obtain an instance — direct construction is internal to the SDK.
var state by rememberVgsCvcTextFieldState(
collect = vgsCollect,
fieldName = "data.cvc",
)Content copied to clipboard
Sync the brand from your card-number state via VgsCvcTextFieldState.withCardBrand so the field's required length adapts (3 digits for most brands, 4 for Amex).
Parameters
collect
the VGSCollect instance the field is bound to.
field Name
JSON key the value will be sent under by VGSCollect.asyncSubmit.
validators
custom validators. If null, the SDK applies default brand-aware length validation. Pass emptyList() to disable validation.
is Card Brand Validation Enabled
when true, length rules adapt to the currently synced VgsCvcTextFieldState.cardBrand.
tokenization Config
optional; when set, the value is tokenized on submit and the token is sent in place of the raw value.