PHPackages                             starfolksoftware/paystack-php - 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. starfolksoftware/paystack-php

ActiveLibrary[Payment Processing](/categories/payments)

starfolksoftware/paystack-php
=============================

A PHP library to conveniently access the Paystack API from applications written in the PHP language.

v2.0.1(5mo ago)21.2k↓62.4%1MITPHPPHP ^8.2CI passing

Since Jan 25Pushed 5mo ago1 watchersCompare

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

READMEChangelog (9)Dependencies (13)Versions (11)Used By (1)

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

[](#paystack-php-sdk)

[![Latest Stable Version](https://camo.githubusercontent.com/3117a3407af2df3fb857fb243667e314374f414e91ebb0834ea3ecd7d7a4b30f/687474703a2f2f706f7365722e707567782e6f72672f73746172666f6c6b736f6674776172652f706179737461636b2d7068702f76)](https://packagist.org/packages/starfolksoftware/paystack-php) [![Total Downloads](https://camo.githubusercontent.com/0a7292a3a963b18751878a8aa59e7e833e8e58c2206120880b4f9fa59e2420b5/687474703a2f2f706f7365722e707567782e6f72672f73746172666f6c6b736f6674776172652f706179737461636b2d7068702f646f776e6c6f616473)](https://packagist.org/packages/starfolksoftware/paystack-php) [![License](https://camo.githubusercontent.com/cd68809fa1dccbab4cde73654f1517a4df58f5c0589cf07dc22bc421a662ca8b/687474703a2f2f706f7365722e707567782e6f72672f73746172666f6c6b736f6674776172652f706179737461636b2d7068702f6c6963656e7365)](https://packagist.org/packages/starfolksoftware/paystack-php) [![PHP Version Require](https://camo.githubusercontent.com/86e75f130af51364ae1c8ca4020179f4badd184dcc02b48fcc97314164de959e/687474703a2f2f706f7365722e707567782e6f72672f73746172666f6c6b736f6674776172652f706179737461636b2d7068702f726571756972652f706870)](https://packagist.org/packages/starfolksoftware/paystack-php)

A modern, developer-friendly PHP SDK for the [Paystack API](https://paystack.com/docs/api/). This library provides convenient access to Paystack's payment infrastructure from applications written in PHP. It includes a comprehensive set of classes for all API resources with full type safety and automatic parameter validation.

Features
--------

[](#features)

- ✅ **Complete API Coverage** - All Paystack API endpoints supported
- ✅ **Type Safety** - Full PHP 8.2+ type declarations
- ✅ **Parameter Validation** - Automatic validation of API parameters
- ✅ **PSR-18 HTTP Client** - Compatible with any PSR-18 HTTP client
- ✅ **Comprehensive Examples** - Detailed usage examples for all features
- ✅ **Exception Handling** - Detailed error responses and exception handling
- ✅ **Modern PHP** - Built for PHP 8.2+ with modern coding standards

Quick Links
-----------

[](#quick-links)

- [Getting Started Guide](docs/getting-started.md)
- [API Reference](docs/api-reference.md)
- [Examples](examples/)
- [Advanced Usage](docs/advanced-usage.md)
- [Troubleshooting](docs/troubleshooting.md)
- [Upgrade Guide (v1.x → v2.x)](UPGRADE.md)

Table of Contents
-----------------

[](#table-of-contents)

- [Requirements](#requirements)
- [Installation](#installation)
- [Authentication](#authentication)
- [Quick Start](#quick-start)
- [Available Resources](#available-resources)
- [Usage Examples](#usage-examples)
    - [Transactions](#transactions)
    - [Customers](#customers)
    - [Payment Requests](#payment-requests)
    - [Subscriptions](#subscriptions)
- [Error Handling](#error-handling)
- [Testing](#testing)
- [Contributing](#contributing)
- [Support](#support)

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

[](#requirements)

- **PHP 8.2 or higher**
- **PSR-18 HTTP Client** (any implementation)
- **Composer** for dependency management

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

[](#installation)

### Using Composer

[](#using-composer)

Install the SDK using Composer:

```
composer require starfolksoftware/paystack-php
```

### Install HTTP Client

[](#install-http-client)

This package requires a PSR-18 HTTP client. If you don't have one installed, we recommend Guzzle:

```
composer require php-http/guzzle7-adapter
```

Alternatively, you can use any PSR-18 compatible client:

```
# Symfony HTTP Client
composer require symfony/http-client

# cURL client
composer require php-http/curl-client

# Mock client (for testing)
composer require php-http/mock-client
```

### Autoloading

[](#autoloading)

Include Composer's autoloader in your project:

```
