PHPackages                             pro-cms/pesa - 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. pro-cms/pesa

ActiveLibrary[API Development](/categories/api)

pro-cms/pesa
============

Pesa PHP SDK

1.0.0(4y ago)01111MITPHPPHP ^7.2|^8.0

Since Oct 16Pushed 4y agoCompare

[ Source](https://github.com/pro-cms/php-pesa)[ Packagist](https://packagist.org/packages/pro-cms/pesa)[ Docs](https://github.com/openpesa/pesa)[ RSS](/packages/pro-cms-pesa/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (2)Versions (7)Used By (1)

[![](./art/Openpesa_PHP.png)](./art/Openpesa_PHP.png)

Pesa SDK for PHP
================

[](#pesa-sdk-for-php)

[![Latest Version on Packagist](https://camo.githubusercontent.com/11596c8ad018b6639ca6dc41cf54d20d1cbf2063b234a20d1a1ca2594296ec66/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f70656e706573612f706573612e7376673f7374796c653d666c61742d737175617265263f696e636c7564655f70726572656c6561736573)](https://packagist.org/packages/openpesa/pesa)[![Test](https://github.com/openpesa/php-pesa/workflows/Test/badge.svg)](https://github.com/openpesa/php-pesa/workflows/Test/badge.svg)[![documentation](https://github.com/openpesa/php-pesa/workflows/documentation/badge.svg)](https://github.com/openpesa/php-pesa/workflows/documentation/badge.svg)[![Hits](https://camo.githubusercontent.com/ad9eefb64cbf9df4364cb1d580dc253e6bd04765f8fc13ec14eaea81ebc367ef/68747470733a2f2f686974732e736565796f756661726d2e636f6d2f6170692f636f756e742f696e63722f62616467652e7376673f75726c3d68747470732533412532462532466769746875622e636f6d2532466f70656e706573612532467068702d7065736126636f756e745f62673d253233373943383344267469746c655f62673d2532333535353535352669636f6e3d636f646569676e697465722e7376672669636f6e5f636f6c6f723d253233453745374537267469746c653d6869747326656467655f666c61743d74727565)](https://hits.seeyoufarm.com)[![codecov.io](https://camo.githubusercontent.com/5f6d681416b6c6acb60e199c6e59fcb899eed6aa87d0e54ee6151c373c89244b/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6f70656e706573612f7068702d706573612f6d61696e3f7374796c653d666c61742d737175617265)](https://codecov.io/github/openpesa/php-pesa)[![Total Downloads](https://camo.githubusercontent.com/c69d7e3fc17e377e9b1b1f4e66953b39daeb7aaa49b4a3549855a3ad42743245/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f70656e706573612f706573612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/openpesa/pesa)

The **Pesa SDK for PHP** makes it easy for developers to access [OpenAPI](https://openapiportal.m-pesa.com/) in their PHP code, and build robust applications and software using services like Customber 2 Bussiness, Query etc.

Documentation
-------------

[](#documentation)

Take a look at the [API docs here](https://openpesa.github.io/php-pesa/).

Getting Started
---------------

[](#getting-started)

1. **Sign up for OpenAPI Portal** – Before you begin, you need to sign up for an account and retrieve your credentials.
2. **Minimum requirements** – To run the SDK, your system will need to meet the [minimum requirements](https://openpesa.github.io/php-pesa/guide/installation#system-requirements), including having **PHP &gt;= 7.1**.
3. **Install the SDK** – Using \[Composer\] is the recommended way to install the Pesa SDK for PHP. The SDK is available via \[Packagist\] under the [`openpesa/php-pesa`](https://packagist.org/packages/openpesa/pesa) package. If Composer is installed globally on your system, you can run the following in the base directory of your project to add the SDK as a dependency:

    ```
    composer require openpesa/pesa
    ```

    Please see the [Installation section of the User Guide](https://openpesa.github.io/php-pesa/guide/installation) for more detailed information about installing the SDK through Composer and other means.
4. **Using the SDK** – The best way to become familiar with how to use the SDK is to read the [User Guide](https://openpesa.github.io/php-pesa/guide/quick_guide).

Usage
-----

[](#usage)

### Quick Examples

[](#quick-examples)

```
require 'vendor/autoload.php';

use Openpesa\SDK\Pesa;

// Intiate with credentials
$pesa = new Pesa([
            'api_key' => 'YOUR_API_KEY',
            'public_key' => 'PUBLIC_KEY',
            'client_options' => [],
        ],'sandbox');

// Setup the transaction
$data = [
    'input_Amount' => '10000',
    'input_Country' => 'TZN',
    'input_Currency' => 'TZS',
    'input_CustomerMSISDN' => '255766303775',
    'input_ServiceProviderCode' => '000000',
    'input_ThirdPartyConversationID' => 'rerekf',
    'input_TransactionReference' => rand(),
    'input_PurchasedItemsDesc' => 'Test Two Item'
];

// Execute
$result = $pesa->c2b($data);

// Print results
var_dump($result);
```

For more example check [pesa-demo-example](https://github.com/openpesa/php-pesa/tree/develop/examples).

### Testing

[](#testing)

```
composer test
```

Opening Issues
--------------

[](#opening-issues)

If you have a feature requrest or you encounter a bug, please file an issue on [our issue tracker on GitHub](https://github.com/openpesa/php-pesa/issues).

Resources
---------

[](#resources)

- [User Guide](https://openpesa.github.io/php-pesa/) – For both getting started and in-depth SDK usage information
- [API Docs](https://openapiportal.m-pesa.com/) – For details about operations, parameters, and responses
- [Blog](https://openpesa.github.io/blog/) – Tips &amp; tricks, articles, and announcements
- [Sample Project](https://github.com/alphaolomi/laravel-pesa-demo) - A quick, sample project to help get you started
- [Issues](https://github.com/openpesa/php-pesa/issues) – Report issues, submit pull requests, and get involved
- [@openpesa](https://twitter.com/openpesa) – Follow us on Twitter

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please review our [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Alpha Olomi](https://github.com/openpesa)
- [Ley](https://github.com/leyluj)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 85.2% 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.

###  Release Activity

Cadence

Every ~498 days

Total

2

Last Release

1587d ago

Major Versions

0.0.1 → 1.0.02022-02-26

PHP version history (2 changes)0.0.1PHP ^7.1

1.0.0PHP ^7.2|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/0106b85cb7795defc0d17a630c94a97e9f9e33c6e8e433fe2bc340f40f444bc5?d=identicon)[zepson](/maintainers/zepson)

---

Top Contributors

[![alphaolomi](https://avatars.githubusercontent.com/u/10551599?v=4)](https://github.com/alphaolomi "alphaolomi (69 commits)")[![leyluj](https://avatars.githubusercontent.com/u/5972918?v=4)](https://github.com/leyluj "leyluj (9 commits)")[![pro-cms](https://avatars.githubusercontent.com/u/57701433?v=4)](https://github.com/pro-cms "pro-cms (3 commits)")

---

Tags

apipesaopenpesa

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pro-cms-pesa/health.svg)

```
[![Health](https://phpackages.com/badges/pro-cms-pesa/health.svg)](https://phpackages.com/packages/pro-cms-pesa)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[resend/resend-php

Resend PHP library.

617.2M42](/packages/resend-resend-php)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

563.6M13](/packages/checkout-checkout-sdk-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

783.8k](/packages/scriptdevelop-whatsapp-manager)

PHPackages © 2026

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