Official shurjoPay Spring 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 spring application.
Also it makes easy for developers to integrate with shurjoPay v2.1
with calling three methods only:
- makePayment: create and send payment request
- verifyPayment: verify payment status at shurjoPay
- paymentStatus: Check payment details and status
Also reduces many of the things that you had to do manually:
- Handles http request and errors.
- JSON serialization and deserialization.
- Authentication during initiating and verifying of payments.
This document is intended for the technical personnel of merchants and service providers who wants to integrate our online payment gateway using spring plugin provided by shurjoMukhi Limited.
To integrate the shurjoPay Payment Gateway in your spring project do the following tasks sequentially.
Maven
<dependency>
<groupId>bd.com.shurjomukhi</groupId>
<artifactId>sp-plugin-spring</artifactId>
<version>0.1.0</version>
</dependency>
Gradle
implementation 'bd.com.shurjomukhi:sp-plugin-spring:0.1.0'
Attention: shurjoMukhi offers separate plugin to integrate with any Java Application.
Step 2: Add below properties to project yml/properties file (e.g. application.yml, application.properties).
Properties contains four fields username, password, shurjopay-api, sp-callback
to configure shurjoPay. Configure logging using these params path
and name.
shurjopay:
username: <merchant_username>
password: <merchant_password>
shurjopay-api: https://sandbox.shurjopayment.com/api
sp-callback: https://sandbox.shurjopayment.com/response
logging:
file:
path: /var/log
name: sp-plugin-spring.log
- See and copy this ready YML or properties.
- Add
logback-classic
dependency in your application to get log messages generated by this plugin to track shurjoPay errors only (optional).
// Initialize shurjopay
private @Autowired Shurjopay 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);
- Call verify method
shurjopay.verifyPayment(:=spTxnId)
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.
- Spring example application showing usage of the spring plugin.
- Sample applications and projects in many different languages and frameworks showing shurjopay integration.
- shurjoPay Postman site illustrating the request and response flow using the sandbox system.
- shurjopay Plugins home page on github
This code is under the MIT open source License.
Please contact with shurjoPay team for more detail!
Copyright ©️2022 Shurjomukhi Limited.