PHPackages                             fruitcakestudio/omnipay-pesapal - 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. fruitcakestudio/omnipay-pesapal

ActiveLibrary

fruitcakestudio/omnipay-pesapal
===============================

Pesapal Omnipay gateway

v1.0.0-alpha1(10y ago)266[1 issues](https://github.com/fruitcake/omnipay-pesapal/issues)MITPHPPHP &gt;=5.3.0

Since Jan 27Pushed 10y ago1 watchersCompare

[ Source](https://github.com/fruitcake/omnipay-pesapal)[ Packagist](https://packagist.org/packages/fruitcakestudio/omnipay-pesapal)[ Docs](https://github.com/fruitcakestudio/omnipay-pesapal)[ RSS](/packages/fruitcakestudio-omnipay-pesapal/feed)WikiDiscussions master Synced 2mo ago

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

Omnipay: Pesapal
================

[](#omnipay-pesapal)

**Skeleton gateway for the Omnipay PHP payment processing library**

[![Latest Version on Packagist](https://camo.githubusercontent.com/26344612afc07bdb4ab232a0902900820cd5c9a7c9a7760de2748bc0ad5fc5f2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f667275697463616b6573747564696f2f6f6d6e697061792d7065736170616c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/fruitcakestudio/omnipay-pesapal)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/9280674bf89b89b15c0b6f19e11c114fedbf9a1e268531911f64d7006ffdd5c9/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f667275697463616b6573747564696f2f6f6d6e697061792d7065736170616c2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/fruitcakestudio/omnipay-pesapal)[![Coverage Status](https://camo.githubusercontent.com/5a245489bc93d63d1289e6db4a6b7aba6676ae8833ed8403e01cb55fe0bdf1f7/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f667275697463616b6573747564696f2f6f6d6e697061792d7065736170616c2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/fruitcakestudio/omnipay-pesapal/code-structure)[![Quality Score](https://camo.githubusercontent.com/8ea1a2eb1f0c521e05429ac0d6a6d96b8fe1ce24c6d7dabb190a2840ea15bf9b/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f667275697463616b6573747564696f2f6f6d6e697061792d7065736170616c2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/fruitcakestudio/omnipay-pesapal)[![Total Downloads](https://camo.githubusercontent.com/4913a7b0f91577719f109283e0ec6e991e679488ddc28965795b5f9c5b63cdcc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f667275697463616b6573747564696f2f6f6d6e697061792d7065736170616c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/fruitcakestudio/omnipay-pesapal)

[Omnipay](https://github.com/thephpleague/omnipay) is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements pesapal support for Omnipay.

This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what PSRs you support to avoid any confusion with users and contributors.

Install
-------

[](#install)

Via Composer

```
$ composer require fruitcakestudio/omnipay-pesapal:"1.x@alpha"
```

Usage
-----

[](#usage)

The following gateways are provided by this package:

- Pesapal

For general usage instructions, please see the main [Omnipay](https://github.com/thephpleague/omnipay) repository.

Example
-------

[](#example)

bootstrap.php

```
require 'vendor/autoload.php';

$gateway = \Omnipay\Omnipay::create('Pesapal');
$gateway->initialize(array(
    'key' => 'your-consumer-key',
    'secret' => 'your-consumer-secret',
    'testMode' => false,
));
```

purchase.php

```
require 'bootstrap.php';

// Make a purchase request
$response = $gateway->purchase(array(
    'amount' => "6.84",
    'description' => "Testorder #1234",
    'currency' => 'USD',
    'card' => array(
        'email' => 'barry@fruitcakestudio.nl',
        'firstName' => 'Barry',
        'lastName' => 'vd. Heuvel',
        'phone' => '+1234567890',
    ),
    'returnUrl' => 'http://my-domain.com/return.php',
))->send();

$transactionId = $response->getTransactionId();

if ($response->isRedirect()) {
    // redirect to offsite payment gateway
    $response->redirect();
} else {
    // payment failed: display message to customer
    echo "Error " .$response->getCode() . ': ' . $response->getMessage();
}
```

return.php

```
require 'bootstrap.php';

// Check the payment status
$response = $gateway->completePurchase()->send();

// Show status to user
if ($response->isSuccessful()) {
    echo "Transaction '" . $response->getTransactionId() . "' succeeded!";
} else {
    echo "Status: " .$response->getCode() . ': ' . $response->getMessage();
}
```

notify.php

```
require 'bootstrap.php';

// Check the payment status
$response = $gateway->completePurchase()->send();

$reference = $response->getTransactionReference();  // TODO; Check the reference/id with your database
$transactionId = $response->getTransactionId();

if($response->isSuccessful()){
   // Save state
}

// Return message for the gateway
echo $response->getNotificationMessage();   // Or ->getNotificationResponse() for Symfony Response
```

The transactionReference is `pesapal_transaction_tracking_id`, which is set by Pesapal. The transactionId is your own id (`pesapal_merchant_reference`), which will be generated if not provided.

See the documentation on

### Sandbox / Demo

[](#sandbox--demo)

When you set `testMode` to `true`, the [Demo sandbox](http://demo.pesapal.com/) will be used.

You need a different consumer key/secret. Follow these steps to use the testMode:

- Create a *business* account on
- Login to your demo account, the key/secret are on the dashboard.
- Start a transaction and [send dummy money](http://demo.pesapal.com/MobileMoneyTest)
- Use the same phonenumber (eg. `700123456`) and amount. Copy the confirmation code after submitting.

Support
-------

[](#support)

If you are having general issues with Omnipay, we suggest posting on [Stack Overflow](http://stackoverflow.com/). Be sure to add the [omnipay tag](http://stackoverflow.com/questions/tagged/omnipay) so it can be easily found.

If you want to keep up to date with release anouncements, discuss ideas for the project, or ask more detailed questions, there is also a [mailing list](https://groups.google.com/forum/#!forum/omnipay) which you can subscribe to.

If you believe you have found a bug, please report it using the [GitHub issue tracker](https://github.com/fruitcakestudio/omnipay-pesapal/issues), or better yet, fork the library and submit a pull request.

Change log
----------

[](#change-log)

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

Testing
-------

[](#testing)

```
$ composer test
```

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)

- [Fruitcake](https://github.com/fruitcakestudio)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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

3759d ago

### Community

Maintainers

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

---

Top Contributors

[![barryvdh](https://avatars.githubusercontent.com/u/973269?v=4)](https://github.com/barryvdh "barryvdh (27 commits)")

---

Tags

omnipaypesapal

### Embed Badge

![Health badge](/badges/fruitcakestudio-omnipay-pesapal/health.svg)

```
[![Health](https://phpackages.com/badges/fruitcakestudio-omnipay-pesapal/health.svg)](https://phpackages.com/packages/fruitcakestudio-omnipay-pesapal)
```

###  Alternatives

[silverstripe/silverstripe-omnipay

SilverStripe Omnipay Payment Module

38106.0k15](/packages/silverstripe-silverstripe-omnipay)

PHPackages © 2026

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