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

ActiveLibrary[Payment Processing](/categories/payments)

paymish/paymish-laravel
=======================

Laravel package for Paymish payment gateway.

012PHP

Since Nov 17Pushed 5mo agoCompare

[ Source](https://github.com/Paymish-Open-Packages/paymish-laravel)[ Packagist](https://packagist.org/packages/paymish/paymish-laravel)[ RSS](/packages/paymish-paymish-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Paymish Laravel Package
=======================

[](#paymish-laravel-package)

A comprehensive Laravel package for integrating with the Paymish payment gateway API. This package provides a clean, Laravel-friendly interface to all Paymish API endpoints including payments, transfers, subaccounts, disputes, and more.

Features
--------

[](#features)

- ✅ **Complete API Coverage** - All Paymish API endpoints implemented
- ✅ **Laravel Integration** - Service provider, facades, and configuration
- ✅ **Webhook Support** - Built-in webhook handling with signature verification
- ✅ **Error Handling** - Comprehensive exception handling
- ✅ **Testing** - Full test suite with mocking support
- ✅ **File Uploads** - Support for dispute file uploads
- ✅ **Validation** - Built-in request validation
- ✅ **Caching** - Automatic token caching for performance

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

[](#installation)

Install the package via Composer:

```
composer require paymish/paymish-laravel
```

### Laravel Auto-Discovery

[](#laravel-auto-discovery)

The package will automatically register itself with Laravel 5.5+ via package auto-discovery.

For older versions of Laravel, add the service provider to your `config/app.php`:

```
'providers' => [
    // ...
    Paymish\PaymishServiceProvider::class,
],

'aliases' => [
    // ...
    'Paymish' => Paymish\Facades\Paymish::class,
],
```

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

[](#configuration)

Publish the configuration file:

```
php artisan vendor:publish --provider="Paymish\PaymishServiceProvider" --tag="config"
```

Add your Paymish credentials to your `.env` file:

```
PAYMISH_BASE_URL=https://production-api.paymish.com/api
PAYMISH_PUBLIC_KEY=your_public_key_here
PAYMISH_SECRET_KEY=your_secret_key_here
PAYMISH_WEBHOOK_SECRET=your_webhook_secret_here
PAYMISH_ENVIRONMENT=test
PAYMISH_CURRENCY=NGN
```

Usage
-----

[](#usage)

### Transaction Management

[](#transaction-management)

#### Initialize Payment

[](#initialize-payment)

```
use Paymish\Facades\Paymish;

$payment = Paymish::initializePayment([
    'email' => 'customer@example.com',
    'amount' => '10000',
    'currency' => 'NGN',
    'channels' => ['card', 'ussd', 'transfer'],
    'callback_url' => 'https://your-site.com/callback',
    'reference' => 'unique_reference_' . time()
]);
```

#### Verify Bank Account

[](#verify-bank-account)

```
$verification = Paymish::verifyBankAccount('999998', '0051762787');
```

#### Verify USSD Transaction

[](#verify-ussd-transaction)

```
$verification = Paymish::verifyUssdTransaction('24091010410290301050');
### Transfer Management

#### Get All Banks

```php
$banks = Paymish::getAllBanks();
```

#### Create Single Transfer

[](#create-single-transfer)

```
$transfer = Paymish::createSingleTransfer([
    'amount' => 1000,
    'bankCode' => '999998',
    'bankName' => 'Zenith Bank',
    'accountNumber' => '0051762787',
    'accountName' => 'John Doe',
    'emailAddress' => 'john@example.com',
    'transferNote' => 'Payment for services',
    'transferReference' => 'TXN_' . time()
]);
```

#### Submit Bulk Transfer

[](#submit-bulk-transfer)

```
$bulkTransfer = Paymish::submitBulkTransfer([
    'transfers' => [
        [
            'amount' => 1000,
            'bankCode' => '999998',
            'accountNumber' => '0051762787',
            'accountName' => 'John Doe'
        ],
        // ... more transfers
    ]
]);
```

#### Get Transfer List

[](#get-transfer-list)

```
$transfers = Paymish::getTransferList([
    'limit' => 10,
    'page' => 1,
    'status' => 'Successful'
]);
```

#### Get Account Balance

[](#get-account-balance)

```
$balance = Paymish::getBalance();
```

#### Get Transfer Details

[](#get-transfer-details)

```
$details = Paymish::getTransferDetails('TRF_oFSfpzznXEPkfgvaPECHxV43');
```

### Recipient Management

[](#recipient-management)

#### Get Recipient List

[](#get-recipient-list)

```
$recipients = Paymish::getRecipientList([
    'limit' => 10,
    'page' => 1,
    'status' => true
]);
```

#### Get Recipient Details

[](#get-recipient-details)

```
$recipient = Paymish::getRecipientDetails('RCP_9SEoJGbj9joXqecsntLNYE');
```

### Subaccount Management

[](#subaccount-management)

#### Create Subaccount

[](#create-subaccount)

```
$subaccount = Paymish::createSubaccount([
    'business_name' => 'Tech Corp',
    'settlement_bank' => '999998',
    'account_number' => '0051762787',
    'percentage_charge' => 5.0
]);
```

#### Get All Subaccounts

[](#get-all-subaccounts)

```
$subaccounts = Paymish::getAllSubaccounts([
    'limit' => 10,
    'page' => 1
]);
```

#### Get Subaccount Details

[](#get-subaccount-details)

```
$subaccount = Paymish::getSubaccount('ACCT_123456789');
```

#### Update Subaccount

[](#update-subaccount)

```
$updated = Paymish::updateSubaccount('ACCT_123456789', [
    'business_name' => 'Updated Corp Name',
    'percentage_charge' => 7.5
]);
```

#### Delete Subaccount

[](#delete-subaccount)

```
$deleted = Paymish::deleteSubaccount('ACCT_123456789');
```

### Split Page Management

[](#split-page-management)

#### Create Split Page

[](#create-split-page)

```
$splitPage = Paymish::createSplitPage([
    'name' => 'Revenue Split',
    'type' => 'percentage',
    'currency' => 'NGN',
    'bearer_type' => 'subaccount',
    'bearer_subaccount' => 'ACCT_123456789'
]);
```

#### Get All Split Pages

[](#get-all-split-pages)

```
$splitPages = Paymish::getAllSplitPages();
```

#### Get Split Page Details

[](#get-split-page-details)

```
$splitPage = Paymish::getSplitPage('SPL_123456789');
```

#### Add Subaccount to Split Page

[](#add-subaccount-to-split-page)

```
$result = Paymish::addSubaccountToSplitPage('SPL_123456789', [
    'subaccount' => 'ACCT_987654321',
    'share' => 30
]);
```

### Dispute Management

[](#dispute-management)

#### Create Dispute

[](#create-dispute)

```
$dispute = Paymish::createDispute([
    'transactionRef' => 'TXN_4HfVJ6nkANC57iPiVXtYLS',
    'disputeReason' => 'Unauthorized transaction',
    'disputeDescription' => 'Customer did not authorize this transaction'
], '/path/to/evidence/image.jpg'); // Optional file upload
```

#### Get Dispute List

[](#get-dispute-list)

```
$disputes = Paymish::getDisputeList([
    'limit' => 10,
    'page' => 1,
    'search' => 'TXN_4HfVJ6nkANC57iPiVXtYLS'
]);
```

#### Get Dispute Details

[](#get-dispute-details)

```
$dispute = Paymish::getDisputeDetails('TXN_4HfVJ6nkANC57iPiVXtYLS');
```

#### Update Dispute

[](#update-dispute)

```
$updated = Paymish::updateDispute([
    'transactionRef' => 'TXN_4HfVJ6nkANC57iPiVXtYLS',
    'disputeReason' => 'Updated reason',
    'disputeDescription' => 'Updated description'
]);
```

### Product Management

[](#product-management)

#### Verify Discount Code

[](#verify-discount-code)

```
$discount = Paymish::verifyDiscountCode('DISCOUNT2024');
```

Webhooks
--------

[](#webhooks)

The package includes built-in webhook handling. To set up webhooks:

1. **Add the webhook route** to your `routes/web.php`:

```
use Paymish\Controllers\WebhookController;

Route::post('/paymish/webhook', [WebhookController::class, 'handleWebhook'])
    ->name('paymish.webhook');
```

2. **Configure your webhook URL** in your Paymish dashboard:

    ```
    https://your-domain.com/paymish/webhook

    ```
3. **Handle webhook events** by listening to Laravel events:

```
// In your EventServiceProvider
protected $listen = [
    'paymish.charge.success' => [
        \App\Listeners\HandleSuccessfulPayment::class,
    ],
    'paymish.charge.failed' => [
        \App\Listeners\HandleFailedPayment::class,
    ],
    'paymish.transfer.success' => [
        \App\Listeners\HandleSuccessfulTransfer::class,
    ],
    // ... other events
];
```

### Supported Webhook Events

[](#supported-webhook-events)

- `paymish.charge.success` - Payment successful
- `paymish.charge.failed` - Payment failed
- `paymish.transfer.success` - Transfer successful
- `paymish.transfer.failed` - Transfer failed
- `paymish.dispute.created` - Dispute created
- `paymish.dispute.resolved` - Dispute resolved

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

[](#error-handling)

The package throws `PaymishException` for API errors:

```
use Paymish\Exceptions\PaymishException;

try {
    $payment = Paymish::initializePayment($data);
} catch (PaymishException $e) {
    // Handle the error
    $errorMessage = $e->getMessage();
    $statusCode = $e->getStatusCode();
    $response = $e->getResponse();
}
```

Testing
-------

[](#testing)

Run the test suite:

```
composer test
```

### Mocking in Tests

[](#mocking-in-tests)

```
use Paymish\Facades\Paymish;

// In your test
Paymish::shouldReceive('initializePayment')
    ->once()
    ->with($expectedData)
    ->andReturn($mockResponse);
```

Configuration Options
---------------------

[](#configuration-options)

All configuration options available in `config/paymish.php`:

```
return [
    'base_url' => env('PAYMISH_BASE_URL', 'https://production-api.paymish.com/api'),
    'public_key' => env('PAYMISH_PUBLIC_KEY'),
    'secret_key' => env('PAYMISH_SECRET_KEY'),
    'webhook_secret' => env('PAYMISH_WEBHOOK_SECRET'),
    'currency' => env('PAYMISH_CURRENCY', 'NGN'),
    'environment' => env('PAYMISH_ENVIRONMENT', 'test'),
    'timeout' => env('PAYMISH_TIMEOUT', 30),
    'cache_ttl' => env('PAYMISH_CACHE_TTL', 55),
    'logging' => [
        'enabled' => env('PAYMISH_LOGGING_ENABLED', false),
        'channel' => env('PAYMISH_LOG_CHANNEL', 'default'),
    ],
];
```

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

[](#requirements)

- PHP 8.0+
- Laravel 9.0+
- GuzzleHTTP 7.0+

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

[](#contributing)

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

License
-------

[](#license)

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

Support
-------

[](#support)

For support, please contact  or visit the [Paymish Documentation](https://docs.paymish.com).

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance48

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity13

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://www.gravatar.com/avatar/0f3140c3a94149a46fd800572a42d9ba0c89f2c0e256f9fa3f7b45bb5aa714ca?d=identicon)[Paymish](/maintainers/Paymish)

### Embed Badge

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

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

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

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