The first production-grade Java library for Nepal payment gateways. Integrate Khalti, eSewa, ConnectIPS, and Fonepay in minutes — security baked in.
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.sujankim.nepal-pay-spring-boot-starter</groupId>
<artifactId>nepal-pay-spring-boot-3-starter</artifactId>
<version>v0.4.1</version>
</dependency>
<dependency>
<groupId>com.github.sujankim.nepal-pay-spring-boot-starter</groupId>
<artifactId>nepal-pay-spring-boot-4-starter</artifactId>
<version>v0.4.1</version>
</dependency>
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.sujankim.nepal-pay-spring-boot-starter:nepal-pay-spring-boot-3-starter:v0.4.1'
}
dependencies {
implementation 'com.github.sujankim.nepal-pay-spring-boot-starter:nepal-pay-spring-boot-4-starter:v0.4.1'
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
dependencies {
implementation("com.github.sujankim.nepal-pay-spring-boot-starter:nepal-pay-spring-boot-3-starter:v0.4.1")
}
dependencies {
implementation("com.github.sujankim.nepal-pay-spring-boot-starter:nepal-pay-spring-boot-4-starter:v0.4.1")
}
The public API is identical in both starters. Only the internal Jackson version differs. · Full install guide →
Stop writing 500 lines of payment boilerplate every project.
Add dependency → configure keys → inject client. No @Bean, no config class, no boilerplate.
Server-side verification, HMAC signature validation, RSA signing — all built in. Sandbox mode by default.
Built for Java 17+ and Spring Boot. Type-safe records, auto-configuration, no Node.js bridge.
MockWebServer HTTP tests, HMAC/RSA signature tests, auto-configuration wiring tests. 80+ tests total.
Separate modules for Spring Boot 3.2+ and 4.x. Identical public API — switch without code changes.
MIT licensed. Built for Nepal's developer community. Contributions welcome.
All major Nepal digital payment gateways in one library.
API-first initiation and server-side lookup verification.
View docs →HMAC-SHA256 signed form payload with callback verification.
View docs →RSA-SHA256 signed form payload. Bank-to-bank via NCHL.
View docs →HMAC-SHA512 signed URL redirect. QR and bank transfer.
View docs →Three lines instead of 80.
// 80+ lines for Khalti initiation alone
HttpClient client = HttpClient.newHttpClient();
String json = """
{
"return_url": "%s",
"website_url": "%s",
"amount": %d,
"purchase_order_id": "%s",
"purchase_order_name": "%s"
}
""".formatted(returnUrl, url, amount, orderId, name);
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://dev.khalti.com/..."))
.header("Authorization", "Key " + secretKey)
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
// parse response manually...
// repeat for eSewa with HMAC-SHA256...
// repeat again for your next project
// 3 lines. Type-safe. Tested. Secure.
var response = khaltiClient.initiatePayment(
KhaltiInitiateRequest.builder()
.amount(10000L)
.purchaseOrderId("ORD-001")
.purchaseOrderName("Pro Plan")
.build()
);
// Redirect user to payment page
return response.paymentUrl();