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

ActiveLibrary[Payment Processing](/categories/payments)

matscode/paystack-laravel-sdk
=============================

A Laravel package for seamless Paystack integration, built on top of matscode/paystack-php-sdk.

v1.0.0(11mo ago)168↓100%MITPHPPHP &gt;=8.0

Since May 22Pushed 11mo ago1 watchersCompare

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

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Paystack Laravel SDK
====================

[](#paystack-laravel-sdk)

A modern, maintainable, and extensible Paystack integration for Laravel, built on top of the [matscode/paystack-php-sdk](https://packagist.org/packages/matscode/paystack-php-sdk). Feel free to reference the main SDK to see other available api method/property

---

Features
--------

[](#features)

- Clean, service-based Paystack API integration
- Laravel service provider and facade
- Global `paystack()` helper for convenient access
- Uses [matscode/paystack-php-sdk](https://packagist.org/packages/matscode/paystack-php-sdk) under the hood
- Configurable via `config/paystack.php`
- Well-documented

---

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

[](#requirements)

- PHP 8.0+
- Laravel 9.0+
- [matscode/paystack-php-sdk](https://packagist.org/packages/matscode/paystack-php-sdk) (installed automatically)

---

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

[](#installation)

Install via Composer:

```
composer require matscode/paystack-laravel-sdk
```

---

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

[](#configuration)

Optionally, publish the config file:

```
php artisan vendor:publish --provider="Matscode\\PaystackLaravel\\PaystackServiceProvider" --tag="config"
```

Set your Paystack secret key in your `.env` file:

```
PAYSTACK_SECRET_KEY=sk_test_xxxxxxxxxxxxxxxxxxxxxxxx
```

---

Usage
-----

[](#usage)

You can use the Paystack SDK in Laravel via:

- The `Paystack` Facade (recommended)
- Dependency Injection (`Matscode\Paystack\Paystack`)
- The `paystack()` helper (just like `request()` or `auth()`)

> **Note:**
>
> Access StyleFacade (`Paystack`)DI (`app(...)`)Helper (`paystack()`)Method call✅ Yes✅ Yes✅ YesProperty access❌ No✅ Yes✅ Yes- For the Facade, you must use static method calls for resources, such as `Paystack::transaction()`. Property access like `Paystack::transaction` will **not** work.
> - For DI and the helper, both method calls (`->transaction()`) and property access (`->transaction`) are supported.
> - Always use the method call syntax for maximum compatibility.

---

### Transaction Resource

[](#transaction-resource)

#### Initialize Transaction

[](#initialize-transaction)

Initializes a new transaction and returns an authorization URL for the customer to complete payment. The response contains the transaction reference and other details.

```
// Using the Facade
Paystack::transaction()->initialize([
    'email' => 'customer@email.com',
    'amount' => 500000, // amount in kobo
    'callback_url' => 'https://yourapp.com/paystack/transaction/verify',
]);

// Using the helper
paystack()->transaction->initialize([
    'email' => 'customer@email.com',
    'amount' => 500000, // amount in kobo
    'callback_url' => 'https://yourapp.com/paystack/transaction/verify',
]);
```

#### List Transactions

[](#list-transactions)

Retrieves a list of all transactions carried out on your Paystack account. Returns an array of transaction objects.

```
// Using the Facade
Paystack::transaction()->list();

// Using the helper
paystack()->transaction->list();
```

#### Verify Transaction

[](#verify-transaction)

Verifies the status of a transaction using its reference. Returns the transaction details if found.

```
// Using the Facade
$verification = Paystack::transaction()->verify($reference);

// Using the helper
$verification = paystack()->transaction->verify($reference);
```

#### Check if Transaction is Successful

[](#check-if-transaction-is-successful)

Checks if a transaction was successful using its reference. Returns `true` if successful, otherwise `false`.

```
// Using the Facade
$isSuccessful = Paystack::transaction()->isSuccessful($reference); // returns true/false

// Using the helper
$isSuccessful = paystack()->transaction->isSuccessful($reference);
```

Example: Initializing a Transaction with the Paystack Facade (Laravel)
----------------------------------------------------------------------

[](#example-initializing-a-transaction-with-the-paystack-facade-laravel)

You can use the Paystack facade with method chaining to initialize a transaction and get the payment authorization URL:

```
use Paystack; // Make sure the facade is properly registered

// ... inside your controller or service

$response = Paystack::transaction()
    ->setCallbackUrl('https://yourapp.com/paystack/verify')
    ->setEmail('customer@email.com')
    ->setAmount(75000) // amount in Naira
    ->initialize();

$authorizationUrl = $response->data->authorization_url;

// Using the helper
$response = paystack()->transaction
    ->setCallbackUrl('https://yourapp.com/paystack/verify')
    ->setEmail('customer@email.com')
    ->setAmount(75000)
    ->initialize();
$authorizationUrl = $response->data->authorization_url;
```

- `setCallbackUrl()` sets the URL Paystack will redirect to after payment.
- `setEmail()` sets the customer's email.
- `setAmount()` sets the amount (in Naira, not kobo, when using this method).
- `initialize()` sends the request to Paystack and returns the response.
- The authorization URL for redirecting the user is in `$response->data->authorization_url`.

If you want to use the array method (amount in kobo):

```
// Using the Facade
$response = Paystack::transaction()->initialize([
    'email' => 'customer@email.com',
    'amount' => 500000, // amount in kobo
    'callback_url' => 'https://yourapp.com/paystack/verify',
]);
$authorizationUrl = $response['data']['authorization_url'];

// Using the helper
$response = paystack()->transaction->initialize([
    'email' => 'customer@email.com',
    'amount' => 500000, // amount in kobo
    'callback_url' => 'https://yourapp.com/paystack/verify',
]);
$authorizationUrl = $response['data']['authorization_url'];
```

---

### Bank Resource

[](#bank-resource)

#### List Banks

[](#list-banks)

Retrieves a list of all supported banks for your Paystack account. Useful for populating bank selection dropdowns in forms.

```
// Using the Facade
Paystack::bank()->list();

// Using the helper
paystack()->bank->list();
```

#### Resolve Account Information

[](#resolve-account-information)

Resolves and validates a Nigerian bank account number and bank code. Returns the account name and other details if valid.

```
// Using the Facade
$account = Paystack::bank()->resolve($bankCode, $accountNumber);

// Using the helper
$account = paystack()->bank->resolve($bankCode, $accountNumber);
```

---

> **Note:** More resources (Customers, Plans, Subscription, Transfers, etc.) may be added as the SDK evolves. For the latest, see the [PHP SDK documentation](https://packagist.org/packages/matscode/paystack-php-sdk).

---

License
-------

[](#license)

This library is licensed under the GNU General Public License v3.0 (GPL-3.0). See the [LICENSE](./LICENSE) file for the full license text.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance54

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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

Unknown

Total

1

Last Release

351d ago

### Community

Maintainers

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

---

Top Contributors

[![matscode](https://avatars.githubusercontent.com/u/8417404?v=4)](https://github.com/matscode "matscode (6 commits)")

---

Tags

phplaravelsdkstripepaymentprocessorpaystack

### Embed Badge

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

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

###  Alternatives

[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)

PHPackages © 2026

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