https://github.com/iamkhs/sslcommerz-java
This project provides a complete Java-based Spring Boot implementation of the SSLCommerz Payment Gateway, built for developers in Bangladesh who want to integrate secure online payment capabilities into their Java applications.
https://github.com/iamkhs/sslcommerz-java
java spring-boot sslcommerz sslcommerz-java sslcommerz-payment sslcommerz-payment-gateway sslcommerz-payment-gateway-integration
Last synced: 3 months ago
JSON representation
This project provides a complete Java-based Spring Boot implementation of the SSLCommerz Payment Gateway, built for developers in Bangladesh who want to integrate secure online payment capabilities into their Java applications.
- Host: GitHub
- URL: https://github.com/iamkhs/sslcommerz-java
- Owner: iamkhs
- Created: 2025-07-12T10:03:21.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2025-07-12T10:05:20.000Z (3 months ago)
- Last Synced: 2025-07-12T12:09:50.191Z (3 months ago)
- Topics: java, spring-boot, sslcommerz, sslcommerz-java, sslcommerz-payment, sslcommerz-payment-gateway, sslcommerz-payment-gateway-integration
- Language: Java
- Homepage:
- Size: 47.9 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ณ SSLCommerz Java (Spring Boot) Payment Gateway Integration
This project provides a **complete Java-based Spring Boot implementation** of the [SSLCommerz Payment Gateway](https://developer.sslcommerz.com/), built for developers in Bangladesh who want to integrate secure online payment capabilities into their Java applications.
It covers the **entire payment flow**, including:
- Initiating payments
- Redirecting to SSLCommerz-hosted payment UI
- Handling success, failure, and cancellation callbacks
- Validating payments using SSLCommerz's validation API---
## โ Key Features
- โ Java & Spring Boot 3+ based clean architecture
- โ Uses **RestClient** (modern HTTP client introduced in Spring 6)
- โ Decoupled service layer for future extensibility
- โ `application.properties` driven config
- โ Handles both card and mobile banking flows
- โ Currently uses **static test data**, but designed for easy extension to support **dynamic runtime data**---
## ๐ง APIs Available
| Endpoint | Method | Purpose |
|---------------------------|--------|-------------------------------------|
| `/api/payment/initiate` | POST | Initiates a payment session |
| `/api/payment/success` | POST | Handles SSLCommerz success callback |
| `/api/payment/fail` | POST | Handles failed payment |
| `/api/payment/cancel` | POST | Handles canceled transactions |---
## ๐งช initiatePayment() โ Static Test Data
Currently, the payment is initiated using **static values** like:
```java
data.add("total_amount", "100");
data.add("cus_name", "Test");
data.add("cus_email", "test@example.com");
data.add("product_name", "TestProd");