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

ActiveLibrary[Payment Processing](/categories/payments)

intune/laravel-paystack
=======================

Utility API Layer for Paytstack Integration

1.0.7(1y ago)244MITPHPPHP ^8.2

Since Oct 16Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Intuneteq/Laravel-Paystack-Integration)[ Packagist](https://packagist.org/packages/intune/laravel-paystack)[ RSS](/packages/intune-laravel-paystack/feed)WikiDiscussions main Synced today

READMEChangelog (7)Dependencies (2)Versions (9)Used By (0)

Laravel Paystack Package
========================

[](#laravel-paystack-package)

A Laravel package for seamless integration with the Paystack payment gateway. This package provides various functionalities, including customer management, transaction initialization, subscription handling, and more.

Features
--------

[](#features)

- Create and manage customers on Paystack.
- Initialize transactions for purchases and subscriptions.
- Handle subscriptions: create, manage, enable, and disable.
- Validate account numbers and retrieve a list of banks.
- Initiate transfers and check balances.

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

[](#installation)

You can install the package via Composer:

```
composer require intune/laravel-paystack
```

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

[](#configuration)

After installation, publish the configuration file using the following command:

```
php artisan vendor:publish --provider="Intune/laravel-paystack\PaystackServiceProvider"
```

This will create a `paystack.php` file in your `config` directory, where you can set your Paystack API credentials:

```
return [
    'secret' => env('PAYSTACK_SECRET_KEY'),
    'plan_code' => env('PAYSTACK_PLAN_CODE'),
    'redirect_url' => env('PAYSTACK_REDIRECT_URL'),
    'white_list' => env('PAYSTACK_WHITE_LIST'),
];
```

Make sure to add the following environment variables to your `.env` file:

```
PAYSTACK_SECRET_KEY=your_paystack_secret_key
PAYSTACK_PLAN_CODE=your_paystack_plan_code
PAYSTACK_REDIRECT_URL=your_redirect_url
PAYSTACK_WHITE_LIST=your_white_list

```

Usage
-----

[](#usage)

### Creating a Customer

[](#creating-a-customer)

To create a new customer on Paystack:

```
use Intune\LaravelPaystack\Dtos\UserDto;
use Intune\LaravelPaystack\PaystackService;

$paystackService = app(PaystackService::class);

$userDto = UserDto::create([
    'email' => 'user@example.com',
    'first_name' => 'John',
    'last_name' => 'Doe',
    'phone_number' => '1234567890', // Optional
]);

$customer = $paystackService->createCustomer($userDto);
```

### Initializing a Transaction

[](#initializing-a-transaction)

To initialize a transaction:

```
$email = 'customer@example.com';
$amount = 1000; // Amount in kobo (1000 kobo = 10 NGN)

$dto = TransactionInitPayloadDto::create([
    'email' => $email,
    'amount' => $amount,
    // other transaction details
]);

$transaction = $paystackService->initializePurchaseTransaction($dto);
```

### Subscribing a Customer

[](#subscribing-a-customer)

To create a subscription for a customer:

```
$customer_id = 'customer_id_from_paystack';

$subscription = $paystackService->createSubscription($customer_id);
```

### Managing a Subscription

[](#managing-a-subscription)

To get a link for managing a subscription:

```
$subscription_id = 'subscription_id';

$manageLink = $paystackService->manageSubscription($subscription_id);
```

### Validating a Webhook

[](#validating-a-webhook)

To validate a Paystack webhook:

```
$payload = request()->getContent();
$signature = request()->header('x-paystack-signature');

if ($paystackService->isValidPaystackWebhook($payload, $signature)) {
    // Valid webhook
}
```

Available Methods
-----------------

[](#available-methods)

- `createCustomer(UserDto $user): CustomerDto`
- `fetchCustomer(string $email): ?CustomerDto`
- `initializePurchaseTransaction(TransactionInitPayloadDto $data): TransactionInitializationDto`
- `initializeSubscriptionTransaction(string $email, int $amount): TransactionInitializationDto`
- `createSubscription(string $customer_id): SubscriptionDto`
- `manageSubscription(string $subscription_id): string`
- `fetchSubscription(string $subscription_id): ?SubscriptionDto`
- `enableSubscription(string $subscription_id): bool`
- `disableSubscription(string $subscription_code): bool`
- `isValidPaystackWebhook($payload, $signature): bool`
- `fetchBanks(): ?Collection`
- `validateAccountNumber(string $account_number, string $bank_code): bool`
- `checkPTBalanceIsSufficient(int $amount): bool`
- `createTransferRecipient($name, $account_number, $bank_code): TransferRecipientDto`
- `initiateTransfer(string $amount, string $recipient_code, string $reference): TransferDto`

License
-------

[](#license)

This package is licensed under the MIT License. See the [LICENSE](LICENSE) file for more information.

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 79.4% 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 ~8 days

Recently: every ~13 days

Total

8

Last Release

572d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/97626624?v=4)[Olanitori Tobi](/maintainers/Intuneteq)[@Intuneteq](https://github.com/Intuneteq)

---

Top Contributors

[![Intuneteq](https://avatars.githubusercontent.com/u/97626624?v=4)](https://github.com/Intuneteq "Intuneteq (27 commits)")[![actions-user](https://avatars.githubusercontent.com/u/65916846?v=4)](https://github.com/actions-user "actions-user (7 commits)")

### Embed Badge

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

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

###  Alternatives

[backpack/crud

Quickly build admin interfaces using Laravel, Bootstrap and JavaScript.

3.4k3.7M223](/packages/backpack-crud)[statamic/cms

The Statamic CMS Core Package

4.8k3.6M986](/packages/statamic-cms)[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3416.9k](/packages/duncanmcclean-statamic-cargo)[glennraya/xendivel

A Laravel package to easily integrate Xendit payment gateway. It supports credit and debit cards, and e-wallet payments and custom invoices, queued notifications, webhook listeners and more.

442.7k](/packages/glennraya-xendivel)

PHPackages © 2026

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