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

ActiveLibrary[Payment Processing](/categories/payments)

faridibin/paystack-laravel
==========================

A Laravel wrapper for faridibin/paystack-php with first-class Laravel features including facades, config files, database migrations, and webhook handling. Provides seamless integration of Paystack payment processing in Laravel applications.

v0.2.0(2mo ago)0299MITPHPPHP ^8.2CI passing

Since Dec 10Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/faridibin/paystack-laravel)[ Packagist](https://packagist.org/packages/faridibin/paystack-laravel)[ RSS](/packages/faridibin-paystack-laravel/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)Dependencies (8)Versions (15)Used By (0)

Paystack Laravel
================

[](#paystack-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/4b2fef016f089749fd3d02ebba66afd41f57e928643c01aa869cdaaa408ffac8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f66617269646962696e2f706179737461636b2d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/faridibin/paystack-laravel)[![Total Downloads](https://camo.githubusercontent.com/0d74ad3f5a8eb17901473f8e7b59892ddc90477c278d3463fcbd94836e9061a6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f66617269646962696e2f706179737461636b2d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/faridibin/paystack-laravel)[![License](https://camo.githubusercontent.com/fcfceffb2d8e8f3702260e460f1e4e6325375b3361c15f4280d98f22408dbd7c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f66617269646962696e2f706179737461636b2d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/faridibin/paystack-laravel)

A Laravel wrapper for [faridibin/paystack-php](https://github.com/faridibin/paystack-php) with service provider, facade, webhook handling, and event dispatching.

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

[](#requirements)

- PHP 8.2+
- Laravel 11+

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

[](#installation)

```
composer require faridibin/paystack-laravel
```

The service provider is auto-discovered — no manual registration needed.

### Publish Configuration

[](#publish-configuration)

```
php artisan vendor:publish --tag=paystack-config
```

This creates `config/paystack.php` in your application.

### Environment Variables

[](#environment-variables)

Add your Paystack secret key to `.env`:

```
PAYSTACK_SECRET_KEY=sk_test_your_secret_key_here
PAYSTACK_CURRENCY=NGN
```

Usage
-----

[](#usage)

### Facade

[](#facade)

```
use Faridibin\PaystackLaravel\Facades\Paystack;

// Initialize a transaction
$response = Paystack::transactions()->initialize(amount: 50000, email: 'customer@example.com');
$authUrl  = $response->getData()->authorization_url;

// Verify a transaction
Paystack::transactions()->verify('ref_abc123');

// Create a customer
Paystack::customers()->create([
    'email'      => 'john@example.com',
    'first_name' => 'John',
    'last_name'  => 'Doe',
]);

// Create a plan
Paystack::plans()->create('Monthly', amount: 10000, interval: 'monthly');

// Initiate a transfer (reference must be unique per request — required for idempotency)
Paystack::transfers()->initiateTransfer(
    amount:    5000,
    recipient: 'RCP_xxx',
    reference: 'salary_2026_04_15',
    optional:  ['reason' => 'Salary'],
);
```

### Available Services

[](#available-services)

#### Commerce

[](#commerce)

Facade callService`Paystack::products()`Products`Paystack::paymentPages()`Payment Pages#### Payments

[](#payments)

Facade callService`Paystack::transactions()`Transactions`Paystack::splits()`Transaction Splits`Paystack::customers()`Customers`Paystack::charge()`Charge`Paystack::bulkCharges()`Bulk Charges`Paystack::refunds()`Refunds`Paystack::subaccounts()`Subaccounts`Paystack::disputes()`Disputes`Paystack::settlements()`Settlements`Paystack::paymentRequests()`Payment Requests`Paystack::dedicatedAccount()`Dedicated Accounts`Paystack::terminal()`Terminal`Paystack::applepay()`Apple Pay#### Recurring

[](#recurring)

Facade callService`Paystack::plans()`Plans`Paystack::subscriptions()`Subscriptions#### Transfers

[](#transfers)

Facade callService`Paystack::transfers()`Transfers`Paystack::recipients()`Transfer Recipients`Paystack::control()`Transfer Control#### Other

[](#other)

Facade callService`Paystack::integration()`Integration`Paystack::verification()`Verification`Paystack::miscellaneous()`Miscellaneous`Paystack::balance()`Balance`Paystack::directDebit()`Direct Debit`Paystack::virtualTerminal()`Virtual Terminal`Paystack::storefront()`Storefront`Paystack::order()`OrderService Configuration
---------------------

[](#service-configuration)

Enable only the services you need in `config/paystack.php`:

```
use Faridibin\PaystackLaravel\PaystackServices;

'services' => [
    PaystackServices::payments([
        'transactions' => true,
        'customers'    => true,
        'refunds'      => true,
    ]),
    PaystackServices::recurring([
        'plans'         => true,
        'subscriptions' => true,
    ]),
    PaystackServices::transfers([
        'transfers'  => true,
        'recipients' => true,
    ]),
    PaystackServices::miscellaneous(),
],
```

Calling a group method with no arguments enables all services in that group:

```
PaystackServices::payments()  // enables all payment services
PaystackServices::transfers() // enables all transfer services
```

Webhook Handling
----------------

[](#webhook-handling)

### Endpoint

[](#endpoint)

The package registers a webhook route automatically:

```
POST /paystack/webhook

```

Incoming requests are validated against the `X-Paystack-Signature` header and the caller's IP address (Paystack's published IP whitelist) before any event is dispatched.

### Events

[](#events)

Every valid webhook dispatches `WebhookReceived`. If a specific handler exists on the controller, `WebhookHandled` is also dispatched after it runs.

```
use Faridibin\PaystackLaravel\Events\WebhookReceived;
use Faridibin\PaystackLaravel\Events\WebhookHandled;

// Fired for every valid webhook
Event::listen(WebhookReceived::class, function (WebhookReceived $event) {
    // $event->event  → WebhookEvent enum case
    // $event->data   → payload array
});

Event::listen(WebhookHandled::class, function (WebhookHandled $event) {
    // fired after a specific handler ran
});
```

### Specific webhook events

[](#specific-webhook-events)

The package ships a dedicated event class for every Paystack webhook type:

Event classPaystack event`ChargeSuccessEvent``charge.success``ChargeDisputeCreatedEvent``charge.dispute.create``ChargeDisputeRemindEvent``charge.dispute.remind``ChargeDisputeResolvedEvent``charge.dispute.resolve``TransferSucceededEvent``transfer.success``TransferFailedEvent``transfer.failed``TransferReversedEvent``transfer.reversed``SubscriptionCreatedEvent``subscription.create``SubscriptionDisabledEvent``subscription.disable``SubscriptionNotRenewedEvent``subscription.not_renew``SubscriptionExpiringCardsEvent``subscription.expiring_cards``InvoiceCreatedEvent``invoice.create``InvoiceUpdateEvent``invoice.update``InvoicePaymentFailedEvent``invoice.payment_failed``PaymentrequestPendingEvent``paymentrequest.pending``PaymentrequestSucceededEvent``paymentrequest.success``RefundProcessedEvent``refund.processed``RefundPendingEvent``refund.pending``RefundFailedEvent``refund.failed``RefundProcessingEvent``refund.processing``CustomeridentificationSuccessEvent``customeridentification.success``CustomeridentificationFailedEvent``customeridentification.failed``DedicatedaccountAssignSuccessEvent``dedicatedaccount.assign.success``DedicatedaccountAssignFailedEvent``dedicatedaccount.assign.failed````
use Faridibin\PaystackLaravel\Events\ChargeSuccessEvent;

Event::listen(ChargeSuccessEvent::class, function (ChargeSuccessEvent $event) {
    // $event->data — the webhook payload's data array
    $reference = $event->data['reference'];
    // fulfil the order...
});
```

### Custom webhook handling

[](#custom-webhook-handling)

Extend the webhook controller and add `on` methods. The method name is derived by converting the Paystack event to camel case (e.g. `charge.success` → `onChargeSuccess`):

```
namespace App\Http\Controllers;

use Faridibin\PaystackLaravel\Http\Controllers\WebhookController as BaseWebhookController;
use Symfony\Component\HttpFoundation\Response;

class PaystackWebhookController extends BaseWebhookController
{
    protected function onChargeSuccess(array $data): Response
    {
        // $data is the webhook payload's data array
        // update order status, send receipt, etc.
        return $this->successMethod();
    }

    protected function onTransferSuccess(array $data): Response
    {
        return $this->successMethod();
    }
}
```

Then register the route pointing to your controller in your application's `routes/web.php`:

```
Route::post('paystack/webhook', [PaystackWebhookController::class, 'handle'])
    ->middleware(\Faridibin\PaystackLaravel\Http\Middleware\ValidateWebhookSignature::class);
```

Routes
------

[](#routes)

MethodURIName`GET``/paystack/transaction/{id}``paystack.transaction.fetch``POST``/paystack/webhook``paystack.webhook.handle`Disable all routes:

```
'routes' => [
    'enabled' => false,
],
```

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

MIT

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance87

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Recently: every ~90 days

Total

13

Last Release

63d ago

PHP version history (2 changes)v0.1.0PHP ^8.0

v0.2.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/899013446321c5d8185df4d616c40b4a08a81017efd04c4b355df90da09197dd?d=identicon)[faridibin](/maintainers/faridibin)

---

Top Contributors

[![faridibin](https://avatars.githubusercontent.com/u/10797272?v=4)](https://github.com/faridibin "faridibin (82 commits)")

---

Tags

phplaravelpaystack

###  Code Quality

TestsPest

### Embed Badge

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

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

###  Alternatives

[linkxtr/laravel-qrcode

A clean, modern, and easy-to-use QR code generator for Laravel

3827.1k](/packages/linkxtr-laravel-qrcode)

PHPackages © 2026

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