Download the PHP package kommandhub/paystack without Composer

On this page you can find all versions of the php package kommandhub/paystack. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package paystack

Paystack Payment for Shopware 6

License: Apache 2.0 Shopware PHP PHPStan

A production-grade Shopware 6 payment plugin that integrates the Paystack payment gateway, enabling merchants across Africa to accept secure online payments through cards, bank transfers, USSD, and mobile money.

Developed by Kommandhub Limited.

Independent integration. This is an independent, third-party plugin. It is not affiliated with, endorsed by, sponsored by, certified by, or officially supported by Paystack. "Paystack" and the Paystack logo are trademarks of their respective owner and are used here only to identify the payment gateway this plugin connects to. See Trademarks & Disclaimer.

This document is the technical reference for developers contributing to the plugin. If you only want to install and configure it on a live shop, the Configuration sections are enough.


Table of Contents


Project Overview

The plugin adds Paystack as a native Shopware 6 payment method. It handles the full payment lifecycle:

  1. Initialize a Paystack transaction and redirect the customer to Paystack's hosted checkout.
  2. Finalize the payment on return by verifying the transaction against the Paystack API — matching status, amount, and currency before the order is marked paid.
  3. Reconcile payments asynchronously via signed webhooks (for cases where the customer never returns from the redirect).
  4. Refund orders (full or partial) from the Administration, guarded by a dedicated permission and a server-side over-refund check.

It also provides customer bank-account verification (via Paystack's account-resolution endpoint) and correct money handling for the currencies Paystack supports, including zero-decimal (e.g. XOF, RWF) and three-decimal (e.g. KWD) currencies.

The plugin does not create currencies or languages in your shop. Amounts are converted correctly for whichever currency an order uses; adding a currency (e.g. XOF) or a language to Shopware remains a normal shop configuration step.


Key Features


Supported Payment Channels

Availability depends on your Paystack account and configuration:


Architecture Overview

The plugin uses a feature-first layout that mirrors Shopware's own plugins (for example, SwagPayPal). Each top-level directory under src/ is a bounded feature; inside it, code is organized into flat, Symfony-idiomatic folders (Service, Subscriber, Handler, Struct, Event, Enum, Controller). There is no Application/Domain/Infrastructure layering — a top-level module is the boundary, and every class has one obvious home.

Guiding principles

Payment flow

Refund flow


Technology Stack

Layer Technology
Language PHP 8.2+ (8.3 in the dev container)
Framework Shopware 6 (shopware/core, shopware/storefront), Symfony
Admin UI Vue, Shopware Administration, Meteor Component Library (mt-*)
Admin build Vite (output committed under Resources/public/)
Storefront Twig + vanilla JS plugin (output under Resources/app/storefront/dist/)
Testing PHPUnit 11
Static analysis PHPStan (level 9)
Code style PHP-CS-Fixer
Local environment Docker + Docker Compose (dockware/shopware)
CI GitHub Actions

Directory Structure

Assets under Resources/public/ and Resources/app/storefront/dist/ are generated. Never hand-edit them — change the source in Resources/app/**/src/ and rebuild.


System Requirements


Installation

Via Composer (recommended)

Manual upload

  1. Build a ZIP containing at least src/ and composer.json.
  2. In the Administration, go to Extensions → My Extensions → Upload Extension.
  3. Install and activate Paystack Payment.

On first installation the Paystack Payment method is assigned to all of your sales channels and Sandbox Mode is on by default, so a fresh install never talks to live Paystack until you switch it off. The method cannot be used for an order until a secret key is configured. If you only want it on some channels, adjust the assignment in the sales channel settings. Updating the plugin never re-adds the method to a channel you removed it from.

Paystack only accepts currencies enabled on your Paystack account (for example NGN, GHS, ZAR, KES), and the plugin does not create currencies. Make sure the currency a customer checks out in is both enabled on your Paystack account and added to the sales channel.


Local Development Setup

The repository ships a Docker Compose stack based on dockware that mounts this plugin into a full Shopware install.

The plugin directory is mounted at /var/www/html/custom/static-plugins/KmhPaystackSW; .git/, node_modules/, and vendor/ are excluded from the mount. Changes to source files on the host are reflected immediately in the container.

Default dockware credentials:


Docker & Docker Compose

The stack is defined in docker-compose.yml and built from a small Dockerfile:

No host port is published by default. To reach the Administration from your browser, add a mapping such as ports: ["80:80"] to the shopware service and reload with docker compose up -d. Do not use make restart for this — it runs docker compose down -v, which deletes the database volume and the installed shop.


Makefile Commands

All targets run the underlying tools inside the running container.

Command Description
make up Build, start, and prepare the Shopware container
make down Stop the container and remove volumes (wipes the DB)
make build Rebuild the container image
make restart down + up (wipes the DB)
make shell Open a bash shell in the container
make plugin-list List installed plugins
make test Run PHPUnit. Filter with make test FILTER="--filter SomeTest"
make test-coverage Run PHPUnit with a text coverage report
make cs PHP-CS-Fixer dry run (no changes)
make cs-fix PHP-CS-Fixer, applying fixes
make analyse PHPStan static analysis on src/
make fixture-load Load test fixtures
make resync Sync the test config into the shop root
make prepare Full project preparation (run by make up)
make validate-plugin Validate the plugin with shopware-cli (--full --store-compliance)
make cli Run any shopware-cli command: make cli ARGS="extension get-version ."
make changelog Render CHANGELOG.md as the Shopware Store would display it
make zip Build a distributable plugin zip into build/

shopware-cli ships inside the container image (see Docker & Docker Compose), so these run against the same PHP version and installed Shopware as the tests — not whatever is on the host. No local install is required.

Before committing, run:


Configuration Options

Configure the plugin under Extensions → My Extensions → Paystack → Configuration. Options are stored in Shopware's system configuration under the KmhPaystackSW.config.* domain and read through Setting\Service\Config.

Key Type Purpose
apiSecretKey password Live secret key (sk_live_...)
enableSandbox bool Use the sandbox/test key instead of live (on by default for new installs)
apiSecretKeySandbox password Test secret key (sk_test_...)
enableSplitPayment bool Enable Paystack split payments
subaccountCode text Split payment subaccount code
splitCode text Split payment split code
splitPaymentTransactionCharge int Flat transaction charge for split payments
paystackChargesBearer select Who bears fees: Account (merchant) or Subaccount
metaData multi-select Extra order/customer data sent to Paystack
collectBankData bool Collect customer bank data in the account area
showBvnField bool Show the BVN field
requireBvn bool Make the BVN field required
refundEnabled bool Allow refunds from the Administration
minimumRefundAmount int Minimum refund amount, in minor units
enableDebugging bool Enable verbose logging
logLevels multi-select PSR-3 levels to log when debugging is enabled

Secret keys are stored in Shopware's system configuration, never in code. There is no public key setting — Paystack initialization is server-to-server using the secret key.


Build & Asset Compilation

PHP has no build step beyond composer install. Frontend assets do, and their compiled output is committed to the repository.

Administration (Vue → Vite), output to Resources/public/administration/:

Storefront, output to Resources/app/storefront/dist/:

Rebuild the relevant bundle whenever you change source under Resources/app/administration/src/ or Resources/app/storefront/src/, and commit the regenerated assets together with the source. Keeping route names, service IDs, and custom-field keys stable means most PHP changes require no asset rebuild.


Testing

Tests live under tests/ and mirror src/. Each behavior change should ship with a test.

Pure business logic in the admin (Resources/app/administration/src/service/refund-calculator.js) has a companion Jest-style spec (refund-calculator.spec.js) for a full Shopware admin test runner.


Code Quality

Tool Command Config
PHPStan (level 9) make analyse phpstan.dist.neon
PHP-CS-Fixer make cs / make cs-fix .php-cs-fixer.dist.php
PHPUnit make test phpunit.dist.xml

CI enforces PHP lint, PHPStan, code style, unit + mockable integration tests, and a 100% line-coverage threshold. Kernel-dependent tests are excluded from CI.


Data Handling

The plugin ships no schema migrations — it does not alter the database schema. All setup is performed through Shopware's plugin lifecycle by dedicated installers:

These run on install()/update() and are reverted appropriately on uninstall (custom fields are removed only when the user does not keep plugin data).

The plugin's update() lifecycle hook re-runs the installers, which migrates the stored payment-method handlerIdentifier if the handler class moves between versions. Without this, a plugin update (as opposed to a fresh install) would leave a dangling handler identifier and break checkout.


Logging & Debugging

Logging goes through Logging\ConfigurableLogger, wired to the paystack_channel Monolog channel (writes to var/log/).


Security Considerations


Performance Considerations


Deployment

  1. Ship the plugin via Composer (composer require kommandhub/paystack-sw) or an Administration upload.
  2. Run:

  3. Ensure compiled Administration and Storefront assets are built and committed as part of the release.
  4. Configure live secret keys and disable sandbox mode.
  5. Grant the Paystack → Process Paystack refunds permission to the roles that should be able to issue refunds (the built-in admin role already has all privileges).

Validate a release build for the Shopware Store from inside the container, where shopware-cli runs against the installed Shopware and full vendor tree:

Running the same command against a host-only shopware-cli reports false positives (see the PHPStan note under Troubleshooting) — the container has the dependencies it needs to resolve Shopware's classes.


CI/CD

GitHub Actions (.github/workflows/php.yml) runs on pushes to main/develop and on pull requests:

  1. Validate composer.json.
  2. Install dependencies.
  3. Lint all PHP files.
  4. PHPStan (level 9).
  5. PHP-CS-Fixer (dry run).
  6. PHPUnit unit tests with clover coverage.
  7. Enforce a minimum coverage threshold (85%) via coverage-check.

Integration tests are excluded from this job because they need a booted Shopware kernel; run them locally with make test.


Version Compatibility

Plugin Shopware PHP
0.9.0-beta.x 6.6 and 6.7 8.2+

A single plugin release supports both Shopware 6.6 and 6.7 (shopware/core: ~6.6.0 || ~6.7.0).

Pre-1.0 status: the plugin is on a 0.x version while it completes sandbox/staging validation (see Roadmap). Namespaces and the public API may still change before 1.0.0. Once testing is complete and all critical issues are resolved, this will be promoted to 1.0.0 and submitted to the Shopware Store.

Upgrading from 0.9.0-beta.1 / 0.9.0-beta.2

In 0.9.0-beta.3 the plugin's technical name changed from KommandhubPaystackSW to KmhPaystackSW. Shopware treats a renamed plugin as a different plugin, so existing installs are not updated in place:

  1. Install and activate KmhPaystackSW.
  2. Re-enter your Paystack API keys and settings — they now live under the KmhPaystackSW.config.* configuration domain.
  3. Remove the old KommandhubPaystackSW plugin.

The custom field set and the bank fields were renamed too (kmh_paystack_*); bank details saved by earlier versions are not migrated. Orders and their paystack_* transaction fields are unaffected.


Troubleshooting

Order status not updating after payment

Test payments fail with "Insufficient Funds"

Payment fails with "No active channel to process transaction" or "Currency not supported by merchant"

Status emails say "New document for your order" or contain "he status…"

A payment was made but the order stayed open

Plugin not visible in the Administration

Stale Administration UI or DI errors after changes

Refund action not shown

PHPStan can't find Shopware\Storefront\... during shopware-cli validation


Contributing

  1. Create a feature branch off develop.
  2. Keep changes inside the relevant feature module; reach across modules through services.
  3. Add or update tests alongside behavior changes (mirror the src/ path under tests/).
  4. Rebuild admin/storefront assets if you touched their source, and commit the output.
  5. Run the full local gate before opening a PR:

  6. Use Conventional Commits for commit messages (feat:, fix:, refactor:, test:, …).
  7. Open a pull request against develop.

Please also read CLAUDE.md for the module boundaries and project-specific conventions.


Coding Standards


Roadmap


License

Licensed under the Apache License 2.0. See NOTICE for details.

Apache-2.0 was chosen over a simpler permissive licence for its explicit patent grant, its explicit reservation of trademark rights (§6), and the NOTICE mechanism that carries attribution downstream into forks. The licence covers this plugin's own source code only. It grants no rights in the KommandHub name or logo (see Trademarks & Disclaimer).


Trademarks & Disclaimer

This plugin is an independent, third-party integration developed and maintained by Kommandhub Limited. It is not affiliated with, endorsed by, sponsored by, certified by, or officially supported by Paystack or any of its affiliates.

"Paystack", the Paystack logo, and any related names, marks, and logos are trademarks of their respective owner. "Shopware" is a registered trademark of shopware AG. All other trademarks referenced in this project are the property of their respective owners. These marks are used in this project solely for nominative purposes — to identify the third-party payment gateway and the platform that this plugin integrates with — and their use does not imply any endorsement, partnership, or affiliation.

Use of the Paystack payment gateway is subject to Paystack's own terms of service and agreements, which are between the merchant and Paystack. This plugin merely provides a technical integration and makes no warranty regarding Paystack's services. To use it you must hold your own valid Paystack account and API credentials.

KommandHub's own marks — the "KommandHub" name and logo — are trademarks of Kommandhub Limited. The open-source licence covers the code, not the brand: a fork must be rebranded before redistribution. The full policy is in TRADEMARKS.md.


Support


All versions of paystack with dependencies

PHP Build Version
Package Version
Requires shopware/core Version ~6.6.0 || ~6.7.0
shopware/storefront Version ~6.6.0 || ~6.7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kommandhub/paystack contains the following files

Loading the files please wait ...