我正在为我的项目使用braintree pod,它在获得随机数后运行良好。但我想检索卡图标和卡号的数字。
如何获取 imageView 中的卡片图标和 UILabel 中的卡号?
我使用了两个 pod 文件。
pod 'BraintreeDropIn'
pod 'BraintreeDropIn/UIKit'
我正在使用braintree文档提供的这个功能。
func showDropIn(clientTokenOrTokenizationKey: String) {
let request = BTDropInRequest()
//BTUIKAppearance.darkTheme()
//BTUIKAppearance.sharedInstance().primaryTextColor = UIColor.green
let dropIn = BTDropInController(authorization: clientTokenOrTokenizationKey, request: request)
{ (controller, result, error) in
if (error != nil) {
print("ERROR : \(error.debugDescription)")
} else if (result?.isCancelled == true) {
print("CANCELLED")
} else if let result = result {
// Use the BTDropInResult properties to update your UI
//result.paymentOptionType
//result.paymentMethod
//result.paymentIcon
//result.paymentDescription
if let outPut = result.paymentMethod {
print("\nNonce : \(outPut.nonce)")
self.paymentNonce = outPut.nonce
self.paymentCardType = result.paymentDescription.description
}
}
controller.dismiss(animated: true, completion: nil)
}
self.present(dropIn!, animated: true, completion: nil)
}