使用排序代码和帐号扫描借记卡

时间:2017-11-20 06:44:14

标签: ios swift card.io

如何使用card.io SDK扫描短代码和帐号? enter image description here

我为此实现了两个委托

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

0 个答案:

没有答案