PayPal SOAP and NVP
Asked Answered
W

4

33

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???

Wendiewendin answered 5/10, 2009 at 4:26 Comment(0)
R
44

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.

Redwine answered 12/4, 2010 at 8:14 Comment(4)
It seems old question and answer, now there is PayPal REST API, How is about REST API than NVP or SOAP?Bloodstain
@Alex I suspect the new REST API is better than the NVP and SOAP APIs, but I've not worked with it so I can't answer that. If you're working with it, consider adding an answer with your experiences with it.Redwine
PayPal says REST API is better and in the future REST API will be used more, some functions of NVP and SOAP are already deprecated. But from my small experience of PayPal, I feel REST API has lost some functions. I am not sure it is whether lost of REST API or lost of PayPal itself. Anyway I feel it is not perfect.Bloodstain
PayPal describes the NVP API (paypal.com/IntegrationCenter/ic_nvp.html) URL is not at all accessible.Joey
W
4

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.

Wendiewendin answered 13/4, 2010 at 5:6 Comment(3)
Eh. I've been programming for 10 years, and I've never been comfortable with SOAP. It's just too enterprisey. "Object oriented" does not always mean "better".Mayst
I don't understand your wording for "1. The change of error is much more the the NVP, as it's object oriented." I think you are saying that NVP is object-oriented, if that is what you are saying then it is not true. NVP is the "REST protocol" which mimics sending an HTML form post/get to a server. The code that does so does not have to be object-oriented, it can be any script that simulates an HTML form submit, object-oriented or not.Enoch
If you use the paypal SDK, then NVP is object oriented, but you do not have to use the SDK. I would call SOAP more object oriented than NVP.Belinda
N
1

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 !!!

Nimocks answered 4/11, 2011 at 23:10 Comment(0)
E
-2

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.

Enoch answered 15/10, 2012 at 17:28 Comment(1)
NVP and REST are two different things.Lotze

© 2022 - 2024 — McMap. All rights reserved.