Vgs Expiry Serializer
Splits a card expiry value into separate month and year JSON fields on submit.
Pass an instance to com.verygoodsecurity.vgscollect.widget.compose.state.rememberVgsExpiryTextFieldState when your VGS route expects the month and year in distinct keys instead of a single combined value. Example payload:
{
"card": {
"expiry": {
"month": "12",
"year": "27"
}
}
}Content copied to clipboard
Parameters
month Field Name
JSON key the month is sent under.
year Field Name
JSON key the year is sent under.
Functions
Link copied to clipboard
fun getSerialized(text: String, inputFormat: VgsExpiryDateFormat, outputFormat: VgsExpiryDateFormat): List<Pair<String, String>>
Serialises text into a list of (fieldName, value) pairs ready for submission.