从Stripe STPPaymentCardTextField获取卡类型

问题描述 投票:0回答:1

我正在使用STPPaymentCardTextField从用户那里收集卡信息。

我可以使用STPPaymentCardTextFieldDelegate的委托方法来获取'cardNumberexpirationMonth等信息:

func paymentCardTextFieldDidChange(_ textField: STPPaymentCardTextField) {
   print("NUMBER", textField.cardNumber)
   print("EXP MONTH", textField.expirationMonth)
   print("EXP YEAR", textField.expirationYear)
   print("CVC", textField.cvc)   
}

但是,根据用户在enter image description here中输入的信息,此textField似乎也显示卡的类型。

我如何以编程方式访问此卡类型?我在另一个UIView中使用它来生成卡的预览,根据卡的类型等设置其背景颜色和徽标。

我正在使用STPPaymentCardTextField来收集用户的卡信息。我可以使用STPPaymentCardTextFieldDelegate的委托方法来获取信息,例如'cardNumber,...

ios swift stripe-payments credit-card
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.