VgsCardNumberTextFieldState

Immutable state for a VGS card number field.

Obtain an instance with rememberVgsCardNumberTextFieldState inside a composable. The state is replaced (not mutated) on every keystroke; pass the latest instance to your VgsCardNumber…TextField and update it from the widget's onStateChange:

var state by rememberVgsCardNumberTextFieldState(
collect = vgsCollect,
fieldName = "data.card_number",
)
VgsCardNumberOutlinedTextField(
state = state,
onStateChange = { state = it },
)

Useful properties:

  • cardBrand — detected brand for the current input.

  • bin / last4 — non-sensitive metadata, populated only when isValid.

  • isValid / validationResult — current validation outcome.

  • fieldName — JSON key used in the submit payload.

Properties

Link copied to clipboard
val bin: String?
Link copied to clipboard
Link copied to clipboard

current length of the entered value.

Link copied to clipboard

JSON key the value is sent under in the submit payload.

Link copied to clipboard

true when the field has no input.

Link copied to clipboard

true when every validator reports a valid result.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

optional tokenization settings; when present, the value is tokenized on submit and the token is sent in its place.

Link copied to clipboard

per-validator outcomes for the current value.

Link copied to clipboard

custom validators applied to the value, or null to use the field's default validators.

Functions

Link copied to clipboard
open override fun toString(): String