Skip to content

tsw424/PayPal-Java-SDK

 
 

Repository files navigation

PayPal REST API Java SDK Build Status

Home Image

This repository contains Java SDK and samples for REST API. For PayPal mobile(Android) SDK, please go to PayPal Android SDK

Please Note

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

Prerequisites:

  • Java JDK 6 or higher
  • An environment which supports TLS 1.2 (see the TLS-update site for more information)

SDK Integration:

Maven

<dependency>
	<groupId>com.paypal.sdk</groupId>
	<artifactId>rest-api-sdk</artifactId>
	<version>LATEST</version>
</dependency>

Gradle

repositories {
	mavenCentral()
}
dependencies {
	compile 'com.paypal.sdk:rest-api-sdk:*'
}

Other

To make an API call:

  1. 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";
  2. Create an ApiContext

    APIContext context = new APIContext(clientId, clientSecret, "sandbox");
  3. Fetch a Payment by ID

    Payment payment = Payment.get(context, "PAY-4T698276NC427425EK5QIV7Y");
    System.out.println(payment);
  4. Visit Developer Docs for more PayPal REST APIs.

  5. 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.

Running Samples

Please refer to rest-api-sample project for running samples.

License

Code released under SDK LICENSE

Contributions

Pull requests and new issues are welcome. See CONTRIBUTING.md for details.

About

Java SDK for PayPal RESTful APIs

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 72.8%
  • HTML 26.8%
  • Ruby 0.4%