【问题标题】:No Payment Option After Passing ClientToken to BTDropInController将 ClientToken 传递给 BTDropInController 后没有付款选项
【发布时间】:2018-08-17 16:14:13
【问题描述】:
  1. 在 iOS 中将 clientToken 传递给 BTDropInController 后,我没有收到付款选项。

  2. 但是,当我对 clientToken 进行硬编码并且 clientToken 来自您的 Hello-Client 示例 (https://developers.braintreepayments.com/start/hello-client/ios/v4) 时,DropIn 上有一种付款方式。

  3. 当使用 Postman 对从我们的服务器生成的 clientToken 进行硬编码时,它无法正常工作。

  4. 当我使用 iOS 应用程序从我们的服务器生成一个 clientToken 而不将其传递给 BTDropInController` 并将其分享给我的同事(Android 开发人员)时,他的 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)
    }

【问题讨论】:

    标签: ios paypal braintree


    【解决方案1】:

    已解决!

    https://github.com/braintree/braintree_ios/issues/393#issuecomment-371891330

    只需安装 PayPal 依赖项,一切就绪,不要忘记 Url Schemes 的额外设置。

    【讨论】:

      猜你喜欢
      • 2017-11-14
      • 2021-10-13
      • 2019-03-10
      • 2017-12-13
      • 2018-11-14
      • 1970-01-01
      • 2021-02-18
      • 2015-08-18
      • 2015-06-16
      相关资源
      最近更新 更多