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

ActiveLibrary[Payment Processing](/categories/payments)

matscode/paystack-php-sdk
=========================

Paystack PHP SDK is for communicating with PAYSTACK API

v2.0.0(4y ago)612.5k↓22.7%1[3 issues](https://github.com/matscode/paystack-php-sdk/issues)1GPL-3.0PHP

Since Jun 27Pushed 3y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (4)Versions (8)Used By (1)

Paystack PHP SDK
================

[](#paystack-php-sdk)

[API Doc](https://matscode.github.io/paystack-php-sdk) | [Demo](https://github.com/matscode/paystack-php-sdk-sandbox)

Visit [matscode/paystack](https://github.com/matscode/paystack) for `v1.9.1` and below of this SDK

### Available resources

[](#available-resources)

- Transaction (`Initialize`, `List`, `Verify`)
- Bank (`List`, `Resolve account`)

### Resource roadmap

[](#resource-roadmap)

More resources would be added in time

- `Customers`
- `Plans`
- `Subscription`
- `Transfers`
- `others...`

This SDK communicates with [Paystack API](https://paystack.com/). You need to have a paystack merchant account and paystack secret key to use this SDK.

Development is actively ongoing while releases are Stable.
If you find a BUG/Security Issue, do be kind to open an issue or email [Me](mailto:matscode@gmail.com).

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

[](#requirements)

- GuzzleHttp

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

[](#installation)

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

```
require_once __DIR__ . "/vendor/autoload.php";
```

### Manual

[](#manual)

- Download the archive
- Extract into your project
- And lastly ```
    require_once __DIR__ . "/vendor/autoload.php";
    ```

Initialize Paystack SDK
-----------------------

[](#initialize-paystack-sdk)

```
use Matscode\Paystack\Paystack;

$paystackSecret = 'sk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
$Paystack = new Paystack($paystackSecret);
```

Transaction Resource
--------------------

[](#transaction-resource)

#### Initialize Charge

[](#initialize-charge)

```
$response = $Paystack->transaction->initialize([
            'email'  => 'customer.email@gmail.com',
            'amount' => 500000, // amount is in kobo
            'callback_url' => 'https://www.app.local/paystack/transaction/verify'
        ]);
```

OR

```
// Set data to post using this method
$response = $Paystack->transaction
            ->setCallbackUrl('https://www.app.local/paystack/transaction/verify')
            ->setEmail('customer.email@gmail.com')
            ->setAmount(75000) // amount is treated in Naira while using this setAmount() method
            ->initialize();
```

Now do a redirect to payment page (using authorization\_url)
Recommended to check if `authorization_url` is set, and save your transaction reference code. useful to verify Transaction status

```
// recommend to save Transaction reference in database and do a redirect
header('Location: ' . $response->data->authorization_url);
```

#### Verifying Transaction

[](#verifying-transaction)

```
$reference_code = $_GET['reference']
$response = $Paystack->transaction->verify($reference_code);
```

OR

```
// This method does the check for you and return `(bool) true|false`
$response = $Paystack->transaction->isSuccessful($reference_code);
```

Bank Resource
-------------

[](#bank-resource)

#### Get list of banks

[](#get-list-of-banks)

```
$response = $Paystack->bank->list();
```

#### Resolve account info

[](#resolve-account-info)

```
$bank_code='0000';
$account_number='0987654321'
$response = $Paystack->bank->resolve($bank_code, $account_number);
//result: returns account information is found, throws exception otherwise
```

### Contact

[](#contact)

[Personal Home](https://inndex.page/matscode) | [Email](mailto:matscode@gmail.com)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity68

Established project with proven stability

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

Total

5

Last Release

1460d ago

Major Versions

v1.9.1 → v2.0.02022-05-19

### 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 (58 commits)")

---

Tags

payment-integrationpayment-processingpayment-processorpaystackpaystack-apipaystack-librarypaystack-phppaystack-php-sdkpaystack-sdkpaystack-wrapperphpstripetransactionphpsdkstripepaymentprocessorpaystack

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[yandex-money/yandex-money-sdk-php

Yandex.Money API SDK for PHP

105167.4k2](/packages/yandex-money-yandex-money-sdk-php)[cryptonator/merchant-php-sdk

Cryptonator.com Merchant API SDK for PHP

2713.7k](/packages/cryptonator-merchant-php-sdk)

PHPackages © 2026

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