STPCardValidationState

enum STPCardValidationState {}

These fields indicate whether a card field represents a valid value, invalid value, or incomplete value.

  • The field’s contents are valid. For example, a valid, 16-digit card number. Note that valid values may not be complete. For example: a US Zip code can be 5 or 9 digits. A 5-digit code is Valid, but more text could be entered to transition to incomplete again. American Express CVC codes can be 3 or 4 digits and both will be treated as Valid.

    Declaration

    Objective-C

    STPCardValidationStateValid

    Swift

    case valid = 0
  • The field’s contents are invalid. For example, an expiration date of 13/42.

    Declaration

    Objective-C

    STPCardValidationStateInvalid

    Swift

    case invalid = 1
  • The field’s contents are not currently valid, but could be by typing additional characters. For example, a CVC of 1.

    Declaration

    Objective-C

    STPCardValidationStateIncomplete

    Swift

    case incomplete = 2