Paystack payment gateway Magento2 extension
Version: 2.5.0 (Paystack v2 Inline.js API)
- Magento 2.x
- PHP 8.3+
- yabacon/paystack-php v2.2.0 or newer
Go to your Magento2 root folder and run:
composer require pstk/paystack-magento2-module:^2.5.0
php bin/magento module:enable Pstk_Paystack
php bin/magento setup:upgrade
php bin/magento cache:flushCopy all files from your source folder (plugin-magento-2) to app/code/Pstk/Paystack/ in your Magento installation.
Then run:
php bin/magento module:enable Pstk_Paystack
php bin/magento setup:upgrade
php bin/magento cache:flush-
Go to Magento2 root folder
-
Enter following command to install module:
composer require pstk/paystack-magento2-module-
Wait while dependencies are updated.
-
Enter following commands to enable module:
php bin/magento module:enable Pstk_Paystack --clear-static-content
php bin/magento setup:upgrade
php bin/magento setup:di:compileTo configure the plugin in Magento Admin:
- Go to Stores > Configuration > Sales > Payment Methods.
- 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
- Test/Live Public Key: Get from your Paystack dashboard
- Click Save Config.
Note: Inline (Popup) uses Paystack v2 Inline.js API. Make sure your CSP whitelist and RequireJS config are updated as shown in the migration guide.
Sometimes after receiving payment for an order you get an error like: Class Yabacon\Paystack not found and magento doesn't redirect to the success page.
Fix:
Run:
composer require yabacon/paystack-phpEnable and configure Paystack in Magento Admin under Stores/Configuration/Sales/Payment Methods
Fail to redirect to success page after payment
Ensure you are using Paystack v2 Inline.js and your CSP/RequireJS configs are correct.
Contained within this repo is a Dockerfile and a docker-compose file to quickly spin up Magento 2 and MySQL containers with the Paystack plugin installed.
- Install Docker
- Create a
.envfile from.env.samplein the root directory. Fill in your values. - Run
docker-compose upfrom the root directory to build and start the containers. - Visit
localhost:8000for the Magento store. For admin, visitlocalhost:8000/<MAGENTO_BACKEND_FRONTNAME>(set in.env). - Run
docker-compose downto stop the containers.
For bug reports and feature requests directly related to this plugin, please use the issue tracker.
For general support or questions about your Paystack account, you can reach out by sending a message from our website.
If you are a developer, please join our Developer Community on Slack.
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 for more information how you can do this.
