Working with PayPal APIs
PayPal provides the following types of APIs:
NAV: Name and Value pair based
SOAP: Web services API
NAV APIs are very useful for website integration with PayPal services. For back-office integration, SOAP APIs are useful. PayPal provides SDK to speed up the integration. In this recipe, we will look at the steps involved in using the Java SDK and we will use it to test an API to check the API call.
Getting ready
Make sure that the following is installed and set up:
Install JDK 1.6
Install Eclipse
How to do it...
1. Download SOAP SDK for Java from https://www.paypal.com/sdk. I have downloaded the Windows version of the SDK.
2. Extract the downloaded zipped file (to, say,
c:\paypal_java_sdk)
.3. Create a new Java project in Eclipse.
4. Create a
PayPalInterfaceImpl.java
class file and save the following code in it:import com.paypal.sdk.profiles.APIProfile; import com.paypal.sdk.profiles.ProfileFactory; import com.paypal.sdk.services.CallerServices; import com.paypal.soap...