{"id":20850948,"url":"https://github.com/shurjopay-plugins/sp-plugin-spring","last_synced_at":"2025-05-12T04:31:52.086Z","repository":{"id":114786417,"uuid":"552851492","full_name":"shurjopay-plugins/sp-plugin-spring","owner":"shurjopay-plugins","description":"shurjoPay plugin module for Spring applications","archived":false,"fork":false,"pushed_at":"2024-01-23T12:39:15.000Z","size":13697,"stargazers_count":20,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-01T00:42:42.446Z","etag":null,"topics":["java","payment-gateway","payments","shurjomukhi","shurjopay","spring","spring-boot","spring-mvc"],"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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-17T10:25:43.000Z","updated_at":"2024-12-09T19:54:23.000Z","dependencies_parsed_at":"2024-11-18T08:57:06.366Z","dependency_job_id":null,"html_url":"https://github.com/shurjopay-plugins/sp-plugin-spring","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shurjopay-plugins%2Fsp-plugin-spring","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shurjopay-plugins%2Fsp-plugin-spring/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shurjopay-plugins%2Fsp-plugin-spring/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shurjopay-plugins%2Fsp-plugin-spring/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shurjopay-plugins","download_url":"https://codeload.github.com/shurjopay-plugins/sp-plugin-spring/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253675410,"owners_count":21945931,"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","spring-mvc"],"created_at":"2024-11-18T03:11:55.234Z","updated_at":"2025-05-12T04:31:52.077Z","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) Spring Plugin\n\nOfficial shurjoPay Spring 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 spring application.\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 request 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 spring plugin provided by _**shurjoMukhi Limited**_.\n## How to use this shurjoPay plugin\nTo integrate the shurjoPay Payment Gateway in your spring project do the following tasks sequentially.\n#### Step 1: Add dependency into your spring project\n**Maven**\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ebd.com.shurjomukhi\u003c/groupId\u003e\n  \u003cartifactId\u003esp-plugin-spring\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-spring:0.1.0'\n```\n\u003e _Attention:_ shurjoMukhi offers [separate plugin](https://github.com/shurjopay-plugins/sp-plugin-java) to integrate with any _Java Application_.\n\n#### Step 2: Add below properties to project yml/properties file (e.g. application.yml, application.properties).\nProperties contains four fields ```username, password, shurjopay-api, sp-callback``` to configure shurjoPay. Configure logging using these params ```path``` and ```name.```\n```yml\nshurjopay:\n  username: \u003cmerchant_username\u003e\n  password: \u003cmerchant_password\u003e\n  shurjopay-api: https://sandbox.shurjopayment.com/api\n  sp-callback: https://sandbox.shurjopayment.com/response\n  logging:\n    file:\n      path: /var/log\n      name: sp-plugin-spring.log\n```\n- See and copy this ready [_YML_](https://github.com/shurjopay-plugins/sp-plugin-spring/blob/main/src/test/resources/application-sample.yml) or [_properties_](https://github.com/shurjopay-plugins/sp-plugin-spring/blob/main/src/test/resources/application-sample.properties).\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\tprivate @Autowired Shurjopay 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 [_POJO_](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-spring/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- Call verify method\n ```java\n\tshurjopay.verifyPayment(:=spTxnId)\n ```\n- Returns [_POJO_](https://github.com/shurjopay-plugins/sp-plugin-java/blob/develop/src/main/java/com/shurjomukhi/model/VerifiedPayment.java) corresponding this [_JSON_](https://github.com/shurjopay-plugins/sp-plugin-spring/blob/develop/src/test/resources/sample-msg/verification-res.json)\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/main/spring-app-spring-plugin) showing usage of the spring 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-spring/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-spring","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshurjopay-plugins%2Fsp-plugin-spring","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshurjopay-plugins%2Fsp-plugin-spring/lists"}