I'm using the STPPaymentCardTextField
to collect card information from the user.
I can use the delegate method of the STPPaymentCardTextFieldDelegate
to get information like the 'cardNumber
, expirationMonth
etc:
func paymentCardTextFieldDidChange(_ textField: STPPaymentCardTextField) {
print("NUMBER", textField.cardNumber)
print("EXP MONTH", textField.expirationMonth)
print("EXP YEAR", textField.expirationYear)
print("CVC", textField.cvc)
}
However, this textField seems to also display the card type, based on the info the user types in:
How can I programmatically access this card type? I use this in another UIView
to generate a preview of the card, set its background color and logo based on the card type etc.