← 返回 Skills 市场
M-Pesa Daraja
作者
Nevil Paul
· GitHub ↗
· v1.0.0
· MIT-0
75
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install mpesa-daraja
功能描述
Build, review, test, or explain Safaricom M-Pesa Daraja API integrations for STK Push/Lipa na M-Pesa Online, C2B validation and confirmation, B2C payouts, tr...
使用说明 (SKILL.md)
M-Pesa Daraja
Operating Rules
- Treat this as a payment-integration skill, not permission to move money.
- Default to Daraja sandbox endpoints and test credentials unless the user explicitly asks for production guidance.
- Never store consumer secrets, passkeys, initiator passwords, security credentials, access tokens, callback payloads with phone numbers, or transaction IDs in committed files.
- Ask before calling any live/production endpoint or sending any request that could trigger a payment prompt, payout, reversal, or customer-facing callback.
- Prefer environment variables and secret managers over `.env` files in shared repos. If `.env.example` is needed, use placeholder values only.
- Make callbacks idempotent: verify request shape, persist raw event safely, deduplicate by CheckoutRequestID/ConversationID/TransactionID, then process business state transitions.
Workflow
- Identify the payment flow:
- STK Push / Lipa na M-Pesa Online for customer-initiated checkout.
- C2B for paybill/till customer payments with validation and confirmation callbacks.
- B2C for business payouts to customers or agents.
- Transaction Status / Reversal for reconciliation and recovery.
- Confirm runtime context: language/framework, sandbox vs production, callback URL availability, persistence layer, and compliance constraints.
- Design the integration around these boundaries:
- token generation and caching
- request signing/password generation
- outbound Daraja client
- callback receiver
- idempotency/reconciliation
- observability without leaking personal or payment data
- Use `references/examples.md` when the user asks for sample OpenClaw prompts, implementation examples, or architecture snippets.
- Use `references/test-cases.md` when the user asks for QA scenarios, unit tests, integration tests, sandbox tests, or production-readiness checks.
- Use `scripts/validate_daraja_fixture.py` to sanity-check example STK Push request and callback JSON fixtures before writing tests around them.
Implementation Guidance
- Keep Daraja client code small and injectable so app tests can mock HTTP calls.
- Generate the STK password as `base64(shortcode + passkey + timestamp)` with timestamp format `YYYYMMDDHHmmss`.
- Use OAuth access tokens from Daraja and cache them until shortly before expiry.
- Expose public HTTPS callback URLs in sandbox using a stable tunnel or deployed test environment; avoid local-only callback URLs.
- Return fast from callbacks after durable persistence; do heavier fulfillment asynchronously when possible.
- Log correlation IDs, response codes, and internal order IDs. Mask phone numbers, names, access tokens, credentials, and raw security credentials.
- Model payment state explicitly, for example: `pending`, `prompt_sent`, `paid`, `failed`, `cancelled`, `expired`, `reversed`, `manual_review`.
Common OpenClaw Requests
- "Use $mpesa-daraja to add STK Push checkout to this Django app."
- "Use $mpesa-daraja to write sandbox test cases for our M-Pesa checkout."
- "Use $mpesa-daraja to review this Daraja callback handler for idempotency and secret leakage."
- "Use $mpesa-daraja to create an OpenClaw automation that drafts M-Pesa reconciliation reports without touching production APIs."
Deliverables To Prefer
- For implementation: client module, callback route, typed request/response models, masked logging, tests, and `.env.example`.
- For review: findings ordered by payment risk, security risk, idempotency/reconciliation risk, then code quality.
- For planning: flow diagram in text, endpoint list, secret list, callback contract, test plan, and production checklist.
- For troubleshooting: exact failing step, expected Daraja response, likely causes, and the smallest safe verification step.
安全使用建议
Treat this as an incomplete review: the VirusTotal telemetry is clean, but the artifact files were not readable in this run, so installation should wait for a successful artifact inspection.
能力标签
能力评估
Purpose & Capability
Not assessable from artifact contents because metadata.json and artifact files could not be read in this run.
Instruction Scope
Not assessable from artifact contents because the supplied files were unavailable to the reviewer due to sandbox execution failure.
Install Mechanism
Not assessable from artifact contents; no install spec evidence was available.
Credentials
Not assessable from artifact contents; no capability or runtime evidence was available.
Persistence & Privilege
Not assessable from artifact contents; no evidence of persistence or privilege behavior was available.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install mpesa-daraja - 安装完成后,直接呼叫该 Skill 的名称或使用
/mpesa-daraja触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: Safaricom M-Pesa Daraja integration planning, implementation guidance, sandbox testing, callback idempotency checks, and production-readiness review.
元数据
常见问题
M-Pesa Daraja 是什么?
Build, review, test, or explain Safaricom M-Pesa Daraja API integrations for STK Push/Lipa na M-Pesa Online, C2B validation and confirmation, B2C payouts, tr... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 75 次。
如何安装 M-Pesa Daraja?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install mpesa-daraja」即可一键安装,无需额外配置。
M-Pesa Daraja 是免费的吗?
是的,M-Pesa Daraja 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
M-Pesa Daraja 支持哪些平台?
M-Pesa Daraja 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 M-Pesa Daraja?
由 Nevil Paul(@nevilpaulo)开发并维护,当前版本 v1.0.0。
推荐 Skills