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)243MITPHPPHP ^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 1mo ago

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

32

—

LowBetter than 72% of packages

Maintenance39

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

526d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/aceb4d95b49984deff4a863e087d56dc280e639d4a6897bd351f05891b307dee?d=identicon)[Intuneteq](/maintainers/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

[lemonsqueezy/laravel

A package to easily integrate your Laravel application with Lemon Squeezy.

58596.1k](/packages/lemonsqueezy-laravel)[evryn/laravel-toman

A simple stable Laravel package to handle popular payment gateways in Iran including ZarinPal and IDPay.

1079.9k](/packages/evryn-laravel-toman)[buckaroo/sdk

Buckaroo payment SDK

12189.1k9](/packages/buckaroo-sdk)[tsaiyihua/laravel-linepay

linepay library for laravel

102.9k](/packages/tsaiyihua-laravel-linepay)[digikraaft/laravel-paystack-webhooks

Handle Paystack webhooks in a Laravel application

177.5k1](/packages/digikraaft-laravel-paystack-webhooks)[wandesnet/mercadopago-laravel

PHP SDK for integration with Mercado Pago

252.4k](/packages/wandesnet-mercadopago-laravel)

PHPackages © 2026

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