Payabbhi Java Library http://payabbhi.com
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config/checkstyle
gradle/wrapper
src
.gitignore
CHANGELOG.md
LICENSE
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.md

Payabbhi Java Library

Make sure you have signed up for your Payabbhi Account and downloaded the API keys from the Portal.

Requirements

Java 1.7 or later.

Installation

Maven

Include this dependency in your Maven pom.xml:

<dependency>
  <groupId>com.payabbhi</groupId>
  <artifactId>payabbhi-java</artifactId>
  <version>1.0.1</version>
</dependency>

Gradle

Include this dependency in your Gradle build file build.gradle:

compile "com.payabbhi:payabbhi-java:1.0.1"

Manual Download

An alternative is to manually download the JAR for Payabbhi Java Library from Maven repository

Payabbhi Java library has the following dependencies which should be included separately:

Documentation

Please refer to:

Usage

A typical usage of the Payabbhi Java Library is shown below:

import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.payabbhi.Payabbhi;
import com.payabbhi.exception.PayabbhiException;
import com.payabbhi.model.Order;

public class Example {

	public static void main(String[] args) {

		Payabbhi.accessId  = "<your-access-id>";
		Payabbhi.secretKey = "<your-secret-key>";

		try {
			Map<String, Object> params = new HashMap<>();
			params.put("merchant_order_id", "0211");
			params.put("amount", 10000);
			params.put("currency", "INR");

			Order order = Order.create(params);

			System.out.println(order);

		} catch (PayabbhiException e) {
			e.printStackTrace();
		}
	}

}

For more examples see the Java API documentation

Payment Signature Verification

Payabbhi Java library provides utility function for verifying the payment signature received in the payment callback.

Map<String, String> params = new HashMap()
params.put("order_id", "<order-id>");
params.put("payment_id", "<payment-id>");
params.put("payment_signature", "<payment-signature>");
Payabbhi.verifyPaymentSignature(params)

Webhook Signature Verification

Payabbhi Java library provides utility function for webhook signature verification.

import com.payabbhi.Payabbhi;

// In this call default value of replayInterval is 300 seconds
Payabbhi.verifyWebhookSignature("<payload>", "<signature>", "<secret>");

Payabbhi.verifyWebhookSignature("<payload>", "<signature>", "<secret>", <replayInterval>);