ios - 如何从 Braintree iOs SDK 中获取 nonce
<p><p>我正在尝试从 Braintree 获取 nonce。我没有在以下文档中找到 Braintree 提供的有关如何从 Braintree SDK 获取 nonce 的任何文档。</p>
<p> <a href="https://developers.braintreepayments.com/start/hello-client/ios/v4" rel="noreferrer noopener nofollow">https://developers.braintreepayments.com/start/hello-client/ios/v4</a> </p>
<p>请告诉我如何从 Braintree iOs SDK 中获取 nonce</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>您可以使用 drop in 方法获取 Payment nonce
让 nonce = result.paymentMethod!.nonce</p>
<p>示例:- </p>
<pre><code>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)
}
</code></pre></p>
<p style="font-size: 20px;">关于ios - 如何从 Braintree iOs SDK 中获取 nonce,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/35199248/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/35199248/
</a>
</p>
页:
[1]