PHPackages                             santosdave/pesawise-wrapper - 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. santosdave/pesawise-wrapper

ActiveLibrary[Payment Processing](/categories/payments)

santosdave/pesawise-wrapper
===========================

A Laravel package for integrating Pesawise payment gateway

v1.3.1(1y ago)160MITPHPPHP ^8.1

Since Sep 25Pushed 1y ago1 watchersCompare

[ Source](https://github.com/santosdave/pesawise-wrapper)[ Packagist](https://packagist.org/packages/santosdave/pesawise-wrapper)[ RSS](/packages/santosdave-pesawise-wrapper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (4)Versions (10)Used By (0)

Pesawise Laravel Wrapper
========================

[](#pesawise-laravel-wrapper)

A Laravel package for integrating the Pesawise payment gateway into your application.

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

[](#installation)

You can install the package via composer:

```
composer require santosdave/pesawise-wrapper
```

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

[](#configuration)

After installation, publish the config file:

```
php artisan vendor:publish --provider="Santosdave\PesawiseWrapper\PesawiseProvider"
```

This will create a `config/pesawise.php` file. Update your `.env` file with your Pesawise credentials:

```
PESAWISE_API_KEY=your_api_key
PESAWISE_API_SECRET=your_api_secret
PESAWISE_ENVIRONMENT=sandbox
PESAWISE_DEBUG=false
PESAWISE_DEFAULT_CURRENCY=KES
PESAWISE_DEFAULT_BALANCE_ID=your_default_balance_id

```

Usage
-----

[](#usage)

You can use the Pesawise facade or inject the Pesawise class into your controllers/services.

```
use Santosdave\PesawiseWrapper\Facades\Pesawise;

// Or inject in your constructor
use Santosdave\PesawiseWrapper\Pesawise;

public function __construct(Pesawise $pesawise)
{
    $this->pesawise = $pesawise;
}
```

### Using Dependency Injection

[](#using-dependency-injection)

```
use Santosdave\PesawiseWrapper\Pesawise;

class PaymentService
{
    protected $pesawise;

    public function __construct(Pesawise $pesawise)
    {
        $this->pesawise = $pesawise;
    }

    public function processPayment(array $paymentData)
    {
        return $this->pesawise->createDirectPayment($paymentData);
    }
}
```

### Available Methods

[](#available-methods)

#### Get All Supported Banks

[](#get-all-supported-banks)

```
$banks = Pesawise::getAllSupportedBanks();
```

#### Validate Bank Recipient

[](#validate-bank-recipient)

```
use Santosdave\PesawiseWrapper\Requests\BankRecipientValidationRequest;

$request = new BankRecipientValidationRequest(
    bankId: 1,
    bankAccountNumber: '1234567890'
);

$recipient = Pesawise::validateBankRecipient($request);
```

#### Create Bulk Payment

[](#create-bulk-payment)

```
use Santosdave\PesawiseWrapper\Requests\BulkPaymentRequest;
use Santosdave\PesawiseWrapper\DataTypes\Currency;
use Santosdave\PesawiseWrapper\DataTypes\BulkPayment;
use Santosdave\PesawiseWrapper\DataTypes\TransferType;

$bulkPayments = [
    new BulkPayment(
        amount: 1000,
        transferType: new TransferType(TransferType::BANK),
        reference: 'REF123',
        recipient: 'John Doe',
        bankId: 1,
        accountNumber: '1234567890'
    )
];

$request = new BulkPaymentRequest(
    balanceId: 1001002,
    currency: new Currency(Currency::KES),
    bulkPayments: $bulkPayments
);

$bulkPayment = Pesawise::createBulkPayment($request);
```

#### Create Payment Order

[](#create-payment-order)

```
$order = Pesawise::createPaymentOrder([
    'amount' => 1000,
    'customerName' => 'John Doe',
    'currency' => 'KES',
    'externalId' => 'ORDER123',
    'description' => 'Product purchase',
    'balanceId' => 1001002,
    'callbackUrl' => 'https://example.com/callback'
]);
```

#### Complete Payment

[](#complete-payment)

```
use Santosdave\PesawiseWrapper\Requests\CompletePaymentRequest;

$request = new CompletePaymentRequest(
    paymentId: 'payment_id_here',
    otp: '123456'
);

$payment = Pesawise::completePayment($request);
```

#### Create Direct Payment

[](#create-direct-payment)

```
$payment = Pesawise::createDirectPayment([
    'balanceId' => 1001002,
    'currency' => 'KES',
    'amount' => 1000,
    'transferType' => 'BANK',
    'reference' => 'REF123',
    'recipient' => 'John Doe',
    'bankId' => 1,
    'accountNumber' => '1234567890'
]);
```

For more methods and detailed usage, refer to the [Pesawise API documentation](https://docs.pesawise.com/docs/home).

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

[](#error-handling)

The package throws `PesawiseException` for API errors. You can catch and handle these exceptions in your application:

```
use Santosdave\PesawiseWrapper\Exceptions\PesawiseException;

try {
    $payment = Pesawise::createDirectPayment([...]);
} catch (PesawiseException $e) {
    $errorMessage = $e->getMessage();
    $errorCode = $e->getCode();
    $errorResponse = $e->getErrorResponse();
    // Handle the error
}
```

Testing
-------

[](#testing)

```
composer test
```

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email the author instead of using the issue tracker.

Credits
-------

[](#credits)

- [santosdave](https://github.com/santosdave)

License
-------

[](#license)

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

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity11

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 ~2 days

Total

9

Last Release

578d ago

### Community

Maintainers

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

---

Top Contributors

[![santosdave](https://avatars.githubusercontent.com/u/51959957?v=4)](https://github.com/santosdave "santosdave (10 commits)")

---

Tags

paymentssantosdavepesawise-wrapperpesawise

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/santosdave-pesawise-wrapper/health.svg)

```
[![Health](https://phpackages.com/badges/santosdave-pesawise-wrapper/health.svg)](https://phpackages.com/packages/santosdave-pesawise-wrapper)
```

###  Alternatives

[unicodeveloper/laravel-paystack

A Laravel Package for Paystack

650975.6k11](/packages/unicodeveloper-laravel-paystack)[chargebee/chargebee-php

ChargeBee API client implementation for PHP

768.0M9](/packages/chargebee-chargebee-php)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)[itsmurumba/laravel-mpesa

Laravel Package for Mpesa Daraja API

191.6k](/packages/itsmurumba-laravel-mpesa)

PHPackages © 2026

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