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
}
}
}
我正在关注本文档link
嗨,您是否成功整合PayPal?我可以使用PayPal登录屏幕,但登录后会显示返回给商家。这里有什么问题?它没有显示支付的金额。请以流量帮助我。 – Rajesh