payabbhi-java

Payabbhi Java Library.

License

License

Categories

Categories

Java Languages
GroupId

GroupId

com.payabbhi
ArtifactId

ArtifactId

payabbhi-java
Last Version

Last Version

1.0.2
Release Date

Release Date

Type

Type

jar
Description

Description

payabbhi-java
Payabbhi Java Library.
Project URL

Project URL

https://github.com/payabbhi/payabbhi-java
Project Organization

Project Organization

Payabbhi
Source Code Management

Source Code Management

https://github.com/payabbhi/payabbhi-java.git

Download payabbhi-java

How to add to project

<!-- https://jarcasting.com/artifacts/com.payabbhi/payabbhi-java/ -->
<dependency>
    <groupId>com.payabbhi</groupId>
    <artifactId>payabbhi-java</artifactId>
    <version>1.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.payabbhi/payabbhi-java/
implementation 'com.payabbhi:payabbhi-java:1.0.2'
// https://jarcasting.com/artifacts/com.payabbhi/payabbhi-java/
implementation ("com.payabbhi:payabbhi-java:1.0.2")
'com.payabbhi:payabbhi-java:jar:1.0.2'
<dependency org="com.payabbhi" name="payabbhi-java" rev="1.0.2">
  <artifact name="payabbhi-java" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.payabbhi', module='payabbhi-java', version='1.0.2')
)
libraryDependencies += "com.payabbhi" % "payabbhi-java" % "1.0.2"
[com.payabbhi/payabbhi-java "1.0.2"]

Dependencies

runtime (3)

Group / Artifact Type Version
com.squareup.okhttp3 : okhttp jar 3.10.0
org.json : json jar 20180130
commons-codec : commons-codec jar 1.11

test (2)

Group / Artifact Type Version
junit : junit jar 4.12
org.mockito : mockito-core jar [2.0,)

Project Modules

There are no modules declared in this project.

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.2</version>
</dependency>

Gradle

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

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

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>);

Test

Comment the following lines of code in the file build.gradle as below

// id 'signing'
// signing {
//     sign configurations.archives
// }

Run the following command to build and execute unit tests

$ gradle build

A html report will be generated in file build/reports/tests/test/index.html

com.payabbhi

Payabbhi

Versions

Version
1.0.2
1.0.1
1.0.0