This repository contains Java SDK and samples for REST API. For PayPal mobile(Android) SDK, please go to PayPal Android SDK
The Payment Card Industry (PCI) Council has mandated that early versions of TLS be retired from service. All organizations that handle credit card information are required to comply with this standard. As part of this obligation, PayPal is updating its services to require TLS 1.2 for all HTTPS connections. At this time, PayPal will also require HTTP/1.1 for all connections. Click here for more information
- Java JDK 6 or higher
- An environment which supports TLS 1.2 (see the TLS-update site for more information)
<dependency>
<groupId>com.paypal.sdk</groupId>
<artifactId>rest-api-sdk</artifactId>
<version>LATEST</version>
</dependency>
repositories {
mavenCentral()
}
dependencies {
compile 'com.paypal.sdk:rest-api-sdk:*'
}
- You can view more options to include PayPal-Java-SDK in your project at Maven Repository Viewer
-
Fetch the clientId and secret from PayPal Developer Dashboard
// Replace these values with your clientId and secret. You can use these to get started right now. String clientId = "AYSq3RDGsmBLJE-otTkBtM-jBRd1TCQwFf9RGfwddNXWz0uFU9ztymylOhRS"; String clientSecret = "EGnHDxD_qRPdaLdZz8iCr8N7_MzF-YHPTkjs6NKYQvQSBngp4PTTVWkPZRbL";
-
Create an
ApiContext
APIContext context = new APIContext(clientId, clientSecret, "sandbox");
-
Fetch a Payment by ID
Payment payment = Payment.get(context, "PAY-4T698276NC427425EK5QIV7Y"); System.out.println(payment);
-
Visit Developer Docs for more PayPal REST APIs.
-
To learn more about Java SDK please follow the wiki pages.
-
Future Payments sample is available here for executing future payments for a customer who has granted consent on a mobile device.
-
For Invoicing, check out the samples to see how you can use the java sdk to create, send and manage invoices.
Please refer to rest-api-sample project for running samples.
Code released under SDK LICENSE
Pull requests and new issues are welcome. See CONTRIBUTING.md for details.