Giter Club home page Giter Club logo

sp-plugin-java's Introduction

image Java plugin

Official shurjoPay Java plugin for merchants or service providers to connect with shurjoPay Payment Gateway v2.1 developed and maintained by ShurjoMukhi Limited.

This plugin can be used with any java application or framework (e.g. Spring). Also it makes easy for developers to integrate with shurjoPay v2.1 with calling three methods only:

  1. makePayment: create and send payment request
  2. verifyPayment: verify payment status at shurjoPay
  3. paymentStatus: Check payment details and status

Also reduces many of the things that you had to do manually:

  • Handles http requests and errors.
  • JSON serialization and deserialization.
  • Authentication during initiating and verifying of payments.

Audience

This document is intended for the technical personnel of merchants and service providers who wants to integrate our online payment gateway using java plugin provided by shurjoMukhi Limited.

How to use this shurjoPay plugin

To integrate the shurjoPay Payment Gateway in your Java project do the following tasks sequentially.

Step 1: Add dependency into your java or spring project

Maven

<dependency>
    <groupId>bd.com.shurjomukhi</groupId>
    <artifactId>sp-plugin-java</artifactId>
    <version>0.1.0</version>
</dependency>

Gradle

implementation 'bd.com.shurjomukhi:sp-plugin-java:0.1.0'

Download Jar
Go to Maven central and download the latest version.

Attention: shurjoMukhi offers separate plugin to integrate with any Spring Application.

Step 2: Create shurjopay.properties inside project resource path.

Properties file contains four fields SP_USER, SP_PASS, SHURJOPAY_API, SP_CALLBACK to configure shurjoPay. Configure logging using these params SPLOG_PATH, SPLOG_FILE.

#merchant username and password provided by shurjoPay author
SP_USER = <merchant_username>
SP_PASS = <merchant_password>

#shurjoPay API's base path for sandbox
SHURJOPAY_API = https://sandbox.shurjopayment.com/api

#callback URL is used for cancel payment or success payment
SP_CALLBACK = https://sandbox.shurjopayment.com/response

#shurjoPay plug-in log file location
SPLOG_PATH= /var/log
SPLOG_FILE = sp-java-plugin.log
  • See and copy this ready shurjopay.properties.
  • Add logback-classic dependency in your application to get log messages generated by this plugin to track shurjoPay errors only (optional).

Step 3: After that, you can initiate payment request to shurjoPay using below code example.

   // Initialize shurjopay
   Shurjopay shurjopay = new Shurjopay();

   // Prepare payment request to initiate payment
   PaymentReq request = new PaymentReq();
   request.setPrefix("sp");
   request.setAmount(10.00);
   request.setCustomerOrderId("sp315689");
   request.setCurrency("BDT");
   request.setCustomerName("Dummy");
   request.setCustomerAddress("Dhaka");
   request.setCustomerPhone("01766666666");
   request.setCustomerCity("Dhaka");
   request.setCustomerPostCode("1212");
   request.setCustomerEmail("[email protected]");

   // Calls first method to initiate a payment
   shurjopay.makePayment(request);

Step 4: Payment verification can be done after each transaction with shurjopay transaction id.

   shurjopay.verifyPayment(:=spTxnId)

Congrats! Now you are ready to use the java plugin to seamlessly integrate with shurjoPay to make your payment system easy and smooth.

Want to see shurjoPay in action?

Run the JUnit test to see shurjopay plugin in action. These tests will run on selenium browser and will provide the complete experience. Just download source and run the command mvnw.cmd test in Windows and ./mvnw test in Linux from plugin root path.

References

  1. Spring example application and Java example application showing usage of the java plugin.
  2. Sample applications and projects in many different languages and frameworks showing shurjopay integration.
  3. shurjoPay Postman site illustrating the request and response flow using the sandbox system.
  4. shurjopay Plugins home page on github

License

This code is under the MIT open source License.

Please contact with shurjoPay team for more detail!


Copyright Šī¸2022 shurjoMukhi Limited.

sp-plugin-java's People

Contributors

a2alim avatar bm-alamin avatar imtiaz-rahi avatar kibria10 avatar smukhidev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sp-plugin-java's Issues

Code duplication

code duplication found in ShurjoPlugin class.
Found few others issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤ī¸ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.