Reputation: 31
We are re-developing our eCommerce application and goingto use PayPal as our main gateway. I am trying to figure out whether to use REST API or SDK. Is SDK easier to use than REST API? Which is better to use?
Upvotes: 1
Views: 2855
Reputation: 788
A good way to look at this is that the PayPal SDKs are built on top of the APIs (the root endpoints) in order to abstract out a lot of the complexities and keep integrations as up-to-date as possible.
If you are leveraging off of the API with your own code (and no SDK), you'll have to build out pieces for the auth (OAuth 2), in order to capture your access token, then build out calls for each endpoint that you wish to build against. Most of the time you'll see integrations like this if people want to highly customize their build against the API, or want to build in a language / integration not available in the SDKs.
The SDK will abstract out those complexities for you, so it'll definitely be the easier integration. In addition, the SDKs will be continually updated as the APIs change, so you won't have to update the code yourself to maintain that, just fetch the newest SDK version and test the integration.
If you're looking for the easiest integration, use the SDK. For Java, that's at https://github.com/paypal/PayPal-Java-SDK. There's also a number of quickstart samples at https://developer.paypal.com/docs/api/quickstart/ using the SDKs.
Upvotes: 1