PHPackages                             coding-sniper/mpesa-c2b - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. coding-sniper/mpesa-c2b

ActiveLibrary[API Development](/categories/api)

coding-sniper/mpesa-c2b
=======================

A PHP package for easily implementing Mpesa(Daraja) C2B checkout API.

041PHP

Since Mar 23Pushed 4y ago1 watchersCompare

[ Source](https://github.com/daniel-mutuku/mpesa-c2b)[ Packagist](https://packagist.org/packages/coding-sniper/mpesa-c2b)[ RSS](/packages/coding-sniper-mpesa-c2b/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

MpesaC2B API
============

[](#mpesac2b-api)

This is a PHP package for easily implementing Mpesa(Daraja) C2B checkout API.

Features
--------

[](#features)

- Initiate an STK push
- Check transaction status.

Installation
------------

[](#installation)

Inorder to install:

```
composer require coding-sniper/mpesa-c2b
```

Configuration
-------------

[](#configuration)

Fill in your credentials on the credentials.json file

```
{
  "customer_key": "",
  "callback" : "",
  "customer_secret" : "",
  "partyb" : "",
  "shortcode" : "",
  "pass_key" : "",
  "country_code" : "",
  "environment" : "live"

}
```

Usage
-----

[](#usage)

To perform an STK push:

```
use CodingSniper\MpesaC2B\MpesaC2B;
$data = array("phone" => "","amount" => "","account_reference" => "", "trans_description" => "");
$mpesaC2B = new MpesaC2B();
$mpesaC2B->stkPush($data);
```

To check the transaction status:

```
use CodingSniper\MpesaC2B\MpesaC2B;
$checkID = ""; // the check_id
$mpesaC2B = new MpesaC2B();
$mpesaC2B->checkTrans($checkID);
```

License
-------

[](#license)

MIT

**Free Software, Hell Yeah!**

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity26

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/bda755f95dfb913fbdbb5f12f95e7b5440183a1e2f54e840fc04b6f2a3d63164?d=identicon)[daniel-mutuku](/maintainers/daniel-mutuku)

---

Top Contributors

[![daniel-mutuku](https://avatars.githubusercontent.com/u/57315450?v=4)](https://github.com/daniel-mutuku "daniel-mutuku (4 commits)")

### Embed Badge

![Health badge](/badges/coding-sniper-mpesa-c2b/health.svg)

```
[![Health](https://phpackages.com/badges/coding-sniper-mpesa-c2b/health.svg)](https://phpackages.com/packages/coding-sniper-mpesa-c2b)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
