在iOS中将clientToken传递给BTDropInController后,我没有收到付款选项。
但是当我对clientToken进行硬编码并且clientToken来自您的Hello-Client示例(https://developers.braintreepayments.com/start/hello-client/ios/v4)时,DropIn上有一种付款方式。
使用Postman对从我们的服务器生成的clientToken进行硬编码时,它也不起作用。
当我使用iOS应用程序从我们的服务器生成clientToken而未将其传递给BTDropInController时,并将其分享给我的同事(Android Developer),他的Android应用程序显示PayPal的付款选项。
一些代码:
private func showBraintreeDropInWithToken(_ clientToken: String, subscription: Subscription) {
let request = BTDropInRequest()
let dropIn = BTDropInController(authorization: clientToken, request: request) { (controller, result, error) in
if let error = error {
self.showAlert("Payment gateway request failed. \(error.localizedDescription)", withCallBack: {
controller.dismiss()
})
return
}
if let result = result {
if result.isCancelled {
controller.dismiss()
return
}
// Use the BTDropInResult properties to update your UI
// result.paymentOptionType
// result.paymentMethod
// result.paymentIcon
// result.paymentDescription
}
}
self.tabBarController?.present(dropIn!, animated: true, completion: nil)
}
答案 0 :(得分:0)
<强>解决!强>
https://github.com/braintree/braintree_ios/issues/393#issuecomment-371891330
只需安装PayPal依赖项即可完成设置,不要忘记Url Schemes的其他设置。