Skip to content

Languages

All six adapters implement the same providers and the same interface. Every suite runs the providers’ signature test vectors and the same mocked-provider cases, 414 tests in total, and each language has a live eSewa and Fonepay sandbox check.

LanguageRuntimeDependenciesTestsSource
TypeScriptNode 22.18+, Bun, Deno, Workers, Next.js edgeZero dependencies49scripts/ts/src/
PythonPython 3.10+Stdlib (cryptography for connectIPS)33scripts/python/nepal_payments/
JavaJDK 17+ (Spring Boot, Quarkus)No dependencies111scripts/java/src/main/java/np/payments/
KotlinJDK 17+ (Ktor, Spring), suspend APIkotlin-stdlib only84scripts/kotlin/src/main/kotlin/np/payments/
PHPPHP 8.1+ (Laravel, Symfony)ext-curl and ext-openssl, no Composer deps69scripts/php/src/
GoGo 1.22+Stdlib only68scripts/go/payments/

From skills/nepal-payments/scripts:

Terminal window
(cd ts && npm ci && npm test && npm run typecheck)
(cd python && python -m unittest discover -s tests) # connectIPS tests need `pip install cryptography`
(cd java && ./gradlew test)
(cd kotlin && ./gradlew test)
(cd php && composer install && vendor/bin/phpunit)
(cd go && go test -race ./...)

No local PHP? Run each PHP command in Docker: docker run --rm -v "$PWD":/app -w /app composer:2 <command>.

Terminal window
node test/sandbox.ts # TypeScript (add KHALTI_SECRET_KEY=... for Khalti)
./gradlew sandbox # Java, Kotlin
php tests/sandbox.php # PHP
go run ./cmd/sandbox # Go

TypeScript also has an end-to-end demo against the eSewa and Fonepay sandboxes: cd ts && node examples/server.ts, then open http://localhost:3000.

For C#, Ruby, Rust or a Dart server, port from the TypeScript adapter of each provider. Write the provider’s test vectors as tests first (each provider page has them), port until they pass, then run the sandbox checks in Testing and go-live.