How to integrate paystack payment gateway in Magento 2.

Nnamso Anthony
4 min readJan 2, 2018
Image Source

Hello Magento enthusiasts, welcome back. Here I am going to discuss on something very exciting. You will know how to integrate paystack payment gateway in magento 2 applications.

Why PayStack ?

There are so many payment gateways available, one of the most popular gateways is Interswitch, but Paystack has some advantages over Interswitch— simple, hassle free, easier integration, setup, maintenance and seamless checkout experience. Moreover integrating paystack with magento 2 is a breeze.

We just need a payment form which collects card information like card number, expiry date and a CVC code.

Getting started with Paystack

  • First, we need to register with paystack, go to Paystack and register yourself there.
  • Now get the public and private keys from your account which are provided in your account settings.
  • Make sure you set your paystack account as a test account so that real transactions does not occur.
  • Join paystack slack channel. You can get support from other developers.

While in test mode, we cannot use genuine card information, so it provides us with some test cards,

Test Card Image after integration
Before integration

System Requirement

Your server should have composer installed.

So what is this composer ?

Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on, and it will manage (install/update) them for you.

How do you start

SSH, also known as Secure Socket Shell, is a network protocol that provides administrators with a secure way to access a remote computer. SSH also refers to the suite of utilities that implement the protocol.

list various SSH implementations here. Feel free to submit more under the comment.

ssh battavoq@195.54.114.40 -p21098

Once you enter the right password you are in.

How do you know if your server has composer installed ?

You run the command below.

composer -VComposer version 1.5.2 2017-09-11 16:59:25

How to Install

Go to paystack github repository

https://github.com/PaystackHQ/magento2-Profibro_Paystack

  • Go to Magento2 root folder
  • Enter following command to install module:
composer require profibro/magento2-module-paystack
  • Wait while dependencies are updated.
  • Enter following commands to enable module:
php bin/magento module:enable Profibro_Paystack --clear-static-content
php bin/magento setup:upgrade
php bin/magento setup:di:compile

Known Errors

  1. Composer Error: You will experience errors depending on the server you are using. Mostly if you are using a shared server.
  2. Memory Limit: You will have to increase your memory limit to a minimum of 1020M
php -d set_time_limit=3600 -d memory_limit=1024M bin/magento setup:di:compile

Run composer to see if everything is working just fine. If you get the result below then you are set.

composer 

Now that you’ve installed Composer, you are ready to use it!

If you have done everything right then you should get this.

You want to integrate payment gateway hit me up. nnamsoanthony[at]gmail[dot]com

--

--