Java

Learn how to integrate and use Java SDK with Pine Labs Plural APIs.

This document provides a step-by-step guide for integrating the Java SDK. It offers convenient methods for accepting and fetching orders, calculating EMIs, and verifying hashes.

Watch this video to learn how to integrate and use Java SDK with Pine Labs Plural APIs.

📘

Download the Sampleapp

You can download the Sampleapp from the GitHub Link: https://github.com/pluralonline/plural-java-sdk-sampleapp.

Prerequisites

Before integrating the SDK into your Project, make sure the following requirement is met:

  • JDK version 17 or higher (recommended).
  • Maven version 3 or higher (Recommended).

📘

Note:

TLS 1.2 information:

  • For Java 17 and above should have TLS version 1.2.

Installation

Follow the below steps for installing the SDK in your project:

  1. Extract the SDK (Zip File) in any desired location on your system. For example, extracted it into a folder named Sdk_PineLabs(Sdk Folder: java-sdk).
  1. Navigate to the path src/main/java/com/pine_lab/api inside the java-sdk folder. And in that you’ll be
    able to locate all the necessary classes, copy all the classes from this folder, except App.java (Testing Class), into your existing project’s repository or package.
  1. In your project, create a new package, such as pine_lab/api. Import all the SDK classes into this package. For instance, in a sample Spring Boot project (Java_Pine_Labs), you can create the package and inject the SDK classes into it.
  1. In your IDE, the project structure should show the SDK files in the package com/pine_lab/api, while your main classes are in other packages (e.g., com/pine_labs). Ensure this structure is reflected correctly.
  1. In your main controller class, import the required SDK classes. For example, in the sample Spring Boot project, you can include an import statement like:
import com.pine_lab.api.Api;

Follow a similar process for importing other classes as needed.

  1. Copy all the dependencies from the SDK’s pom.xml file and add them to your project’s pom.xml. Below reference image shows xml file of SDK.

Implementation

Handle Payments

To know the status of the payment you can use the below options.

  1. Inquiry API: Use this API to check transaction statuses.
  2. Webhook Notification: We send Webhook notifications on the successful payment or any changes to the payment's response object.