{"_id":"@borapesa/clickpesa","_rev":"2-6c52947ab2524c8afc7c09342ca3e3fe","name":"@borapesa/clickpesa","dist-tags":{"latest":"0.3.16"},"versions":{"0.2.5":{"name":"@borapesa/clickpesa","version":"0.2.5","keywords":["clickpesa","payments","tanzania","mobile-money"],"author":{"name":"Bora Pesa contributors"},"license":"MIT","_id":"@borapesa/clickpesa@0.2.5","maintainers":[{"name":"kimjisena","email":"pjohmaths@gmail.com"}],"dist":{"shasum":"ff61e68191f9c3b8d92544db2b0167eb9bb1aa48","tarball":"https://registry.npmjs.org/@borapesa/clickpesa/-/clickpesa-0.2.5.tgz","fileCount":14,"integrity":"sha512-IN6fD7NfMd6fVsthAeAwJczax/Vp6CJ8Iu0D9kkZmCfKRMEi/MI+NPYJ9ucvxCVsgzR5AlLqQVjZf7IXTfdQfA==","signatures":[{"sig":"MEQCIF331ykLX+1dPopoM3axamEAMXRrKX5h8JVa3Umun10LAiBHb7afi/0UNwGIbxLwbhfy8smJSuTNH94pwwxGRNXUUw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":127579},"main":"./dist/index.js","type":"module","_from":"file:borapesa-clickpesa-0.2.5.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsc --watch","test":"vitest run","build":"tsc","clean":"rm -rf dist","coverage":"vitest run --coverage","typecheck":"tsc --noEmit"},"_npmUser":{"name":"kimjisena","email":"pjohmaths@gmail.com"},"_resolved":"/private/var/folders/qn/j5lyvf6s7fn36rhjfbnwx6qh0000gn/T/081129a17e9f04f5a6718f7d538e2e33/borapesa-clickpesa-0.2.5.tgz","_integrity":"sha512-IN6fD7NfMd6fVsthAeAwJczax/Vp6CJ8Iu0D9kkZmCfKRMEi/MI+NPYJ9ucvxCVsgzR5AlLqQVjZf7IXTfdQfA==","_npmVersion":"11.5.1","description":"ClickPesa provider adapter for Bora Pesa","directories":{},"_nodeVersion":"24.6.0","dependencies":{"uuid":"^14.0.1","@borapesa/pesa":"0.5.0"},"publishConfig":{"registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.9","typescript":"^6.0.3","@types/node":"^26.0.1","@vitest/coverage-v8":"^4.1.9"},"_npmOperationalInternal":{"tmp":"tmp/clickpesa_0.2.5_1783678909021_0.6974625054704611","host":"s3://npm-registry-packages-npm-production"}},"0.3.16":{"name":"@borapesa/clickpesa","version":"0.3.16","description":"ClickPesa provider adapter for Bora Pesa","license":"MIT","author":{"name":"Bora Pesa contributors"},"repository":{"type":"git","url":"git+https://github.com/borapesa/pesa.git","directory":"providers/clickpesa"},"homepage":"https://borapesa.dev","bugs":{"url":"https://github.com/borapesa/pesa/issues"},"type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"}},"scripts":{"build":"tsc","dev":"tsc --watch","test":"vitest run","coverage":"vitest run --coverage","typecheck":"tsc --noEmit","clean":"rm -rf dist"},"keywords":["clickpesa","payments","tanzania","mobile-money"],"packageManager":"pnpm@10.33.3","dependencies":{"@borapesa/pesa":"workspace:*","uuid":"^14.0.1"},"devDependencies":{"@types/node":"^26.0.1","@vitest/coverage-v8":"^4.1.9","typescript":"^6.0.3","vitest":"^4.1.9"},"publishConfig":{"registry":"https://registry.npmjs.org","provenance":true},"_id":"@borapesa/clickpesa@0.3.16","gitHead":"9a277315ab536342b78b1efee99b4846df8c9d71","_nodeVersion":"24.6.0","_npmVersion":"11.5.1","dist":{"integrity":"sha512-UuTmcR3u9KLuAiBKoyrB4M9xH8a6CaH19DL5ZksVSLQPi3wiQpVvxgkpxgosebHPJJuAjimpATOXE0RmrPKSFQ==","shasum":"fbea62353df72799e23071f63d3c30cadf9d9e3d","tarball":"https://registry.npmjs.org/@borapesa/clickpesa/-/clickpesa-0.3.16.tgz","fileCount":14,"unpackedSize":127887,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEtPSBwMHnGOW6dnZP6KOWopZg3092i/2M7/Q8onO8vvAiEA4Eo7afjhUYpV9BX7Ed23BquG3JdRjlqYg/f6qEd0pTk="}]},"_npmUser":{"name":"kimjisena","email":"pjohmaths@gmail.com"},"directories":{},"maintainers":[{"name":"kimjisena","email":"pjohmaths@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/clickpesa_0.3.16_1784294416011_0.6747208432477285"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-10T10:21:48.835Z","modified":"2026-07-17T13:20:16.303Z","0.2.5":"2026-07-10T10:21:49.215Z","0.3.16":"2026-07-17T13:20:16.150Z"},"author":{"name":"Bora Pesa contributors"},"license":"MIT","keywords":["clickpesa","payments","tanzania","mobile-money"],"description":"ClickPesa provider adapter for Bora Pesa","maintainers":[{"name":"kimjisena","email":"pjohmaths@gmail.com"}],"readme":"# @borapesa/clickpesa\n\nClickPesa provider adapter for Bora Pesa.\n\n[ClickPesa](https://clickpesa.com) is a licensed Payment System Provider under the Bank of Tanzania, supporting mobile money (M-Pesa, Airtel Money, Tigo Pesa, HaloPesa), card payments (Visa, Mastercard), bank payouts (ACH/RTGS), BillPay control numbers, hosted checkout/payout links, and exchange rates.\n\n## Install\n\n```bash\npnpm add @borapesa/pesa @borapesa/clickpesa\n```\n\n## Quick Start\n\n```ts\nimport { createPesa } from '@borapesa/pesa';\nimport { ClickPesaProvider } from '@borapesa/clickpesa';\n\nconst pesa = createPesa({\n  provider: new ClickPesaProvider({\n    sandbox:  true, // false for production\n    clientId: process.env.CLICKPESA_CLIENT_ID!,\n    apiKey:   process.env.CLICKPESA_API_KEY!,\n  }),\n});\n\n// USSD push — sends PIN prompt to customer's phone\nconst order = await pesa.createOrder({\n  amount:    15000,\n  currency:  'TZS',\n  reference: 'order_001',\n  customer:  { name: 'Juma Ali', phone: '255712345678' },\n});\n\n// Poll status\nconst status = await pesa.getPaymentStatus(order.orderId);\n```\n\n## Config\n\n| Field | Type | Required | Description |\n|---|---|---|---|\n| `clientId` | `string` | ✅ | Client ID from ClickPesa dashboard |\n| `apiKey` | `string` | ✅ | API key from ClickPesa dashboard |\n| `sandbox` | `boolean` | ❌ | Target sandbox environment (`api-sandbox.clickpesa.com`) |\n| `baseUrl` | `string` | ❌ | Override base URL (takes precedence over `sandbox`) |\n| `checksumKey` | `string` | ❌ | HMAC-SHA256 secret for request signing + webhook verification |\n| `redirectUrl` | `string` | ❌ | Default redirect URL for hosted checkout. Overridable per-payment via `payload.redirectUrl` |\n\n## Auth\n\nToken-based — `client-id` + `api-key` sent as custom headers to ClickPesa's `/third-parties/generate-token` endpoint. Tokens are cached in memory for 55 minutes (5-minute safety margin before the 1-hour expiry).\n\n## Supported Operations\n\n| Operation | Supported | Notes |\n|---|---|---|\n| `createOrder` | ✅ | USSD push (default). Checkout link when `redirectUrl` is set. |\n| `getPaymentStatus` | ✅ | |\n| `handleWebhook` | ✅ | HMAC-SHA256 checksum verification via Web Crypto |\n| `disburse` | ✅ | Mobile money + bank payout (ACH/RTGS) |\n| `validateCredentials` | ✅ | Health check via token endpoint |\n| `getBalance` | ✅ | Wallet balances across currencies |\n| `getAccountStatement` | ✅ | Transaction history with date filters |\n| `previewOrder` | ✅ | Preview USSD push or card payment |\n| `previewDisburse` | ✅ | Preview mobile money or bank payout |\n| `getNameLookup` | ✅ | Resolve account holder via payout preview |\n| `listOrders` | ✅ | Paginated with date filtering |\n| `getBanks` | ✅ | List supported banks + BIC codes |\n| `getExchangeRates` | ✅ | Currency conversion rates |\n| `generatePayoutLink` | ✅ | Hosted payout link (recipient enters details) |\n| `refund` | ❌ | Not exposed by ClickPesa API |\n| `cancelOrder` | ❌ | Not exposed by ClickPesa API |\n\n## Webhooks\n\nSet your webhook URL in the ClickPesa dashboard to `https://your-app.com/api/pesa/webhook`. Provide `checksumKey` in the config to enable HMAC-SHA256 verification and request signing.\n\n## Credentials\n\nGet your `clientId` and `apiKey` from the [ClickPesa Dashboard](https://docs.clickpesa.com). Sign up at [clickpesa.com](https://clickpesa.com).\n","readmeFilename":"README.md","homepage":"https://borapesa.dev","repository":{"type":"git","url":"git+https://github.com/borapesa/pesa.git","directory":"providers/clickpesa"},"bugs":{"url":"https://github.com/borapesa/pesa/issues"}}