# pstk/paystack-magento2-module

`composer require pstk/paystack-magento2-module`

Canonical URL: https://packagento.com/pstk/paystack-magento2-module

## At a glance

- **Vendor**: pstk (https://packagento.com/pstk.md)
- **Latest version**: 3.0.4 — released 2026-03-06
- **Pricing**: Free
- **Package type**: Magento 2 module
- **Status**: active, accepting new buyers

## Installation

Packagento is licence-gated, so even free packages need a licence on a project before Composer can resolve them.

1. **Sign in or create an account** at https://packagento.com/customer/account/.

2. **Add the package to your account.** Open https://packagento.com/pstk/paystack-magento2-module and complete the free checkout. A licence is minted automatically.

3. **Create or pick a project, then activate the licence on it.**
   - Projects represent the Magento installs you deploy to. Manage them at https://packagento.com/projects/.
   - Activate the new licence on the project you'll deploy this package to. Activation is what generates the Composer credentials scoped to that project.

4. **Add the project credentials to your Magento codebase.**

   Grab the project's public + private key from https://packagento.com/projects/ (open the project, then its Credentials tab), and add them to `auth.json`:

   ```json
   {
     "http-basic": {
       "packagento.com": {
         "username": "ppk_live_...",
         "password": "psk_live_..."
       }
     }
   }
   ```

   Add the Packagento Composer repository to `composer.json`:

   ```json
   {
     "repositories": [
       { "type": "composer", "url": "https://packagento.com" }
     ]
   }
   ```

5. **Install and apply.**

   ```bash
   composer require pstk/paystack-magento2-module:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## README

[![Latest Version on Packagist][ico-version]][link-packagist]
[![Software License][ico-license]](LICENSE)
[![Total Downloads][ico-downloads]][link-downloads]

### Paystack Magento 2 Module

Paystack payment gateway Magento2 extension

**Version:** 3.0.4 (Paystack v2 Inline.js API)

### Requirements

- Magento 2.4.x
- PHP 8.2+

### Installation

#### Composer (Recommended)

Go to your Magento2 root folder and run:

```bash
composer require pstk/paystack-magento2-module
php bin/magento module:enable Pstk_Paystack
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento cache:flush
```

#### Manual Installation

Copy all files to `app/code/Pstk/Paystack/` in your Magento installation, then run:

```bash
php bin/magento module:enable Pstk_Paystack
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento cache:flush
```

### Configuration

To configure the plugin in *Magento Admin*:
1. Go to **Stores > Configuration > Sales > Payment Methods**.
2. Find **Paystack** and configure:
	- **Enabled**: Yes/No
	- **Title**: What customers see at checkout
	- **Integration Type**: Inline (Popup) or Redirect
	- **Test Mode**: Enable for sandbox testing
	- **Test/Live Secret Key**: Get from your [Paystack dashboard](https://dashboard.paystack.com/#/settings/developer)
	- **Test/Live Public Key**: Get from your [Paystack dashboard](https://dashboard.paystack.com/#/settings/developer)
3. Click **Save Config**.

#### Webhook Setup

For reliable payment confirmation (especially for the redirect flow), set up a webhook in your Paystack dashboard:

1. Go to **Settings > API Keys & Webhooks** on your [Paystack dashboard](https://dashboard.paystack.com/#/settings/developer)
2. Set the Webhook URL to: `https://yourdomain.com/paystack/payment/webhook`
3. The module handles `charge.success` events and automatically updates order status

### Development Environment

A Docker-based development environment is included in the `dev/` directory for contributors and testing.

#### Prerequisites

- [Docker](https://www.docker.com/) (or [Rancher Desktop](https://rancherdesktop.io/) with `dockerd` runtime)
- A [Paystack test account](https://dashboard.paystack.com/#/signup)

#### Quick Start

```bash
cd dev
cp .env.example .env     # Add your Paystack test keys
docker compose up -d      # First run builds the image (~5 min) and installs Magento (~3 min)
bash setup.sh             # Enables module, creates test products, configures everything
```

Once complete you'll see:

```
============================================
  Setup complete!

  Storefront:  http://localhost:8080
  Admin panel: http://localhost:8080/admin
  Admin login: admin / Admin12345!

  Test card:   4084 0840 8408 4081
  Expiry:      12/30
  CVV:         408
  PIN:         0000
  OTP:         123456
============================================
```

#### What's Included

- **Magento 2.4.8-p3** via [Mage-OS](https://mage-os.org/) public mirror (no Adobe marketplace auth needed)
- **OpenSearch 2.19.1** + **MariaDB 10.6**
- **5 test products** with images and a configured homepage
- **Paystack payment** pre-configured in test mode (inline popup)
- Container names: `paystack-magento`, `paystack-db`, `paystack-search`

#### Tear Down

```bash
cd dev
docker compose down        # Stop containers (preserves data)
docker compose down -v     # Stop containers and delete all data
```

### Documentation

* [Paystack Documentation](https://developers.paystack.co/v2.0/docs/)
* [Paystack Helpdesk](https://paystack.com/help)

### Support

For bug reports and feature requests directly related to this plugin, please use the [issue tracker](https://github.com/PaystackHQ/plugin-magento-2/issues).

For general support or questions about your Paystack account, you can reach out by sending a message from [our website](https://paystack.com/contact).

### Community

If you are a developer, please join our Developer Community on [Slack](https://slack.paystack.com).

### Contributing to the Magento 2 plugin

If you have a patch or have stumbled upon an issue with the Magento 2 plugin, you can contribute this back to the code. Please read our [contributor guidelines](https://github.com/PaystackHQ/plugin-magento-2/blob/master/CONTRIBUTING.md) for more information how you can do this.

[ico-version]: https://img.shields.io/packagist/v/pstk/paystack-magento2-module.svg?style=flat-square
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
[ico-downloads]: https://img.shields.io/packagist/dt/pstk/paystack-magento2-module.svg?style=flat-square

[link-packagist]: https://packagist.org/packages/pstk/paystack-magento2-module
[link-downloads]: https://packagist.org/packages/pstk/paystack-magento2-module

## Recent Versions

| Version | Released |
|---|---|
| 3.0.4 | 2026-03-06 |
| 3.0.3 | 2026-02-27 |
| 3.0.2 | 2026-02-26 |
| 3.0.1 | 2026-02-25 |
| 3.0.0 | 2026-02-17 |
| 2.5.0 | 2025-11-25 |
| 2.4.1 | 2020-02-25 |
| 2.3.5 | 2019-12-11 |
| v2.0.0 | 2019-05-31 |
| v1.0.2 | 2019-02-05 |

Showing 10 of 23 versions. Full release history on https://packagento.com/pstk/paystack-magento2-module.

## Quality

Latest release (3.0.4) fails the Packagento QA pipeline. Verdicts below are per-cell (Magento line × PHP version) for the matrixed tools, and run-once for the static / security tiers.


### Compatibility

Each Magento line is installed on its supported PHP versions, then the module is built (DI compile + static-content deploy). Cells show passed / failed / untested; staircase gaps render as `–`.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Pass | Pass | – | – |
| 2.4.8 | – | Pass | Pass | – |
| 2.4.9 | – | – | Pass | Pass |


### Code Quality

Advisory checks against the module's source. Never affect the Compatibility verdict — a phpcs finding can't make a module incompatible.

#### Static Analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Fail | 163 | 12 errors, 151 warnings (ruleset: Magento2) — 93 auto-fixable with phpcbf |
| PHPMD | Warning | 2 | 2 rule violations (CyclomaticComplexity:1, UnusedFormalParameter:1) |
| Cpd | Pass | 0 |  |
| Composer validate | Info | 1 | valid; 1 advisory note (composer validate --strict) |

#### PHPStan

Type-checks the module against a real Magento install. Re-runs per Magento + PHP version because resolvable symbols differ between releases.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | 16 | 16 | – | – |
| 2.4.8 | – | 16 | 16 | – |
| 2.4.9 | – | – | 16 | 16 |


### Tests

Unit and integration suites run per Magento + PHP cell. Test failures speak to the module's behaviour, not its compatibility with a line, so they're reported here separately.

#### Unit Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |

#### Integration Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |


### Security

Dependency-advisory audit (composer audit) plus a source malware scan. A malware detection fails the version outright.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| Composer audit | Pass | 0 |  |
| Malware scan | Pass | 0 |  |

## Licence and pricing

Free. A licence is still minted on checkout and bound to your project for Composer access — no payment step.

Refundable within 14 days of first purchase via https://packagento.com/account/refunds/.

## Install via Claude Code or any MCP client

The Packagento MCP server can run the licence + project + Composer steps above in one tool call:

```
purchase_and_install_packages(
  composer_names=["pstk/paystack-magento2-module"],
  project_id="proj_xxx"
)
```

This handles cart, checkout, licence minting, project activation, and writes auth.json credentials. Connect a client with `claude mcp add packagento https://mcp.packagento.com`. Full setup at https://packagento.com/docs/mcp-setup.

## Vendor

pstk is a Magento 2 vendor on Packagento. See https://packagento.com/pstk.md for their full catalogue.

