PHPackages                             evans-wanguba/flexipay-api - 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. evans-wanguba/flexipay-api

ActiveLibrary[API Development](/categories/api)

evans-wanguba/flexipay-api
==========================

This is a non-official PHP package for handling Flexpay Lipa Polepole API.

00PHP

Since Oct 30Pushed 8mo agoCompare

[ Source](https://github.com/Evans-Wanguba/flexpay-api)[ Packagist](https://packagist.org/packages/evans-wanguba/flexipay-api)[ RSS](/packages/evans-wanguba-flexipay-api/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

**Introduction**

This is a non-official PHP package for handling Flexpay Lipa Polepole API. It is based on the REST API whose documentation is available on .

**Installation using composer**
`composer require evans-wanguba/flexpay-api`

**Configuration**
At your project root, create a .env file and in it set the consumer key and consumer secret as follows
`FLEXPAY_API_KEY= [consumer key]`
`FLEXPAY_API_SECRET=[consumer secret]`
`FLEXPAY_TIMEOUT=[timeout]`
`FLEXPAY_ENV=[production or staging]`

**Usage**

web.php:

```
use Illuminate\Support\Facades\Route;
use EvansWanguba\Flexpay\Http\Controllers\WebhookController;

Route::post('flexpay/webhook', [WebhookController::class, 'handle']);
```

WebhookController.php

```
namespace EvansWanguba\Flexpay\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;

class WebhookController extends Controller
{
    public function handle(Request $request)
    {
        // Flexpay recommends quick 2xx responses and async processing.
        // Log and push to queue for heavy work.
        \Log::info('Flexpay webhook received', $request->all());
        // example: validate minimal payload
        $payload = $request->all();
        // You should process asynchronously (dispatch job) - but respond immediately:
        return response()->json(['status' => 'ok'], 200);
    }
}
```

**Publishing**

Add package to composer or use path repository.

`Run php artisan vendor:publish --provider="EvansWanguba\Flexpay\FlexpayServiceProvider" --tag="flexpay-config" to publish config.`

Set .env keys as shown earlier.

**Example**

```
use Flexpay; // facade

public function bookItem()
{
    $resp = \Flexpay::book([
        'productName' => 'Washing Machine',
        'productPrice' => 200,
        'phoneNumber' => '+254712345678',
        'productDeposit' => 50,
        'bookingDays' => 45,
        'paymentType' => 'MPESA',
        'email' => 'jane@example.com',
        'firstName' => 'Jane',
        'lastName' => 'Doe',
    ]);

    return response()->json($resp);
}
```

Support
-------

[](#support)

See `sample.php` for more examples. The API documentation is also available in the `docs` folder. Or email me at `ewanguba@gmail.com`

###  Health Score

16

—

LowBetter than 4% of packages

Maintenance43

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 Bus Factor1

Top contributor holds 87.5% 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/ebaac904473110b7bd9dd555bacafaa806c31df6e101b5286d3e00b30b167cbf?d=identicon)[Evans-Wanguba](/maintainers/Evans-Wanguba)

---

Top Contributors

[![Evans-Wanguba](https://avatars.githubusercontent.com/u/14167768?v=4)](https://github.com/Evans-Wanguba "Evans-Wanguba (7 commits)")[![Maisy-wangui](https://avatars.githubusercontent.com/u/124494303?v=4)](https://github.com/Maisy-wangui "Maisy-wangui (1 commits)")

### Embed Badge

![Health badge](/badges/evans-wanguba-flexipay-api/health.svg)

```
[![Health](https://phpackages.com/badges/evans-wanguba-flexipay-api/health.svg)](https://phpackages.com/packages/evans-wanguba-flexipay-api)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k15](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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