如何使用card.io SDK扫描短代码和帐号?
我为此实现了两个委托
func userDidCancel(_ paymentViewController: CardIOPaymentViewController!) {
resultLabel.text = "user canceled"
paymentViewController?.dismiss(animated: true, completion: nil)
}
func userDidProvide(_ cardInfo: CardIOCreditCardInfo!, in paymentViewController: CardIOPaymentViewController!) {
if let info = cardInfo {
let str = NSString(format: "Received card info.\n Number: %@\n expiry: %02lu/%lu\n cvv: %@.", info.redactedCardNumber, info.expiryMonth, info.expiryYear, info.cvv )
if info.cardholderName != nil{
str.appending("\n Name: \(info.cardholderName)")
}
resultLabel.text = str as String
}
paymentViewController?.dismiss(animated: true, completion: nil)
}