PHPackages                             malipo-one/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. malipo-one/php-sdk

ActiveLibrary[Payment Processing](/categories/payments)

malipo-one/php-sdk
==================

Official PHP SDK for the Malipo One payments API — mobile money collection, payment links, refunds and balances for Tanzania.

00PHP

Since Jun 20Pushed todayCompare

[ Source](https://github.com/bridging-technologies/malipo-one)[ Packagist](https://packagist.org/packages/malipo-one/php-sdk)[ RSS](/packages/malipo-one-php-sdk/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Malipo One PHP SDK
==================

[](#malipo-one-php-sdk)

Official PHP client for the [Malipo One](https://malipo.one) payments API — mobile money collection, payment links, refunds and balances for Tanzania.

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

[](#requirements)

- PHP 8.1+
- Composer

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

[](#installation)

```
composer require malipo-one/php-sdk
```

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

[](#quick-start)

```
use MalipoOne\Client;

$malipo = new Client(
    clientId:     'your-client-id',
    clientSecret: 'your-client-secret',
);
```

Tokens are fetched and cached automatically. You never call `/oauth/token` yourself.

---

Payment Links
-------------

[](#payment-links)

Create a hosted payment page and share the URL with your customer:

```
// Fixed-amount link (single payment, auto-closes after paid)
$link = $malipo->paymentLinks()->create([
    'title'       => 'Invoice #1234',
    'amount'      => 50000,
    'business_id' => 12,           // optional — auto-creates invoice
    'description' => 'Web design services',
    'expires_at'  => '2026-12-31T23:59:59+03:00',
]);

echo $link['data']['url'];        // https://malipo.one/pay/ABCD1234
echo $link['data']['reference'];  // ABCD1234
echo $link['data']['invoice_created']; // true

// Open-amount donation link (stays open for multiple payments)
$link = $malipo->paymentLinks()->create([
    'title'        => 'Donate to Our Cause',
    'payment_mode' => 'multiple',
]);

// Retrieve a link by reference
$link = $malipo->paymentLinks()->get('ABCD1234');
```

---

Payments (USSD Push)
--------------------

[](#payments-ussd-push)

Send a payment prompt directly to a customer's phone:

```
use Ramsey\Uuid\Uuid;

$payment = $malipo->payments()->initiate(
    params: [
        'amount'    => 50000,
        'currency'  => 'TZS',
        'phone'     => '+255700000001',
        'reference' => 'INV-2025-001',
        'operator'  => 'MPESA',         // MPESA | TIGOPESA | HALOPESA | AIRTEL | CRDB
    ],
    idempotencyKey: Uuid::uuid4()->toString()
);

// Poll until status changes from pending
$payment = $malipo->payments()->get($payment['data']['id']);
echo $payment['data']['status']; // pending | success | failed

// List payments
$payments = $malipo->payments()->list(['status' => 'SUCCESS', 'per_page' => 10]);
```

---

Refunds
-------

[](#refunds)

```
use Ramsey\Uuid\Uuid;

$refund = $malipo->refunds()->create(
    params: [
        'payment_id' => '9d3c8b12-4e6a-4a1f-b2c3-1d2e3f4a5b6c',
        'reason'     => 'Customer requested cancellation.',
        'amount'     => 25000, // omit for full refund
    ],
    idempotencyKey: Uuid::uuid4()->toString()
);
```

---

Balance
-------

[](#balance)

```
$balance = $malipo->balance()->get();
```

---

Error Handling
--------------

[](#error-handling)

```
use MalipoOne\Exceptions\AuthenticationException;
use MalipoOne\Exceptions\MalipoOneException;
use MalipoOne\Exceptions\ValidationException;

try {
    $link = $malipo->paymentLinks()->create(['title' => 'Test']);
} catch (ValidationException $e) {
    // 422 — field-level errors
    foreach ($e->getFieldErrors() as $field => $messages) {
        echo "$field: " . implode(', ', $messages) . "\n";
    }
} catch (AuthenticationException $e) {
    // 401 — bad credentials or revoked client
    echo "Auth failed: " . $e->getMessage();
} catch (MalipoOneException $e) {
    // Everything else
    echo "API error {$e->getStatusCode()}: " . $e->getMessage();
}
```

---

Sandbox / Local Testing
-----------------------

[](#sandbox--local-testing)

```
$malipo = new Client(
    clientId:     'your-client-id',
    clientSecret: 'your-client-secret',
    baseUrl:      'http://localhost/malipo-one/public_html',
);
```

---

License
-------

[](#license)

MIT © [Malipo One](https://malipo.one)

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance65

Regular maintenance activity

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

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://avatars.githubusercontent.com/u/81463551?v=4)[Bridging Technologies](/maintainers/bridging-technologies)[@bridging-technologies](https://github.com/bridging-technologies)

### Embed Badge

![Health badge](/badges/malipo-one-php-sdk/health.svg)

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

###  Alternatives

[omnipay/coinbase

Coinbase driver for the Omnipay payment processing library

18570.2k1](/packages/omnipay-coinbase)[oxid-esales/amazon-pay-module

AmazonPay module for OXID

1824.3k](/packages/oxid-esales-amazon-pay-module)[yenepay/php-sdk

YenePay SDK for PHP

112.7k](/packages/yenepay-php-sdk)

PHPackages © 2026

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