Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Mpesa Laravel Package

iankumu/mpesa

iankumu/mpesa is a Laravel package that streamlines Safaricom M-Pesa integration. It supports STK Push, C2B, B2C, transaction status, reversals, and callback handling through a clean, configurable API, making it easier to build payments, collections, and disbursement flows.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Payments feature delivery on M-Pesa rails. The package wraps STK Push (Lipa na M-Pesa), C2B, B2C, and transaction status behind a config-driven Laravel interface. That maps to concrete product surfaces: checkout prompts for customers, paybill/till collection for incoming payments, disbursements for refunds, payouts, or merchant settlements, and reconciliation/status checks for support tooling. Each of these can be scoped as a roadmap item without a bespoke Safaricom integration project behind it.
  • Build vs. buy, leaning buy. Authentication, callback plumbing, validation, logging, and event hooks are the parts of an M-Pesa integration that generate the most incident tickets and the least product differentiation. Buying that as a dependency lets engineering spend its budget on the product logic around payments — pricing, retries, receipts, reconciliation UX — rather than on re-implementing OAuth token handling and callback routing.
  • Kenya / East Africa market entry or expansion. If M-Pesa is a required payment method for a target market, this package is a short path to a working integration. It materially shortens the time between "we've decided to sell there" and "a customer can pay us there," which is usually the gating item on a market-launch timeline.
  • Callback and reconciliation roadmap items. Ready-made callback handling plus event hooks means downstream product features — payment confirmation states, webhook-driven order fulfilment, failed-payment recovery, finance reporting — can be planned on top of a stable event surface instead of being blocked on integration work.
  • Refunds and disbursements as a product capability. B2C support is what makes refunds, seller payouts, and promotional credits feasible without a separate integration. That unlocks roadmap items that are otherwise "blocked on payments infrastructure."
  • Framework upgrade sequencing. The 2.3.0 release adds Laravel 13 support as a non-breaking minor, so the package does not become an upgrade blocker. Platform upgrade work and payments roadmap work can proceed without a dependency-replacement workstream.
  • Vendor risk tracking. A prompt framework-compatibility release is a positive maintenance signal. Treat it as a leading indicator: if the package lags the next Laravel major, that is the early warning to evaluate alternatives.

Caveat for the decision record: the evidence base here is a package description plus one compatibility release. The functional surface looks well-matched to a real product need, but durability signals — maintainer depth, release cadence, test coverage, issue responsiveness, security process — are thin. It is reasonable to build non-critical payment flows on it now; putting revenue-critical checkout on it warrants a short diligence pass first, and a documented fallback plan (the M-Pesa APIs are public; the wrapper is replaceable) if maintenance stalls.

When to Consider This Package

Consider it when:

  • M-Pesa is a required payment method for your market. This is the primary trigger. If customers need to pay via STK Push or you need C2B collection or B2C disbursement, the package covers the core flows.
  • You are on Laravel, or moving to Laravel 13. Support is explicit as of 2.3.0, shipped as a non-breaking minor. Framework-version lockstep is a real adoption advantage.
  • The integration is adjacent to, not core to, your product. Payments are usually a means to an end. If M-Pesa is one of several payment methods behind an abstraction you own, the dependency risk is well contained.
  • You want callbacks, logging, and events handled for you. The built-in validation, logging, and event hooks are exactly what you would otherwise build and then maintain. Confirm they match your observability and audit requirements before assuming they do.
  • You need to move quickly on a market launch or pilot. Publishable config and migrations shorten setup to hours rather than a sprint.
  • You can absorb a fork if needed. MIT license, small surface area, public upstream APIs. The exit cost is low, which is itself an argument for adopting.

Look elsewhere, or defer, when:

  • Payments are on your critical revenue path with no fallback. There is no evidence here of an LTS policy, a published security-response process, or a documented deprecation policy. For revenue-critical checkout, require those or plan to own the code.
  • You are not on Laravel. The value proposition is Laravel config, service provider, events, and migrations. In another framework you are paying for scaffolding you cannot use.
  • You need multi-provider payment abstraction. This package is M-Pesa-specific. If your roadmap includes Stripe, Flutterwave, or card processing behind one interface, adopting a single-provider wrapper may create a seam you later have to refactor. Check whether your product actually needs that abstraction now.
  • You need capabilities beyond the wrapped endpoints. The package covers STK Push, C2B, B2C, and status queries. Requirements like recurring billing, Ratiba/standing orders, Bill Manager, or deep reconciliation reporting may fall outside it — verify against the docs before committing.
  • Compliance or procurement requires formal guarantees. No LTS, no security disclosure policy, no published support commitments. If those are hard gates, this is not yet a demonstrable fit.
  • Single-maintainer or bus-factor risk is unacceptable. 55 stars and a young 2.x line suggest a small maintainer base. For business-critical functionality, prefer visible maintainer depth or budget to fork and own it.
  • The capability is trivial for your team. If you already have M-Pesa integration experience in-house, the governance cost of a dependency may exceed the savings.

How to Pitch It (Stakeholders)

For executives — one paragraph: This package is a Laravel wrapper around Safaricom's M-Pesa APIs — customer payment prompts, incoming collections, outgoing disbursements, and transaction status. Adopting it turns an M-Pesa integration from a multi-sprint engineering project into a configuration and feature-build task, which is the difference between making a market launch date and slipping it. It is MIT-licensed, actively tracking Laravel majors (2.3.0 added Laravel 13 support as a non-breaking minor), and its surface area is small enough that we could replace or fork it if maintenance lapsed. The trade-off is maturity: the package is early in its life with a thin public track record. Recommendation: adopt it for payments on non-critical paths and pilots now; before we route primary revenue through it, run a short diligence pass on maintainer depth, test coverage, and security posture, and document the fallback.

For engineering: This is a standard Composer dependency that removes the boilerplate around M-Pesa: OAuth/token handling, STK Push initiation, C2B and B2C calls, status queries, callback routing, validation, logging, and event hooks, configured through a publishable Laravel config. Integration work is a config publish, credentials per environment, migration publish if applicable, and wiring our domain logic to the emitted events. Laravel 13 support landed in 2.3.0 via a minor release — no breaking changes signalled — so it should not block the platform upgrade; adopt before or alongside the framework bump rather than compounding changes. Before widening adoption, confirm three things: the package's compatibility matrix still covers every Laravel and PHP version we run elsewhere, the level of test coverage behind the callback and event paths we depend on, and whether our error-handling and idempotency expectations are met by the built-in validation and logging or need to be layered on top. Keep the callbacks behind an interface we own so the wrapper stays swappable.

For procurement / risk: MIT license, no contractual commitment, no procurement gate. The open questions are continuity questions — maintainer count, release cadence, whether a security disclosure policy exists, and how quickly the package tracks future Laravel majors — not questions about this release. Because the upstream M-Pesa APIs are public and the wrapper is small, the exit cost is low: worst case we fork it, and the fallback is an in-house integration of comparable scope to what we would have built anyway. That caps the downside and is why we are comfortable proceeding on non-critical scope while diligence continues.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route