{"id":20850979,"url":"https://github.com/shurjopay-plugins/sp-plugin-java","last_synced_at":"2025-05-12T04:32:00.407Z","repository":{"id":37883449,"uuid":"464344892","full_name":"shurjopay-plugins/sp-plugin-java","owner":"shurjopay-plugins","description":"shurjoPay plugin module for Java application","archived":false,"fork":false,"pushed_at":"2023-07-05T14:13:05.000Z","size":39864,"stargazers_count":21,"open_issues_count":0,"forks_count":8,"subscribers_count":0,"default_branch":"main","last_synced_at":"2023-07-05T15:43:24.688Z","etag":null,"topics":["java","payment-gateway","payments","shurjomukhi","shurjopay","spring","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shurjopay-plugins.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-28T05:03:15.000Z","updated_at":"2023-07-05T15:43:24.688Z","dependencies_parsed_at":"2023-02-19T04:46:05.189Z","dependency_job_id":null,"html_url":"https://github.com/shurjopay-plugins/sp-plugin-java","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shurjopay-plugins%2Fsp-plugin-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shurjopay-plugins%2Fsp-plugin-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shurjopay-plugins%2Fsp-plugin-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shurjopay-plugins%2Fsp-plugin-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shurjopay-plugins","download_url":"https://codeload.github.com/shurjopay-plugins/sp-plugin-java/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225119997,"owners_count":17423818,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","payment-gateway","payments","shurjomukhi","shurjopay","spring","spring-boot"],"created_at":"2024-11-18T03:12:02.616Z","updated_at":"2024-11-18T03:12:03.141Z","avatar_url":"https://github.com/shurjopay-plugins.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# ![image](https://user-images.githubusercontent.com/57352037/155895117-523cfb9e-d895-47bf-a962-2bcdda49ad66.png) Java plugin\n\nOfficial shurjoPay Java plugin for merchants or service providers to connect with [**_shurjoPay_**](https://shurjopay.com.bd) Payment Gateway ``` v2.1 ``` developed and maintained by [_**ShurjoMukhi Limited**_](https://shurjomukhi.com.bd).\n\nThis plugin can be used with any java application or framework (e.g. Spring).\nAlso it makes easy for developers to integrate with shurjoPay ``` v2.1 ``` with calling three methods only:\n\n1. **makePayment**: create and send payment request\n1. **verifyPayment**: verify payment status at shurjoPay\n1. **paymentStatus**: Check payment details and status\n\nAlso reduces many of the things that you had to do manually:\n\n- Handles http requests and errors.\n- JSON serialization and deserialization.\n- Authentication during initiating and verifying of payments.\n## Audience\nThis 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**_.\n# How to use this shurjoPay plugin\nTo integrate the shurjoPay Payment Gateway in your Java project do the following tasks sequentially.\n#### Step 1: Add dependency into your java or spring project\n**Maven**\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ebd.com.shurjomukhi\u003c/groupId\u003e\n    \u003cartifactId\u003esp-plugin-java\u003c/artifactId\u003e\n    \u003cversion\u003e0.1.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n**Gradle**\n```gradle\nimplementation 'bd.com.shurjomukhi:sp-plugin-java:0.1.0'\n```\n**Download Jar**\u003cbr\u003e\nGo to [Maven central](https://central.sonatype.dev/artifact/bd.com.shurjomukhi/sp-plugin-java/0.1.0/overview) and download the latest version.\u003cbr\u003e\n\n\u003e _Attention:_ shurjoMukhi offers [separate plugin](https://github.com/shurjopay-plugins/sp-plugin-spring) to integrate with any _Spring Application_.\n\n#### Step 2: Create shurjopay.properties inside project resource path.\nProperties file contains four fields ```SP_USER, SP_PASS, SHURJOPAY_API, SP_CALLBACK``` to configure shurjoPay. Configure logging using these params ```  SPLOG_PATH, SPLOG_FILE. ```\n```properties\n#merchant username and password provided by shurjoPay author\nSP_USER = \u003cmerchant_username\u003e\nSP_PASS = \u003cmerchant_password\u003e\n\n#shurjoPay API's base path for sandbox\nSHURJOPAY_API = https://sandbox.shurjopayment.com/api\n\n#callback URL is used for cancel payment or success payment\nSP_CALLBACK = https://sandbox.shurjopayment.com/response\n\n#shurjoPay plug-in log file location\nSPLOG_PATH= /var/log\nSPLOG_FILE = sp-java-plugin.log\n```\n- See and copy this ready [_shurjopay.properties_](https://github.com/shurjopay-plugins/sp-plugin-java/blob/main/src/test/resources/shurjopay.properties.sample).\n- Add ```logback-classic``` dependency in your application to get log messages generated by this plugin to track shurjoPay errors only (optional).\n\n#### Step 3: After that, you can initiate payment request to shurjoPay using below code example.\n ```java \n\t// Initialize shurjopay\n\tShurjopay shurjopay = new Shurjopay();\n\n\t// Prepare payment request to initiate payment\n\tPaymentReq request = new PaymentReq();\n\trequest.setPrefix(\"sp\");\n\trequest.setAmount(10.00);\n\trequest.setCustomerOrderId(\"sp315689\");\n\trequest.setCurrency(\"BDT\");\n\trequest.setCustomerName(\"Dummy\");\n\trequest.setCustomerAddress(\"Dhaka\");\n\trequest.setCustomerPhone(\"01766666666\");\n\trequest.setCustomerCity(\"Dhaka\");\n\trequest.setCustomerPostCode(\"1212\");\n\trequest.setCustomerEmail(\"dummy@gmail.com\");\n\n\t// Calls first method to initiate a payment\n\tshurjopay.makePayment(request);\n ```\n- Returns [_PaymentRes_](https://github.com/shurjopay-plugins/sp-plugin-java/blob/main/src/main/java/com/shurjomukhi/model/PaymentRes.java) corresponding this [_JSON_](https://github.com/shurjopay-plugins/sp-plugin-java/blob/main/src/test/resources/sample-msg/payment-res.json)\n\n#### Step 4: Payment verification can be done after each transaction with shurjopay transaction id. \n ```java\n\tshurjopay.verifyPayment(:=spTxnId)\n ```\n- Returns [_VerifiedPayment_](https://github.com/shurjopay-plugins/sp-plugin-java/blob/main/src/main/java/com/shurjomukhi/model/VerifiedPayment.java) corresponding this [_JSON_](https://github.com/shurjopay-plugins/sp-plugin-java/blob/main/src/test/resources/sample-msg/verification-res.json)\n#### Congrats! Now you are ready to use the java plugin to seamlessly integrate with shurjoPay to make your payment system easy and smooth.\n\n# Want to see shurjoPay in action?\nRun 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.\n## References\n1. [Spring example application](https://github.com/shurjopay-plugins/sp-plugin-usage-examples/tree/dev/spring-app-java-plugin) and [Java example application](https://github.com/shurjopay-plugins/sp-plugin-usage-examples/tree/dev/java-app-java-plugin) showing usage of the java plugin.\n2. [Sample applications and projects](https://github.com/shurjopay-plugins/sp-plugin-usage-examples) in many different languages and frameworks showing shurjopay integration.\n3. [shurjoPay Postman site](https://documenter.getpostman.com/view/6335853/U16dS8ig) illustrating the request and response flow using the sandbox system.\n4. [shurjopay Plugins](https://github.com/shurjopay-plugins) home page on github\n## License\nThis code is under the [MIT open source License](https://github.com/shurjopay-plugins/sp-plugin-java/blob/develop/LICENSE).\n#### Please [contact](https://shurjopay.com.bd/#contacts) with shurjoPay team for more detail!\n\u003chr\u003e\nCopyright ©️2022 shurjoMukhi Limited.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshurjopay-plugins%2Fsp-plugin-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshurjopay-plugins%2Fsp-plugin-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshurjopay-plugins%2Fsp-plugin-java/lists"}