チェックアウトフローを実装しましたが、以下のエラーが発生しています
コード :
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
}
}
}
私はこのドキュメントリンクをたどります