我正在尝试从 Braintree 获取 nonce。我没有在以下文档中找到 Braintree 提供的有关如何从 Braintree SDK 获取 nonce 的任何文档。
https://developers.braintreepayments.com/start/hello-client/ios/v4
请告诉我如何从 Braintree iOs SDK 中获取 nonce
Best Answer-推荐答案 strong>
您可以使用 drop in 方法获取 Payment nonce
让 nonce = result.paymentMethod!.nonce
示例:-
func showDropIn(clientTokenOrTokenizationKey: String) {
let request = BTDropInRequest()
let dropIn = BTDropInController(authorization: clientTokenOrTokenizationKey, request: request)
{ (controller, result, error) in
if (error != nil) {
print("ERROR")
} else if (result?.isCancelled == true) {
print("CANCELLED")
} else if let result = result {
let nonce = result.paymentMethod!.nonce
print( nonce)
}
controller.dismiss(animated: true, completion: nil)
}
self.present(dropIn!, animated: true, completion: nil)
}
关于ios - 如何从 Braintree iOs SDK 中获取 nonce,我们在Stack Overflow上找到一个类似的问题:
https://stackoverflow.com/questions/35199248/
|