Open-source Agent Skill · MIT

Nepali payments your coding agent gets right.

One skill teaches Claude Code, Codex, Cursor and other agents to integrate eSewa, Khalti, Fonepay, connectIPS, CyberSource, NPS and IME Pay. It ships tested adapters in six languages, so the agent copies working code instead of guessing at signatures.

$ npx skills add broisnees/nepal-payments-skill
claude

> Add eSewa and Khalti payments to my Hono API on Cloudflare Workers with D1.

Skill loaded: nepal-payments

  1. Pick providerseSewa ePay v2 + Khalti KPG-2
  2. Detect stackHono on Workers, D1
  3. Install adapterscore.ts, esewa.ts, khalti.ts
  4. Routes + attempts tablereturn handler, decideTransition
  5. Reconciliationscheduled status re-checks
  6. Testsignature vectors + sandbox checks
7providers with adapters
6languages
414tests, incl. provider vectors
0runtime dependencies

How it works

From one sentence to a verified integration.

01

Ask in plain words

Tell your agent what you need: providers, framework, database. The skill loads on its own when the task mentions Nepali payments.

02

It follows a tested recipe

The agent copies the adapter for your language, adds the attempts table, the return route and reconciliation, and keeps every secret on the server.

03

You ship with proof

Signature vectors and sandbox checks run in your repo, so the integration is tested before real money touches it.

Adapters

The same two calls in six languages.

Copy the folder for your language into your server. Start a payment with initiate, then confirm it server-to-server with verify using the amount you stored. Integer paisa everywhere.

  • TypeScript49 tests · Zero dependencies
  • Python33 tests · Stdlib (cryptography for connectIPS)
  • Java111 tests · No dependencies
  • Kotlin84 tests · kotlin-stdlib only
  • PHP69 tests · ext-curl and ext-openssl, no Composer deps
  • Go68 tests · Stdlib only
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 with values from YOUR database
const result = await payments.get("khalti").verify({
  orderId: attempt.id, amountPaisa: attempt.amountPaisa, providerRef: attempt.providerRef,
});

Guarantees

Rules the skill won't let your agent skip.

Secrets stay on the server

Signing keys never reach the browser or the app. Clients only ever send an order id.

A redirect is not a payment

Return URLs and callbacks are hints. The provider's status API decides whether money moved.

Your numbers, not theirs

Verification uses the amount and ids stored in your database, never the values in the callback.

One state machine

decideTransition handles early return hits, late payments, missing or mismatched amounts and duplicates.

Reconciliation built in

A scheduled job settles payments where the customer paid and closed the tab.

Vectors before code

Every adapter is tested against the provider's own signature test vectors in all six languages.

Install

Works with the agent you already use.

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot and any other agent that reads Agent Skills.

Install guide

Claude Code

/plugin marketplace add broisnees/nepal-payments-skill
/plugin install nepal-payments@nepal-payments-skill

Any agent

npx skills add broisnees/nepal-payments-skill

FAQ

Questions

What is an Agent Skill?

A folder of instructions, references and scripts that a coding agent loads when a task matches. This one teaches the agent how Nepali payment gateways actually behave, so it follows a tested recipe instead of guessing signatures and callback formats.

Which agents does it work with?

Any agent that supports the Agent Skills format: Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot and others. Claude Code can also install it from the plugin marketplace.

Can I use the adapters without an agent?

Yes. Copy the folder for your language into your server code. The adapters have no runtime dependencies beyond each language's standard library (connectIPS in Python also needs the cryptography package).

Which provider should I start with?

eSewa and Khalti cover the largest wallets. Add NPS or Fonepay to reach most banks through one integration, connectIPS for direct bank debit, and CyberSource only if a bank is acquiring cards for you.

Is it affiliated with eSewa, Khalti or the other providers?

No. It is an independent open-source project under the MIT license. The sandbox credentials it uses are the public ones from each provider's documentation.

Does it handle mobile apps?

Yes. The mobile guide covers Flutter, React Native, Expo, Android and iOS, including eSewa Intent app-to-app payments, with all signing kept on your server.

Take your first sandbox payment today.

eSewa and Fonepay sandboxes need no signup. The demo server runs both.