An open API service indexing awesome lists of open source software.

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.

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");