PayPal节点SDK:PayPal-Rest-SDK和 @PayPal/paypal/Checkout-Server-SDK的差异?

发布于 2025-02-08 15:19:19 字数 645 浏览 1 评论 0原文

我有一个关于2个NPM PayPal软件包的问题,​​
有什么区别 PayPal-Rest-SDK和 @PayPal/Checkout-Server-SDK?您可以使用 @Paypal/Checkout-Server-SDK实现Webhooks,还是对此软件包不需要Webhooks?

paypal-rest-sdk

Checkout-server-server-sdk

var paypal = require('paypal-rest-sdk');

const paypal = require('@paypal/checkout-server-sdk');

I have this question regarding 2 npm PayPal packages, what is the difference between
paypal-rest-sdk and @paypal/checkout-server-sdk ? And can you implement webhooks using @paypal/checkout-server-sdk or there is no need for webhooks for this package ?

paypal-rest-sdk

checkout-server-sdk

var paypal = require('paypal-rest-sdk');

const paypal = require('@paypal/checkout-server-sdk');

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

空城之時有危險 2025-02-15 15:19:19

所有paypal - * - SDK已对每种语言进行了长时间的弃用,不应用于任何东西。这包括NPM中的节点为 @paypal/paypal-rest-sdk。

结帐 - * - SDK在NPM中,NPM for Node as @paypal/Checkout-Server-SDK也已被弃用。

当前,所有developer.paypal.com文档仅使用客户端ID和秘密进行直接HTTPS REST API集成进行引用,以首先获得access_token。特别是对于节点,在是一个有用的起点,尽管我建议客户端onapprove函数此批准流由于该示例包括客户端错误处理捕获响应(重新启动或显示错误)(适用


于Webhooks),因此它们是单独的。他们没有当前的SDK。服务器端捕获API响应已经足以满足正常订单API付款paypal.com)您需要订阅 event> evest(s) want - 在 REST应用程序或使用Webhook API调用。

All PayPal-*-SDK for every language have been deprecated for a long time and should not be used for anything. This includes the one for node that's in npm as @paypal/paypal-rest-sdk.

The Checkout-*-SDK for every language, in npm for node as @paypal/checkout-server-sdk, has also been deprecated.

Currently all developer.paypal.com documentation only references doing direct HTTPS REST API integrations, using a client id and secret to first obtain an access_token. For node in particular, there is a full stack example in the PayPal Checkout integration guide that serves as a useful starting point, although I recommend the client side onApprove function in this approval flow since that sample includes client-side error handling of the capture response (restarting or showing an error as appropriate)


As for webhooks, they are a separate matter. There is no current SDK for them. The server-side capture API response is already sufficient for normal orders API payments so you may not need webhooks for what you're doing, but if there are specific events you're interested in listening for (such as refunds or disputes that occur on PayPal.com ) you'll need to subscribe to the event(s) you want -- either in the REST app or using webhook API calls.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文