贝宝 - 本地结帐SDK(ios) - 无效范围

发布于 2025-02-08 20:51:48 字数 2222 浏览 1 评论 0原文

我正在关注本地结帐sdk https://developer.paypeveloper.paypal.com/limited.com/limited.com/limited -Release/native-Checkout/ios/使用与文档相同的代码

configuartion client ID并返回给定的URL

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
        FirebaseApp.configure()
        let config = CheckoutConfig(
                clientID: "XXX",
                returnUrl: "xyz",
                environment: .sandbox
            )
            Checkout.set(config: config)
        return true
    }
    func configurePayPalCheckout() {
           print("__________________________________________________________________________________________________")
           Checkout.setCreateOrderCallback { createOrderAction in
               let amount = PurchaseUnit.Amount(currencyCode: .usd, value: "10.00")
               let purchaseUnit = PurchaseUnit(amount: amount)
               let order = OrderRequest(intent: .capture, purchaseUnits: [purchaseUnit])

               createOrderAction.create(order: order)
           }

           Checkout.setOnApproveCallback { approval in
                approval.actions.capture { (response, error) in
                   print("Order successfully captured: \(response?.data)")
                    print("error ::::::::::::::::::::::::::::::::::::::::::::::",error)
               }
           }
            Checkout.setOnCancelCallback {
                // User has cancelled the payment experience
                print("cancel")
            }
            Checkout.setOnErrorCallback { error in
                // Handle the error generated by the SDK
                print("error" , error)
            }
    }

当我单击PayPal按钮时,它给我以下错误

对此感到抱歉 看来不支持此动作。请返回并报告此错误,以便我们将来可以支持它。 (无效范围)

对此很抱歉 看来不支持此动作。请返回并报告此错误,以便我们将来可以支持它。 (无效的范围)

如果有人面对这个问题,请有帮助 谢谢

I am following Native Checkout SDK https://developer.paypal.com/limited-release/native-checkout/ios/ and using the code same as documentation

Configuartion Client id and return url given

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
        FirebaseApp.configure()
        let config = CheckoutConfig(
                clientID: "XXX",
                returnUrl: "xyz",
                environment: .sandbox
            )
            Checkout.set(config: config)
        return true
    }
    func configurePayPalCheckout() {
           print("__________________________________________________________________________________________________")
           Checkout.setCreateOrderCallback { createOrderAction in
               let amount = PurchaseUnit.Amount(currencyCode: .usd, value: "10.00")
               let purchaseUnit = PurchaseUnit(amount: amount)
               let order = OrderRequest(intent: .capture, purchaseUnits: [purchaseUnit])

               createOrderAction.create(order: order)
           }

           Checkout.setOnApproveCallback { approval in
                approval.actions.capture { (response, error) in
                   print("Order successfully captured: \(response?.data)")
                    print("error ::::::::::::::::::::::::::::::::::::::::::::::",error)
               }
           }
            Checkout.setOnCancelCallback {
                // User has cancelled the payment experience
                print("cancel")
            }
            Checkout.setOnErrorCallback { error in
                // Handle the error generated by the SDK
                print("error" , error)
            }
    }

When i click on paypal button it gives me the below error

Sorry about that
Looks like this action is not supported. Please return and report this error so that we can support it in the future. (invalid scope)

Sorry about that
Looks like this action is not supported. Please return and report this error so that we can support it in the future. (invalid scope)

If anyone have faced this issue kindly do help
Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文