How to setup Paystack on Magento 2

Edited

Magento is a powerful and widely used Content Management System (CMS) that stands out for its robust e-commerce capabilities. Known for its scalability and flexibility, Magento caters to businesses of all sizes, from small enterprises to large corporations.

You'll need an SSH client like Terminal (for Linux and MacOS and PuTTY for Windows), Composer, and a working Magento installation to complete the set-up.

Setting up your Magento 2 plugin

  1. If you haven't installed Composer, follow this link to install Composer on your system.

  2. Log into the server containing your Magento website with your SSH client. If you use Terminal or any other command-line interface, the command usually starts with the key 'ssh' and goes something like 'ssh username@hosting.com.' You can check your hosting provider's documentation or knowledge base on how to do this.

  3. Head to the Magento Marketplace to create an account (if you haven't already). Sign into your account and go to 'My Profile', and in the Marketplace tab, choose Access Keys. 

    file-C2jHGWzm4n.png

  4. Create an Access Key and name it anything you want. You will be provided with a public and private key in return.

    file-p9oOHPH0pb.png

  5. 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'. 

  6. You will be prompted to provide 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.

  7. 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.

    file-CMWwLGl1as.png

  8. 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.

file-2zTYCBr3k0.png

Enable Paystack by clicking the first option in the Paystack section and choosing 'Yes'.

Finally, configure your plugin by inputting your API Keys. You can get your Test and Live API Keys from the Settings page on your Paystack Dashboard. Copy and paste your API keys. 

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.

If you encounter any issues while integrating the plugin, please get in touch with us at techsupport@paystack.com or via our contact form.