nepal-payments-skill

An Agent Skill that integrates Nepali payment gateways into any backend, web app or mobile app: eSewa, Khalti, Fonepay, connectIPS, CyberSource (via Nepali banks), NPS OnePG, IME Pay, NEPALPAY QR, Hamro Pay and GetPay.
Ask your coding agent to "add eSewa and Khalti checkout to this app" and it follows a tested recipe instead of guessing: server-side signing, server-to-server verification, exactly-once fulfilment and reconciliation. The skill ships working adapters in TypeScript, Python, Java, Kotlin, PHP and Go, each tested against the providers' own signature test vectors.
Install
Claude Code (plugin marketplace):
/plugin marketplace add broisnees/nepal-payments-skill
/plugin install nepal-payments@nepal-payments-skill
Any agent that supports Agent Skills (Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot and others) via the skills CLI:
npx skills add broisnees/nepal-payments-skill # this project
npx skills add broisnees/nepal-payments-skill -g # all projects
Manual: copy skills/nepal-payments/ into your agent's skills folder, for example:
git clone https://github.com/broisnees/nepal-payments-skill
cp -r nepal-payments-skill/skills/nepal-payments ~/.claude/skills/
Use it
Talk to your agent normally. The skill loads when you mention a provider or Nepali payments:
- "Add eSewa and Khalti payments to my Hono API on Cloudflare Workers with D1."
- "Integrate Fonepay dynamic QR for our restaurant POS."
- "Our eSewa callback says ES104 invalid signature. Fix it."
- "Add Khalti checkout to the Flutter app; the backend is FastAPI."
- "Set up connectIPS with our .pfx and a reconciliation job."
Providers
| Provider | Flows | Adapter | Live-tested |
|---|
| eSewa | ePay v2 (web), Intent (app-to-app) | all 6 | Sandbox: form, status API, Intent book/status/cancel |
| Khalti | KPG-2 checkout, refunds | all 6 | With your test key (KHALTI_SECRET_KEY) |
| Fonepay | Web redirect, Dynamic QR + WebSocket | all 6 | Dev gateway: signed redirect accepted, bad signature rejected |
| connectIPS | Direct bank debit (RSA .pfx) | all 6 | Signing verified with OpenSSL; needs NCHL credentials |
| CyberSource | Secure Acceptance (cards via Nepali banks) | all 6 | Published signature vector; needs a bank-issued profile |
| NPS OnePG | ~29 banks, wallets, cards in one | all 6 | Offline; needs NPS credentials |
| IME Pay | Wallet (merged into Khalti, 2025) | all 6 | Offline; needs IME credentials |
| Hamro Pay | Wallet checkout (Hamro Patro) | all 6 | UAT host answers; self-serve UAT merchant |
| GetPay | Cards via NCHL for banks (NMB, Global IME, ...) | all 6 | UAT status APIs called live; checkout needs bank credentials |
| NEPALPAY QR | NCHL dynamic QR (any NEPALPAY QR bank app) | all 6 | Offline; UAT host answers, needs NCHL credentials |
| HBL 2C2P, Moru, Prabhu Pay, CellPay, Namaste Pay | | Docs only | |
What's inside
skills/nepal-payments/
├── SKILL.md workflow, non-negotiable rules, provider table, traps
├── references/ one file per provider + architecture, web, mobile, env, testing
└── scripts/
├── ts/ Node 22.18+, Bun, Deno, Workers, Next.js edge · 49 tests + demo server
├── python/ Python 3.10+, stdlib · 33 tests
├── java/ JDK 17+, no dependencies (Spring Boot, Quarkus) · 111 tests
├── kotlin/ JDK 17+, suspend API (Ktor, Spring) · 84 tests
├── php/ PHP 8.1+, ext-curl/openssl (Laravel, Symfony) · 69 tests
└── go/ Go 1.22+, stdlib · 68 tests
Every suite runs the same signature vectors and mocked-provider cases, and each has a live eSewa + Fonepay sandbox check.
The adapters work without any agent too. Copy the folder for your language into your server code:
import { createPayments, paymentsConfigFromEnv, newOrderId } from "./payments/index.ts";
const payments = createPayments(paymentsConfigFromEnv());
const init = await payments.get("khalti").initiate({
orderId: newOrderId(), amountPaisa: 150000, description: "Order #42",
returnUrl: "https://shop.example.com/payments/khalti/return",
});
// later, in the return handler: verify server-to-server with values from your DB
const result = await payments.get("khalti").verify({
orderId: attempt.id, amountPaisa: attempt.amountPaisa, providerRef: attempt.providerRef,
});
Guarantees the skill enforces