Integrate Nepali payment gateways (eSewa, Khalti, Fonepay, connectIPS, NPS OnePG, CyberSource via Nepali banks, NEPALPAY QR, Hamro Pay, GetPay, IME Pay) into any backend, web app or mobile app, with tested adapters for TypeScript, Python, Java, Kotlin, PHP and Go covering server-side signing and verification, exactly-once fulfilment, reconciliation, webhooks and go-live. Use whenever the user mentions any of these providers, NPR or Nepal payments, a payment gateway in Nepal, eSewa ePay v2 or Intent, Khalti pidx, Fonepay DV or dynamic QR, connectIPS .pfx, NCHL QR, Hamro Pay, GetPay, CyberSource Secure Acceptance with a Nepali bank, HBL 2C2P, or is debugging a Nepali payment signature, callback or status check, even if they don't say "skill".
Ships in nepal-payments. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Production integrations for Nepali payment providers. Everything here was checked against official docs, official plugins/SDK sources, and live sandbox calls in 2026-11. Reference adapters ship in scripts/ with tests.
Copy this checklist into your notes and tick it off:
- [ ] 1. Providers picked (tree below)
- [ ] 2. Stack detected
- [ ] 3. Adapters copied; their bundled tests pass in the project
- [ ] 4. payment_attempts table + POST /payments, /start, return route (architecture.md, web.md / mobile.md)
- [ ] 5. Reconciliation job scheduled
- [ ] 6. Sandbox payment per provider verified end to end (testing.md)
- [ ] 7. Env vars documented; go-live list done (env.md, testing.md §5)
cybersource.md §1).package.json, pyproject.toml/requirements.txt, composer.json, pubspec.yaml, go.mod, …) and where server routes and DB models live.scripts/ts/src/ into the project's server code (e.g. src/server/payments/), keeping core/, index.ts and only the providers/<id>/ folders needed (drop the others from the registry in index.ts); scripts/ts/CONTRIBUTING.md explains the layout. The files import each other with .ts extensions (runs natively on Node ≥ 22.18, Bun, Deno). If the project's tsconfig lacks allowImportingTsExtensions, rewrite ./x.ts imports to match its module resolution (./x.js for NodeNext, extensionless for bundlers).scripts/python/nepal_payments/ as a package (stdlib only; add cryptography for connectIPS).scripts/java/src/main/java/np/payments/ (JDK 17+, no dependencies; blocking API, fine on virtual threads).scripts/kotlin/src/main/kotlin/np/payments/ (kotlin-stdlib only; suspend API). Server-side only: never put it in an Android app.scripts/php/src/ (namespace NepalPayments, PHP 8.1+, ext-curl + ext-openssl, no Composer dependencies) and register it in the project's PSR-4 autoload.scripts/go/payments/ into the module (e.g. internal/payments/) and fix the import path (stdlib only, Go 1.22+; context.Context on every network call; convert a connectIPS .pfx to PEM with openssl).references/<provider>.md) and port until they pass.payment_attempts table and the return handler from references/architecture.md, wired to the framework via references/web.md. For mobile, follow references/mobile.md.architecture.md §6). Without it, customers who close the tab after paying never get their order.references/testing.md. Use the sandbox credentials listed there.references/env.md, references/testing.md §5..pfx files or API passwords in web bundles or APKs/IPAs. Clients send only orderId + provider.providerRef (Khalti pidx, NPS ProcessId, IME TokenId, NEPALPAY validationTraceId) from your DB, never from callback params. Compare the provider's amount with yours.[A-Za-z0-9] (newOrderId() / new_order_id()). connectIPS caps TXNID at 20 and Fonepay caps PRN at 25, so UUIDs break both.UPDATE … WHERE status IN ('initiated','pending','unknown'), and idempotent fulfilment.decideTransition() (decide_transition()) for state changes. It encodes the rules: not_found inside the session window (~60 min) writes nothing (anyone can hit a return URL early); a provider "paid" after you closed the attempt is a late payment to recover, not ignore; a "paid" whose amount differs or is missing goes to manual review, never fulfilment.NOT_FOUND, which looks like a lost payment.| Provider | Use for | Auth / signature | Amount sent as | Verify (authoritative) | Reference |
|---|---|---|---|---|---|
| eSewa ePay v2 | wallet; web + WebView | HMAC-SHA256 base64 of total_amount,transaction_uuid,product_code | rupees "110.50" | GET …/api/epay/transaction/status/ | references/esewa.md |
| eSewa Intent | native app-to-app | HMAC-SHA256 base64, access key | rupees (number) | POST …/intent/payment/status | references/esewa.md §6 |
| Khalti KPG-2 | wallet; web + SDKs | Authorization: Key <secret> | paisa int, min 1000 | POST /api/v2/epayment/lookup/ (400 for expired/canceled) | references/khalti.md |
| Fonepay | banks via QR; web redirect, Dynamic QR | HMAC-SHA512 hex (DV) | rupees | txnVerification (Basic + auth HMAC) | references/fonepay.md |
| connectIPS | direct bank debit | RSA-SHA256 (creditor .pfx) | paisa | validatetxn (Basic) | references/connectips.md |
| CyberSource SA | cards via Nepali banks | HMAC-SHA256 base64 (signed fields) | "1500.00" | signed response POST (+ Merchant POST URL) | references/cybersource.md |
| NPS OnePG | ~29 banks + wallets + cards in one | Basic + HMAC-SHA512 hex of sorted values | rupees | CheckTransactionStatus | references/nps.md |
| IME Pay | legacy wallet (merged into Khalti 2025) | Basic + Module header | rupees "100.00" | Recheck | references/imepay.md |
| Hamro Pay | wallet; web + WebView | Client-Id/Client-API-Key + HMAC-SHA512 base64 Signature | paisa string out, rupees back | POST /v1/checkout/transaction | references/hamropay.md |
| GetPay | cards via NCHL for banks (NMB, Global IME, ...) | browser SDK; return token oprSecret = base64 SHA-256(oprKey+id) | rupees (number) | merchant-status + clientId check | references/getpay.md |
| NEPALPAY QR | NCHL dynamic QR, any NEPALPAY bank app | Basic (or OAuth) + RSA-SHA256 token (.pfx) | rupees "10.50" | merchanttxnreport by validationTraceId | references/nepalpay.md |
| HBL (2C2P PACO), Moru, Prabhu Pay, CellPay | niche / direct acquiring | JOSE / various | — | — | references/others.md |
TypeScript is shown. The other ports keep the same shape: Python create_payments(config_from_env()), new_order_id(), decide_transition(); Go payments.New(payments.ConfigFromEnv()), NewOrderID(), DecideTransition(); Java Payments.create(Payments.configFromEnv()); Kotlin Payments.create(paymentsConfigFromEnv()); PHP Payments::create(Payments::configFromEnv()), Payments::newOrderId().
import { createPayments, paymentsConfigFromEnv, newOrderId, renderAutoSubmitForm } from "./payments/index.ts";
const payments = createPayments(paymentsConfigFromEnv());
const attemptId = newOrderId();
const init = await payments.get("esewa").initiate({
orderId: attemptId, amountPaisa: order.totalPaisa, description: order.title,
returnUrl: `${APP_URL}/payments/esewa/return/${attemptId}`,
});
// init.kind === "redirect" → 302 to init.url (Khalti, Fonepay, IME Pay)
// init.kind === "form" → renderAutoSubmitForm(init) (eSewa, connectIPS, CyberSource, NPS, Hamro Pay)
// init.kind === "qr" → show init.qrImage / init.qrString, poll verify() (NEPALPAY QR)
// init.kind === "sdk" → getpay.checkoutPage(init, paymentPageUrl); success/fail URLs serve getpay.returnPage(verifyUrl) (GetPay)
// persist init.providerRef when present (Khalti pidx, NPS ProcessId, IME TokenId, NEPALPAY validationTraceId, Hamro Pay sessionId)
const result = await payments.adapter(provider).verify({
orderId: attempt.id, amountPaisa: attempt.amountPaisa, providerRef: attempt.providerRef, callback: params,
});
// result.status: paid | pending | failed | canceled | expired | refunded | partially_refunded | not_found | unknown
// result.amountPaisa (provider's figure), result.transactionId (store for support/refunds)
State machine: decideTransition(prevStatus, result, storedAmountPaisa, attemptAgeMs) → { next, reviewRequired, latePaid, reason }; apply next with an UPDATE guarded by prevStatus (architecture.md §4).
Provider extras: esewa.intentBook/intentVerify/intentCancel, khalti.refund, fonepay.qrCreate/qrStatus, connectips.getTxnDetail, nepalpay.report/confirmationResponse/verifyConfirmation/webSocketRequest, hamropay.verifyWebhook, getpay.status/statement/checkoutPage/paymentPage/returnPage, nps.getInstruments/getServiceCharge/notificationResponse. Errors throw PaymentError with provider, code, httpStatus, details.
esewa.md); uat.esewa.com.np is dead (use rc.esewa.com.np); eSewa's legacy mobile SDKs are deprecated in favour of Intent; signing 110 but posting 110.0 → ES104.a.khalti.com was superseded by dev.khalti.com.DT is MM/DD/YYYY in Nepal time; txnVerification's auth HMAC covers the exact JSON bytes.TXNDATE is DD-MM-YYYY; amounts are paisa; referenceId in validatetxn is your TXNID; redirect URLs must be registered with NCHL.multipart/form-data; a failed payment comes back with code:"0", so read data.Status.validationTraceId and poll the report; one QR can show a failed row and then a paid row; transactionAmount needs two decimals ("10.50").Connection: close (the API kills keep-alive sockets); amounts go out in paisa and come back in rupees; the live gateway host comes from Hamro Pay.merchant-status answers for any transaction id, so check the token's oprSecret and that clientId is your order; the token can arrive in the URL #hash, so the return URL must be a browser page..env.example.scripts/ts/: adapters (src/), offline tests (npm test), live sandbox check (node test/sandbox.ts), runnable demo with every provider wired (node examples/server.ts).scripts/python/: adapters (nepal_payments/) + tests (python -m unittest discover -s tests).scripts/java/, scripts/kotlin/: ./gradlew test, live check ./gradlew sandbox.scripts/php/ (PHP 8.1–8.5): composer install && vendor/bin/phpunit, live check php tests/sandbox.php.scripts/go/: go test -race ./..., live check go run ./cmd/sandbox.LICENSE.txt (opens in a new tab)evals/trigger-evals.json (opens in a new tab)references/architecture.md (opens in a new tab)references/connectips.md (opens in a new tab)references/cybersource.md (opens in a new tab)references/env.md (opens in a new tab)references/esewa.md (opens in a new tab)references/fonepay.md (opens in a new tab)references/getpay.md (opens in a new tab)references/hamropay.md (opens in a new tab)references/imepay.md (opens in a new tab)references/khalti.md (opens in a new tab)references/mobile.md (opens in a new tab)references/nepalpay.md (opens in a new tab)references/nps.md (opens in a new tab)references/others.md (opens in a new tab)references/testing.md (opens in a new tab)references/web.md (opens in a new tab)scripts/go/cmd/sandbox/main.go (opens in a new tab)scripts/go/go.mod (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
/nepal-payments:nepal-paymentsfrom nepal-payments
npx claudepluginhub broisnees/nepal-payments-skill --plugin nepal-payments