PHPackages                             malipopay/laravel - 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. malipopay/laravel

ActiveLibrary[Payment Processing](/categories/payments)

malipopay/laravel
=================

Official Laravel package for Malipopay - Service Provider, Facade, Blade directives, Eloquent model, and webhook handling for mobile money, bank, card, and USSD payments in Tanzania

v1.0.0(1mo ago)00MITPHPPHP ^8.1CI failing

Since Apr 21Pushed 1mo agoCompare

[ Source](https://github.com/Malipopay/malipopay-laravel)[ Packagist](https://packagist.org/packages/malipopay/laravel)[ Docs](https://developers.malipopay.co.tz)[ RSS](/packages/malipopay-laravel/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (7)Versions (2)Used By (0)

Malipopay Laravel Package
=========================

[](#malipopay-laravel-package)

Official Laravel integration for [Malipopay](https://malipopay.co.tz). Service Provider, Facade, Eloquent models, Blade directives, webhook handling, and artisan commands for accepting payments in Tanzania via Mobile Money, Bank Transfer, USSD, and Card.

Wraps the [malipopay/malipopay-php](https://packagist.org/packages/malipopay/malipopay-php) SDK with Laravel conveniences.

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

[](#installation)

```
composer require malipopay/laravel
```

Install the config and migrations:

```
php artisan malipopay:install
```

Add to `.env`:

```
MALIPOPAY_API_KEY=your_api_key_here
MALIPOPAY_ENVIRONMENT=uat
MALIPOPAY_WEBHOOK_SECRET=your_webhook_secret
```

Quick Start
-----------

[](#quick-start)

### Collect a payment

[](#collect-a-payment)

```
use Malipopay\Laravel\Facades\Malipopay;

$payment = Malipopay::collect([
    'description' => 'Order #1234',
    'amount' => 10000,
    'phoneNumber' => '255712345678',
]);

// $payment is an Eloquent MalipopayPayment model — already saved in your DB
echo $payment->reference;
echo $payment->status;
echo $payment->link;
```

### Disburse funds

[](#disburse-funds)

```
Malipopay::disburse([
    'description' => 'Salary payment',
    'amount' => 50000,
    'phoneNumber' => '255712345678',
]);
```

### Verify a payment

[](#verify-a-payment)

```
$payment = Malipopay::verify('PAY-abc123');
```

### Create a payment link

[](#create-a-payment-link)

```
$link = Malipopay::createPaymentLink([
    'amount' => 25000,
    'phoneNumber' => '255712345678',
]);

return redirect($link->link);
```

### Access any resource from the underlying SDK

[](#access-any-resource-from-the-underlying-sdk)

```
$customers = Malipopay::customers->list();
$invoice = Malipopay::invoices->create([...]);
Malipopay::sms->send([...]);
```

Webhooks
--------

[](#webhooks)

The package registers a POST route at `/webhooks/malipopay` automatically (configurable). It verifies the signature, stores the event, updates the payment model, and fires Laravel events you can listen to.

### Listen to events

[](#listen-to-events)

```
// app/Providers/EventServiceProvider.php
use Malipopay\Laravel\Events\PaymentCompleted;
use Malipopay\Laravel\Events\PaymentFailed;
use App\Listeners\FulfillOrder;

protected $listen = [
    PaymentCompleted::class => [FulfillOrder::class],
    PaymentFailed::class => [NotifyCustomerPaymentFailed::class],
];
```

### Listener example

[](#listener-example)

```
use Malipopay\Laravel\Events\PaymentCompleted;

class FulfillOrder
{
    public function handle(PaymentCompleted $event): void
    {
        $payment = $event->payment; // MalipopayPayment model
        // update your order, send confirmation email, etc.
    }
}
```

### Available events

[](#available-events)

EventFired when`PaymentCompleted`Collection successfully completed`PaymentFailed`Collection failed, reversed, or cancelled`DisbursementCompleted`Disbursement successfully completed`WebhookReceived`Catch-all, fired for every verified webhookEloquent Model
--------------

[](#eloquent-model)

`MalipopayPayment` stores every payment made through the package.

```
use Malipopay\Laravel\Models\MalipopayPayment;

$pending = MalipopayPayment::pending()->count();
$completed = MalipopayPayment::completed()->whereDate('created_at', today())->sum('amount');
$payment = MalipopayPayment::where('reference', 'PAY-123')->first();

if ($payment->isCompleted()) {
    // ...
}
```

Blade Directives
----------------

[](#blade-directives)

```
{{-- Insert a checkout button --}}
@malipopayCheckout(['amount' => 10000, 'phone' => '255712345678', 'description' => 'Order #1234'])

{{-- Format an amount --}}
@malipopayAmount(10000)        {{-- TZS 10,000 --}}
@malipopayAmount(10000, 'USD') {{-- USD 10,000 --}}
```

Artisan Commands
----------------

[](#artisan-commands)

```
# Install config and migrations
php artisan malipopay:install

# Send a test payment (use UAT)
php artisan malipopay:test 255712345678 --amount=100 --description="Test"
```

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

[](#configuration)

After publishing the config file (`config/malipopay.php`), you can customize:

- API key and environment
- Timeout and retry behavior
- Webhook path, signature header, and event storage
- Which Eloquent model to use (extend `MalipopayPayment`)
- Whether to auto-register webhook routes

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

[](#requirements)

- PHP 8.1+
- Laravel 10, 11, or 12
- Malipopay API key ([get one here](https://app.malipopay.co.tz))

License
-------

[](#license)

MIT

---

See Also
--------

[](#see-also)

SDKInstall[Laravel (this package)](https://github.com/Malipopay/malipopay-laravel)`composer require malipopay/laravel`[PHP (raw SDK)](https://github.com/Malipopay/malipopay-php)`composer require malipopay/malipopay-php`[Node.js](https://github.com/Malipopay/malipopay-node)`npm install malipopay`[Python](https://github.com/Malipopay/malipopay-python)`pip install malipopay`[Java](https://github.com/Malipopay/malipopay-java)Maven / Gradle[.NET](https://github.com/Malipopay/malipopay-dotnet)`dotnet add package Malipopay`[Ruby](https://github.com/Malipopay/malipopay-ruby)`gem install malipopay`[Flutter/Dart](https://github.com/Malipopay/malipopay-flutter)`flutter pub add malipopay`[React](https://github.com/Malipopay/malipopay-react)`npm install @malipopay/react`[API Reference](https://developers.malipopay.co.tz) | [OpenAPI Spec](https://github.com/Malipopay/malipopay-openapi)

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance90

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

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

Unknown

Total

1

Last Release

49d ago

### Community

Maintainers

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

---

Top Contributors

[![mwakatumbula](https://avatars.githubusercontent.com/u/21016136?v=4)](https://github.com/mwakatumbula "mwakatumbula (1 commits)")

---

Tags

laravelpaymentpayment gatewaympesamobile-moneytanzaniafintechmalipopay

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/malipopay-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/malipopay-laravel/health.svg)](https://phpackages.com/packages/malipopay-laravel)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

59156.3k10](/packages/api-platform-laravel)

PHPackages © 2026

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