贝宝 SOAP 和 NVP

发布于 2024-08-06 21:24:45 字数 82 浏览 6 评论 0原文

我是 PayPal 的新手,我想知道实施 PayPal、SOAP 或 NVP API 哪种方法更好。

这两者之间的主要区别是什么???

I am new to PayPal and i want to know which is batter way to implement PayPal, SOAP or NVP API.

And what is the major difference between these two???

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

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

发布评论

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

评论(4

ヅ她的身影、若隐若现 2024-08-13 21:24:45

我建议使用 NVP(名称-值对,基本上是带有数据的 POST)API 而不是 SOAP API。 NVP 的重量应该比 SOAP 轻得多。已有一些问题关于 投诉 SOAP。我只是想弄清楚该使用哪个,然后发现了这些。希望有帮助。

另外,PayPal 是如何描述 NVP API 的:

通过 PayPal 名称-值对 API (NVP API),您只需向 PayPal 发送 HTTP 请求并使用名称-值对指定请求参数,即可利用 PayPal API 的功能。 NVP API 是 PayPal SOAP API的轻量级替代品 a> 并提供对与 SOAP API 同一组功能的访问。


强调我自己的。

I would recommend using the NVP (Name-value pair, basically POST with data) API over the SOAP API. NVP should be significantly lighter weight than SOAP. There are a few questions already on SO that complain about SOAP. I just was trying to figure out which to use and came upon those. Hope that helps.

Also, here's how PayPal describes the NVP API:

The PayPal Name-Value Pair API (NVP API) enables you to leverage the functionality of the PayPal API by simply sending an HTTP request to PayPal and specifying request parameters using name-value pairs. The NVP API is a lightweight alternative to the PayPal SOAP API and provides access to the same set of functionality as the SOAP API.

Emphasis my own.

等你爱我 2024-08-13 21:24:45

最好使用 PayPal SOAP API(因为我已经完全实现了这个)。 donut 说 NVP 是轻量级的,这是正确的。但使用 SOAP 有两个主要优点:

  1. 出错的机会比 NVP 多得多,因为它是面向对象的。
  2. 如果您从事编程工作至少一年左右,那么您会对 SOAP 感到更加自在。

我建议使用 SOAP 而不是 NVP,但这也取决于使用情况。

It's better to use the PayPal SOAP API (as i have completely implemented this). donut is correct in saying that NVP is lightweight. But there are 2 main advantages of using SOAP:

  1. The chance of error is much more the the NVP, as it's object oriented.
  2. And if you are doing programming for at least about one year then you will feel more comfortable with SOAP.

I recommend SOAP over NVP, but it also depends upon usage.

睫毛溺水了 2024-08-13 21:24:45

我只是认为 SOAP 对于很多新程序员来说更好,他们会更适应它,因为它是面向对象的。但是当你没有自己创建对象时,很难找到并理解 API 中的逻辑!
NVP 是结构化的,因此您可以在脚本中创建自己的对象。这个版本的可扩展性越来越强!

I simply think that SOAP is better for a lot of new programmers, who will be more confortable with it cause it s object oriented. But it is quite difficult to find and understand a logic in APIs when you did not create the objects by yourself in it !
NVP is structural so you can create your own objects in your scripts. This version is by more and more extensible !!!

清风疏影 2024-08-13 21:24:45

NVP(名称值对)通常称为 REST(表述性状态传输)协议,您可以通过 HTTP 发送名称值对,其方式与 HTML 表单向服务器发送信息的方式类似。我更喜欢 NVP/REST,因为它遵循 KISS 原则(先生,保持简单),即简单的系统比更复杂的系统更容易构建,并且需要更少的时间和精力来维护。这就是为什么在大多数情况下我会推荐 REST (NVP) 而不是 SOAP。

然而,在您需要更高的安全性和/或与现有软件包或库集成的情况下,根据具体情况,SOAP 可能是合适的解决方案。

NVP (Name-Value-Pair) is commonly referred to as REST (REpresentational State Transfer) protocol where you send name value pairs over HTTP in a similar manner to how an HTML form sends information to a server. I prefer NVP/REST since it follows the KISS Principle (Keep It Simple Sir) which is the philosophy that simple systems are easier to build and require less time and effort to maintain than more complicated systems. This is why in most situations I would recommend REST (NVP) over SOAP.

However, in situations where you require more security and/or are integrating with an existing software package or library, SOAP might be an appropriate solution depending on the circumstance.

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