2017-08-30 18 views
0

我實現結賬流程和我得到以下錯誤的iOS:貝寶錯誤對不起事情不會出現在那一刻是工作

ios emulator screen shot

代碼:

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 
      } 
     } 
    } 

我正在關注本文檔link

+0

嗨,您是否成功整合PayPal?我可以使用PayPal登錄屏幕,但登錄後會顯示返回給商家。這裏有什麼問題?它沒有顯示支付的金額。請以流量幫助我。 – Rajesh

回答