PHPackages                             geekabel/mobile-money-payment - 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. geekabel/mobile-money-payment

ActiveLibrary[Payment Processing](/categories/payments)

geekabel/mobile-money-payment
=============================

A flexible and extensible PHP package for integrating mobile money payment services, supporting Tmoney and Flooz payment providers.

v1.1.0(1y ago)01MITPHPPHP &gt;=8.2

Since Sep 23Pushed 1y ago1 watchersCompare

[ Source](https://github.com/geekabel/mobile-money-payment)[ Packagist](https://packagist.org/packages/geekabel/mobile-money-payment)[ RSS](/packages/geekabel-mobile-money-payment/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (1)Dependencies (6)Versions (4)Used By (0)

Mobile Money Payment Package
============================

[](#mobile-money-payment-package)

Overview
--------

[](#overview)

The Mobile Money Payment package provides a flexible and extensible solution for integrating mobile money payment services into PHP applications. It currently supports Tmoney and Flooz payment services, with an architecture that allows easy addition of new payment providers.

Features
--------

[](#features)

- Support for multiple payment services (currently Tmoney and Flooz)
- Extensible architecture using the Strategy pattern
- Standardized payment responses across different services
- Flexible Flooz counter management system
- Easy integration with various PHP applications, including Symfony

Requirements
------------

[](#requirements)

- PHP 8.2 or higher
- Symfony HTTP Client

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

[](#installation)

Install the package via Composer:

```
composer geekabel/mobile-money-payment
```

Basic Usage
-----------

[](#basic-usage)

### Setting up the Payment Manager

[](#setting-up-the-payment-manager)

```
use MobileMoneyPayment\PaymentManager;
use MobileMoneyPayment\Service\TmoneyService;
use MobileMoneyPayment\Service\FloozService;
use MobileMoneyPayment\Service\DefaultFloozCounterManager;

// Create service instances
$tmoneyService = new TmoneyService(
    $httpClient,
    $logger,
    'tmoney_username',
    'tmoney_password',
    'tmoney_alias',
    'https://tmoney-api-url.com'
);

$floozService = new FloozService(
    $httpClient,
    $logger,
    new DefaultFloozCounterManager(),
    'flooz_username',
    'flooz_password',
    'flooz_key',
    'flooz_merchant_name',
    'flooz_partner_msisdn',
    'https://flooz-api-url.com'
);

// Create and set up the Payment Manager
$paymentManager = new PaymentManager();
$paymentManager->addService('tmoney', $tmoneyService);
$paymentManager->addService('flooz', $floozService);
```

### Making a Payment

[](#making-a-payment)

```
$response = $paymentManager->pay('tmoney', '1234567890', 100.00, 'REF123', 'Payment for order #123');

if ($response->success) {
    echo "Payment successful! Transaction ID: " . $response->transactionId;
} else {
    echo "Payment failed: " . $response->message;
}
```

### Checking Payment Status

[](#checking-payment-status)

```
$status = $paymentManager->checkStatus('flooz', 'REF123');

echo "Payment status: " . $status->status;
```

Extending the Package
---------------------

[](#extending-the-package)

### Adding a New Payment Service

[](#adding-a-new-payment-service)

1. Create a new class that implements `PaymentServiceInterface`:

```
use MobileMoneyPayment\Interface\PaymentServiceInterface;
use MobileMoneyPayment\Model\PaymentResponse;

class NewPaymentService implements PaymentServiceInterface
{
    public function pay(string $phone, float $amount, string $reference, string $description = ''): PaymentResponse
    {
        // Implement payment logic
    }

    public function checkStatus(string $reference): PaymentResponse
    {
        // Implement status check logic
    }
}
```

2. Add the new service to the Payment Manager:

```
$newService = new NewPaymentService(/* ... */);
$paymentManager->addService('new_service', $newService);
```

### Custom Flooz Counter Manager

[](#custom-flooz-counter-manager)

1. Create a class that implements `FloozCounterManagerInterface`:

```
use MobileMoneyPayment\Interface\FloozCounterManagerInterface;

class CustomFloozCounterManager implements FloozCounterManagerInterface
{
    public function getAndIncrementCounter(): int
    {
        // Implement custom counter logic
    }
}
```

2. Use the custom manager when creating the Flooz service:

```
$customCounterManager = new CustomFloozCounterManager();
$floozService = new FloozService(
    $httpClient,
    $logger,
    $customCounterManager,
    // ... other parameters
);
```

Advanced Usage
--------------

[](#advanced-usage)

### Error Handling

[](#error-handling)

The package uses `PaymentException` for specific payment-related errors. It's recommended to catch these exceptions:

```
use MobileMoneyPayment\Exception\PaymentException;

try {
    $response = $paymentManager->pay('tmoney', '1234567890', 100.00, 'REF123');
} catch (PaymentException $e) {
    echo "Payment error: " . $e->getMessage();
} catch (\Exception $e) {
    echo "Unexpected error: " . $e->getMessage();
}
```

### Logging

[](#logging)

The package accepts a PSR-3 compatible logger. You can provide your own logger implementation for custom logging behavior:

```
use Monolog\Logger;
use Monolog\Handler\StreamHandler;

$logger = new Logger('payment');
$logger->pushHandler(new StreamHandler('path/to/your.log', Logger::DEBUG));

$tmoneyService = new TmoneyService(
    $httpClient,
    $logger,
    // ... other parameters
);
```

Symfony Integration
-------------------

[](#symfony-integration)

For detailed instructions on how to integrate this package with Symfony 6.4, 7.0, 7.1, and superior versions, please refer to our [Symfony Integration Guide](docs/SYMFONY_INTEGRATION.md).

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

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance42

Moderate activity, may be stable

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~172 days

Total

2

Last Release

477d ago

### Community

Maintainers

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

---

Top Contributors

[![geekabel](https://avatars.githubusercontent.com/u/33297904?v=4)](https://github.com/geekabel "geekabel (13 commits)")

---

Tags

phpsymfonypaymentmobile-moneytmoneyflooz

###  Code Quality

TestsPHPUnit

Static AnalysisRector

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/geekabel-mobile-money-payment/health.svg)

```
[![Health](https://phpackages.com/badges/geekabel-mobile-money-payment/health.svg)](https://phpackages.com/packages/geekabel-mobile-money-payment)
```

###  Alternatives

[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M203](/packages/sulu-sulu)[web-auth/webauthn-framework

FIDO2/Webauthn library for PHP and Symfony Bundle.

515100.5k3](/packages/web-auth-webauthn-framework)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1189.8k](/packages/rcsofttech-audit-trail-bundle)[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)[chameleon-system/chameleon-base

The Chameleon System core.

1028.6k5](/packages/chameleon-system-chameleon-base)[bitrix24/b24phpsdk

An official PHP library for the Bitrix24 REST API

10244.2k5](/packages/bitrix24-b24phpsdk)

PHPackages © 2026

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