VgsExpirySerializer

class VgsExpirySerializer(monthFieldName: String, yearFieldName: String)

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"
}
}
}

Parameters

monthFieldName

JSON key the month is sent under.

yearFieldName

JSON key the year is sent under.

Constructors

Link copied to clipboard
constructor(monthFieldName: String, yearFieldName: String)

Functions

Link copied to clipboard

Serialises text into a list of (fieldName, value) pairs ready for submission.