Skip to content

Vetther/java-payments-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

java-payments-api is a simple api that uses the payment gateways rest-api transforming them into simple methods that you can use.
Be sure to check how the payment gateways you use work

Repository (Maven or Gradle)

<repository>
  <id>eternalcode-repository-releases</id>
  <name>EternalCode Repository</name>
  <url>https://repo.eternalcode.pl/releases</url>
</repository>
maven { url "https://repo.eternalcode.pl/releases" }

Dependencies (Maven or Gradle)

<dependency>
  <groupId>dev.vetther</groupId>
  <artifactId>java-payments-api</artifactId>
  <version>1.0.8</version>
</dependency>
implementation "dev.vetther:java-payments-api:1.0.8"

Example Usage

Create payment (You need to create PayPal app, check this and this tutorial)
PaypalApi paypalApi = new PaypalApi("CLIENT_ID", "CLIENT_SECRET", false);

PaypalApiCreateOrder order = paypalApi.createOrder(
      2.00, // amount
      "USD", // currency
      "https://github.com/Vetther/java-payments-api", // redirect after payment
      "https://myapp.com/notify" // webhook, POST request after payment
);
Check payment status
PaypalApiOrderInfo orderInfo = paypalApi.getOrderInfo("ORDER_ID");

if (orderInfo.getOrder().isPaid()) {
      // payment was successfully authorized
}

About

💸 Useful API for payments

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages