In order to use PayFast with Magento 2.x, you will need to install the PayFast payment module for Magento which is provided by PayFast.
- A working Magento 2.0 or 2.1-2.2* or 2.3 installation
Installing and testing
- Setup ZAR on your Magento site. In the admin panel navigate to ‘Stores’, and add ZAR under currency Symbols and Rates.
- Download the PayFast module for Magento 2.0 or Magento 2.1-2.2* or Magento 2.3.
- Copy the PayFast app folder to your root Magento folder. This will not overwrite any files on your system.
- You will now need to run the following commands in the given order:
- php ./bin/magento module:enable Payfast_Payfast
- php ./bin/magento setup:di:compile
- php ./bin/magento setup:static-content:deploy
- php ./bin/magento cache:clean
- Log into the admin panel and navigate to Stores > Configuration > Sales > Payment Method’ and click 'PayFast'.
- Enable the module, as well as debugging. To test in sandbox insert ‘test’ in the ‘server’ field and use the following credentials: Merchant ID: 10000100 Merchant Key: 46f0cd694581a Leave the passphrase blank and setup the other options as required
- Click ‘Save Config’, you are now ready to test in sandbox, click ‘Save Config’.
- Once you are ready to go live, insert ‘live’ into the ‘server’ field and input your PayFast credentials. Set debug log to ‘No’, and the other options as required.
- Click ‘Save Config’, you are now ready to process live transactions via PayFast.
If you are using version 1.9 or below, please visit GitHub for instructions.