0

我正在使用以下功能来请求 Paypal 计费协议:

private func fetchNounceForPayPal(type : String, token : String, viewControllerPresentingDelegate : UIViewController?, appSwitchDelegate : UIViewController? ) {
        self.braintreeClient = BTAPIClient(authorization: token)
        if let client = self.braintreeClient {
            self.payPalDriver = BTPayPalDriver(apiClient: client)
            let req = BTPayPalRequest.init()
            if type == PaymentMethods.paypalCredit.getRawValue() {
                req.offerCredit = true
            }
            
            if let driver = self.payPalDriver {
                driver.viewControllerPresentingDelegate = viewControllerPresentingDelegate as? BTViewControllerPresentingDelegate
                driver.appSwitchDelegate = appSwitchDelegate as? BTAppSwitchDelegate
                                    
                driver.requestBillingAgreement(req) { (tokenizedPayPalAccount, error) in
                    printLog("requestBillingAgreement \(String(describing: tokenizedPayPalAccount)) , \(String(describing: error)) , \(String(describing: self.brainTreePayPalDelegate)) ")
                }
            }
        }
    }

我只在 iOS 13 中遇到了崩溃。在其他版本上,它工作正常。这是崩溃的屏幕截图: 在此处输入图像描述

4

0 回答 0