贝宝 OAuth 2.0 设置

PayPal OAuth 2.0 set up

我参考了下面的视频来学习如何将 paypal 与 springboot 集成。 https://www.youtube.com/watch?v=GykDyG0ELms

根据视频,无需在我们的开发环境中设置 OAuth 2.0(Spring 启动)。

但在 PayPal 文档中提到 "Before you can integrate a PayPal product or solution, you must set up your development environment to get OAuth 2.0 client ID and secret credentials for the sandbox and live environments." https://developer.paypal.com/docs/api/overview/

我想澄清是否要设置OAuth 2.0以便顺利使用PayPal。

要使用 PayPal 的任何 REST API,您需要 client:secret 凭据来执行 oauth2 请求以获得 access_token。然后,您在其他 API 调用中使用此 access_token。

您链接的页面中记录了如何执行此操作:https://developer.paypal.com/docs/api/overview/#get-an-access-token


至于与 springboot 的集成,我不熟悉,但如果您的问题是这样,则无需设置或安装您自己的 OAuth 2.0 服务。连接到 PayPal 的 REST APIs 只需要连接到 PayPal 的 /oauth2 端点以获得上述 access_token 。如果您正在使用 SDK 或其他预先集成的代码路径,这可能已经为您实现了——但如果您正在执行自己的 HTTPS 调用,那么您需要自己实现对 /oauth2 的 HTTPS 调用。