ios - 如何从 Braintree iOs SDK 获取随机数

标签 ios paypal braintree paypal-rest-sdk

我正在尝试从 Braintree 获取随机数。我在以下文档中没有找到Braintree提供的任何关于如何从Braintree SDK获取nonce的文档。

https://developers.braintreepayments.com/start/hello-client/ios/v4

请告诉我如何从 Braintree iOs SDK 获取随机数

最佳答案

您可以使用以下方法在 drop in 方法中获取付款随机数 让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 获取随机数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35199248/

相关文章:

javascript - iOS 上的 JQ UI 可拖动 : initiating dragging in taphold-handler

php - Paypal API : Invalid request parameter

c# - PayPal 沙盒执行调用返回错误 400 错误请求

javascript - 使用javascript根据另一个表单的onChange更改一个表单值

ios - 如何在自动布局中使用约束标识符以及如何使用标识符更改约束? [ swift ]

ios - 单击按钮更改背景图像

ruby-on-rails - Webmock:如何伪造 gzipped 响应?

node.js - Braintree 服务器端 - 客户端 token 和验证付款

ios - 实现react-native-fbsdkshare

ios - "Use of undeclared identifier ' Braintree '"在不使用 CocoaPods 的情况下手动集成 Braintree 后出现错误