gpt4 book ai didi

ios - 无法使用 braintree iOS 呈现 dropIn UI

转载 作者:塔克拉玛干 更新时间:2023-11-02 10:26:13 32 4
gpt4 key购买 nike

我正在创建一个支付应用程序并为此使用 braintree。我想使用 braintree dropIn UI。通过 pod 安装 BraintreeDropIn。使用以下代码呈现 dropIn UI。

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?.cancelled == true) {
print("CANCELLED")
} else if result != nil {
// Use the BTDropInResult properties to update your UI
// result.paymentOptionType
// result.paymentMethod
// result.paymentIcon
// result.paymentDescription
}
controller.dismissViewControllerAnimated(true, completion: nil)
}
self.presentViewController(dropIn!, animated: true, completion: nil)
}

我从 Tokenization Keys 下的沙盒控制面板获得了 tokenization key ,我将它传递给 showDropIn 函数。仍然没有显示任何内容,没有进入此功能

(BTDropInController(authorization: clientTokenOrTokenizationKey, request: request)
{ (controller, result, error))

最佳答案

尝试使用这个:

    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?.cancelled == true) {
print("CANCELLED")
} else if result != nil {
// Use the BTDropInResult properties to update your UI
// result.paymentOptionType
// result.paymentMethod
// result.paymentIcon
// result.paymentDescription
}
dispatch_async(dispatch_get_main_queue(), ^{
controller.dismissViewControllerAnimated(true, completion: nil)
});
}
dispatch_async(dispatch_get_main_queue(), ^{
self.presentViewController(dropIn!, animated: true, completion: nil)
});
}

希望这会奏效...!!

关于ios - 无法使用 braintree iOS 呈现 dropIn UI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41240551/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com