Я пытаюсь интегрировать PayPal SDK в Swift 5. Я написал весь код, но все еще показывает «платежи этому продавцу не разрешены (неверный идентификатор клиента)», где, как тот же идентификатор клиента работает нормально в Android. Буду признателен за любую оказанную помощь. В Appdelegate я написал PayPalMobile.initializeWithClientIds (для сред: [PayPalEnvironmentProduction: «тест»,
PayPalEnvironmentSandbox : "test"])
[![enter image description here][1]][1]
let item1 = PayPalItem(name: "Old jeans with holes", withQuantity: 2, withPrice: NSDecimalNumber(string: "84.99"), withCurrency: "USD", withSku: "Hip-0037")
let item2 = PayPalItem(name: "Free rainbow patch", withQuantity: 1, withPrice: NSDecimalNumber(string: "0.00"), withCurrency: "USD", withSku: "Hip-00066")
let item3 = PayPalItem(name: "Long-sleeve plaid shirt (mustache not included)", withQuantity: 1, withPrice: NSDecimalNumber(string: "37.99"), withCurrency: "USD", withSku: "Hip-00291")
let items = [item1, item2, item3]
let subtotal = PayPalItem.totalPrice(forItems: items) //This is the total price of all the items
// Optional: include payment details
let shipping = NSDecimalNumber(string: "5.99")
let tax = NSDecimalNumber(string: "2.50")
let paymentDetails = PayPalPaymentDetails(subtotal: subtotal, withShipping: shipping, withTax: tax)
let total = subtotal.adding(shipping).adding(tax) //This is the total price including shipping and tax
let payment = PayPalPayment(amount: total, currencyCode: "USD", shortDescription: "Weavers", intent: .sale)
payment.items = items
payment.paymentDetails = paymentDetails
if (payment.processable) {
let paymentViewController = PayPalPaymentViewController(payment: payment, configuration: payPalConfig, delegate: self)
present(paymentViewController!, animated: true, completion: nil)
}
else {
// This particular payment will always be processable. If, for
// example, the amount was negative or the shortDescription was
// empty, this payment wouldn’t be processable, and you’d want
// to handle that here.
print("Payment not processalbe: (payment)")
}