How To Setup Paystack on Magento 2
Our Paystack Module for Magento allows customers to buy your store products on checkout using their debit/credit cards or bank account details.
- An SSH client like Terminal (for Linux and MacOS and PuTTY for Windows)
- A working Magento installation
- If you have not installed Composer, install Composer on your system.
- With your SSH client, log into the server containing your Magento website. If you are using Terminal or any other command line interface, the command usually starts with the key 'ssh' and goes something like
Check your hosting provider's documentation or knowledge base on how to do this.
- Head to the Magento Marketplace and create an account. On signing in, navigate to My Profile and in the Marketplace tab, choose Access Keys.
Create an Access Key and name it anything you want. You will be provided with a public and private key in return.
Using your command line app (Terminal or PuTTY) which you have logged into via SSH, navigate to the root of your Magento installation and run
composer require pstk/paystack-magento2-module.
You will be prompted for a username and password. Your username is the public key generated by the Magento Marketplace and your password is the Private Key generated by the Magento Marketplace.
When asked 'Do you want to store credentials for repo.magento.com in /Users/username/.composer/auth.json?', respond with Y and click Enter. The necessary dependencies will be installed.
Enter the following commands, one after the other in your command line to enable the Paystack module.
php bin/magento module:enable Pstk_Paystack --clear-static-content
php bin/magento setup:upgrade
php bin/magento setup:di:compile
Head to your Magento Admin Dashboard, and go to Stores > Configuration. Under the Sales tab, choose Payment Methods. Paystack should be the first option under Other Payment Methods.
Enable Paystack by clicking the first option in the Paystack section and choosing 'Yes'.
Configure your plugin by inputting your API Keys. These keys are available on the Paystack Dashboard at https://dashboard.paystack.co/#/settings/developer. Use Test Keys while testing your website to ensure it works properly, then use Live Keys when you are ready to start accepting payment from customers. Ensure you click the Test Mode dropdown and put 'No' when you are ready to start accepting live payments.