0

我实施了结帐流程,但出现以下错误

ios模拟器截图

代码 :

func startCheckout() {
        // Example: Initialize BTAPIClient, if you haven't already
        braintreeClient = BTAPIClient(authorization: clientToken)!
        let payPalDriver = BTPayPalDriver(apiClient: braintreeClient)
        payPalDriver.viewControllerPresentingDelegate = self
        payPalDriver.appSwitchDelegate = self // Optional

        // Specify the transaction amount here. "2.32" is used in this example.
        let request = BTPayPalRequest(amount: "2.32")
        request.currencyCode = "USD" // Optional; see BTPayPalRequest.h for more options

        payPalDriver.requestOneTimePayment(request) { (tokenizedPayPalAccount, error) in
            if let tokenizedPayPalAccount = tokenizedPayPalAccount {
                print("Got a nonce: \(tokenizedPayPalAccount.nonce)")

                // Access additional information
                let email = tokenizedPayPalAccount.email
                let firstName = tokenizedPayPalAccount.firstName
                let lastName = tokenizedPayPalAccount.lastName
                let phone = tokenizedPayPalAccount.phone

                // See BTPostalAddress.h for details
                let billingAddress = tokenizedPayPalAccount.billingAddress
                let shippingAddress = tokenizedPayPalAccount.shippingAddress
            } else if let error = error {
                print("Error here")
                // Handle error here...
            } else {
                print("Buyer cancelled the payment")
                // Buyer canceled payment approval
            }
        }
    }

我按照这个文档链接

4

1 回答 1

0

此问题的最常见原因是由于 paypal 中的配置。

您可以在以下链接中检查您的配置 https://docs.woocommerce.com/document/paypal-standard/

此链接适用于 woo-commerce,但会帮助您进行帐户配置。

于 2017-08-30T07:10:10.760 回答