VgsCardNumberTextField

fun VgsCardNumberTextField(state: VgsCardNumberTextFieldState, onStateChange: (state: VgsCardNumberTextFieldState) -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, readOnly: Boolean = false, textStyle: TextStyle = LocalTextStyle.current, label: @Composable () -> Unit? = null, placeholder: @Composable () -> Unit? = null, leadingIcon: @Composable () -> Unit? = null, trailingIcon: @Composable () -> Unit? = null, isError: Boolean = false, visualTransformation: VgsVisualTransformation = VgsMaskVisualTransformation(state.cardBrand.mask), keyboardOptions: KeyboardOptions = KeyboardOptions.Default, keyboardActions: KeyboardActions = KeyboardActions.Default, interactionSource: MutableInteractionSource? = null, shape: Shape = TextFieldDefaults.TextFieldShape, colors: TextFieldColors = TextFieldDefaults.textFieldColors())

Material filled text field for collecting a card number.

Obtain state with com.verygoodsecurity.vgscollect.widget.compose.state.rememberVgsCardNumberTextFieldState and pass the latest instance back through onStateChange. Read state.cardBrand to react to brand changes (e.g. drawing a brand icon in trailingIcon). All other parameters match androidx.compose.material.TextField.

The raw card number stays inside the SDK — submit by passing the state to com.verygoodsecurity.vgscollect.core.VGSCollect.asyncSubmit.

Parameters

state

current immutable field state.

onStateChange

invoked with the next state on every user edit.