PHPackages                             explicador/e2payments-php-sdk - 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. [Payment Processing](/categories/payments)
4. /
5. explicador/e2payments-php-sdk

ActiveLibrary[Payment Processing](/categories/payments)

explicador/e2payments-php-sdk
=============================

Pacote de integração de pagamentos online por MPesa, eMola, MKesh, conta móvel, BIM, Master Card e mais

v1.0.4(4y ago)84994[1 PRs](https://github.com/Explicador/e2Payments-php-sdk/pulls)MITPHPPHP &gt;=7.3

Since Apr 17Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Explicador/e2Payments-php-sdk)[ Packagist](https://packagist.org/packages/explicador/e2payments-php-sdk)[ Docs](https://github.com/explicador/e2payments-php-sdk)[ RSS](/packages/explicador-e2payments-php-sdk/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

Explicador e2Payments PHP SDK
=============================

[](#explicador-e2payments-php-sdk)

[![Latest Version on Packagist](https://camo.githubusercontent.com/c58dc1660f05a5eb6cdbbec0ca6ff8091f63cee6baa1f564322e7944aed86f30/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6578706c696361646f722f65327061796d656e74732d7068702d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/explicador/e2payments-php-sdk)[![Build Status](https://camo.githubusercontent.com/5cf8fb0681a768ab178030e93bb81f30b485b3927901a38c0ab2978282bce334/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6578706c696361646f722f65327061796d656e74732d7068702d73646b2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/explicador/e2payments-php-sdk)[![Quality Score](https://camo.githubusercontent.com/6302c27a5a15a3110eb419ec3d8c8b50867c39e3a524830035cec36268b5041f/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6578706c696361646f722f65327061796d656e74732d7068702d73646b2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/explicador/e2payments-php-sdk)[![Total Downloads](https://camo.githubusercontent.com/a96bf7ce4509b788936503658d63fc39826cc45c5fe314cce8a071c12cdb7121/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6578706c696361646f722f65327061796d656e74732d7068702d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/explicador/e2payments-php-sdk)

[![Plataforma e2Payments](https://camo.githubusercontent.com/d26568dd01d5dc80d6b55174cae7b86b2f327704bf4499151da06626b892adb1/68747470733a2f2f65327061796d656e74732e6578706c696361646f722e636f2e6d7a2f6c616e64696e672f696d672f6170702d6465736b746f702d64656d6f2d73637265656e73686f74362d312e504e47 "A forma simples de integrar pagamentos online")](https://e2payments.explicador.co.mz)

This package seeks to help php developers implement the [e2Payments](https://e2payments.explicador.co.mz) APIs without much hustle. It is based on the REST API whose documentation is available on .

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

[](#installation)

You can install the package via composer:

```
composer require explicador/e2payments-php-sdk
```

Usage
-----

[](#usage)

```
// Set the consumer key and consumer secret as follows
$mpesa = new \Explicador\E2paymentsPhpSdk\Mpesa();
$mpesa->setClientId('your e2payments client id');
$mpesa->setClientSecret('your e2payments client secret');
$mpesa->setWalletId('your walletId from e2payments');// 'live' production environment

//This creates transaction between an M-Pesa short code to a phone number registered on M-Pesa.

$result = $mpesa->c2b($phone_number, $amount, $reference);
```

Example
-------

[](#example)

```
// Your variables

// The e2payments is REST API based platform
// find or create your credential from: https://e2payments.explicador.co.mz/admin/credentials

$client_id = 'oQPGhzqyDRilpzvTT6g0nhSeomVQ9G7zZrvY4v00'; //you must change
$client_secret = '961022ed-08f6-4980-a1b3-f017fd15b800'; //you must change

// find your wallet_id from: https://e2payments.explicador.co.mz/admin/mpesa
// or in the organizations where you were invited
// The wallet_id starts by (#), insert here without (#)

$wallet_id = '111111'; //you must change

// SDK initiation for mpesa transaction
$mpesa = new \Explicador\E2paymentsPhpSdk\Mpesa([
   'client_secret' => $client_secret,
   'client_id'     => $client_id,
   'wallet_id'     => $wallet_id,
]);

//This creates transaction between an M-Pesa short code to a phone number registered on M-Pesa.
$result = $mpesa->c2b($phone_number, $amount, $reference);

echo var_dump($result);
```

### Common HTTP Status Codes

[](#common-http-status-codes)

Status CodeDescriptionExplanation200OKRequest Executed successfully and stored in e2Payments Platform201AddedThe transaction executed successfully and stored in e2Payments Platform400Bad RequestWallet, origin or other mpesa issues403ForbiddenIf the Wallet ID does not exists or does not belongs to the user (if walletId belongs to some organization, the user must be invited)401UnauthenticatedClient ID or Client Secret issues500Server errorIf this happens please, report to Explicador Team.### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

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

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

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

Credits
-------

[](#credits)

- [José Seie](https://github.com/joseseie)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

PHP Package Boilerplate
-----------------------

[](#php-package-boilerplate)

This package was generated using the [PHP Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 77.8% 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 ~1 days

Total

4

Last Release

1536d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6ac6b251dc844c467639e4be0ceb5be98531bdb3474dac0e776091a157ef1137?d=identicon)[explicador](/maintainers/explicador)

![](https://www.gravatar.com/avatar/cbcc10240b484787c4f0b6963081c8f17e37c725a7356cc07bcfea0a7837a2d1?d=identicon)[joseseie](/maintainers/joseseie)

---

Top Contributors

[![joseseie](https://avatars.githubusercontent.com/u/18400142?v=4)](https://github.com/joseseie "joseseie (7 commits)")[![tantofaznem](https://avatars.githubusercontent.com/u/6969148?v=4)](https://github.com/tantofaznem "tantofaznem (2 commits)")

---

Tags

e2paymentsmpesampesa-paymentspayment gatewaympesavisapayment-integrationpayment solutionmpesa-apimpesa-sdkvodacom-mozambiqueemolae2paymentsexplicadorjose-seiemkeshmaster-card

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/explicador-e2payments-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/explicador-e2payments-php-sdk/health.svg)](https://phpackages.com/packages/explicador-e2payments-php-sdk)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[karson/mpesa-php-sdk

172.5k](/packages/karson-mpesa-php-sdk)[shetabit/multipay

PHP Payment Gateway Integration Package

293361.0k4](/packages/shetabit-multipay)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

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

ChargeBee API client implementation for PHP

758.5M9](/packages/chargebee-chargebee-php)

PHPackages © 2026

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