You can use PayFast with WP Invoice by installing http://wordpress.org/plugins/wp-invoice/, which is an invoicing and billing plugin for WordPress.
This will give your WordPress site invoicing capabilities and we then provide a payment module for WP Invoice which will enable you to accept payments with WP-Invoice using PayFast.
A working WordPress installation with the WP Invoice Plugin installed.
Please note: Our latest WP Invoice plugin v2.0.0 is only compatible with WP Invoice 4.0 and above. Please make sure you are using their latest version.
To install the PayFast payment module, do the following:
Download the payment module from our site.
Unzip the module to a temporary location on your computer.
Copy the “wp-content” folder in the archive to your base wordpress folder.
This should NOT overwrite any existing files or folders and merely supplement them with the PayFast files.
This is, however, dependent on the FTP program you use.
If you are concerned about this, rather copy the individual files across as per the instructions below.
Log in to the WordPress Administrator console.
Using the main menu, navigate to Settings > Invoice > Settings > Payments.
Select the default payment method drop-down and click PayFast.
Click the PayFast link that appears and the options will then be shown below.
Leave everything else as per default and click Save All Settings.
The module is now ready to be tested with the PayFast Sandbox (note: Sandbox does not currently work with subscriptions).
To set up a subscription, select “Recurring Billing” in the right side menu and fill in the PayFast Subscription fields as necessary.
Ensure that subscriptions are enabled on the Integration page (under Settings) on your PayFast account.
Please note: When creating an invoice, the current PayFast configuration is setup so that invoice can not be changed. (eg. If PayFast is set to test mode when you create invoice 1, then invoice 1 will always use the Sandbox, even if PayFast is later set to live mode).
In order to make the module “live”, do the following:
Log in to the WordPress Administrator console.
Using the main menu, navigate to Invoice > Settings > Payments.
Click PayFast, change the configuration values as below:
PayFast Mode = “LIVE”
Merchant ID = <Integration Page>
Merchant Key = <Integration Page>
Log Debugging Info = No
Change the other fields as per your preferences.
Click “Save”.
If you are concerned that copying the entire folder from the downloaded module may overwrite files in your installation, rather copy the files from the extracted module individually into your installation.
Be sure to copy the files from the downloaded module to their corresponding locations within your installation:
The list of files needed in your online installation is as follows:
wp-content/plugins/wp-invoice/lib/gateways/js/wpi_payfast.js
wp-content/plugins/wp-invoice/lib/gateways/payfast/payfast_common.inc
wp-content/plugins/wp-invoice/lib/gateways/templates/wpi_payfast-frontend.tpl.php
wp-content/plugins/wp-invoice/lib/gateways/class_wpi_payfast.php
If you followed the installation instructions above, the module is in 'test' mode and you can test it by creating an invoice and completing the payment cycle through the PayFast Sandbox. Log in with the user account detailed above and make payment using the balance in their wallet.
You will not be able to directly 'test' a credit card or Instant EFT payment in the Sandbox, but you don’t really need to. The inputs to and outputs from PayFast are exactly the same, no matter which payment method is used, so using the wallet of the test user will give you exactly the same results as if you had used another payment method.