WP Invoice

Create invoices from WordPress and email them to your customers (from the platform). Your customers’ invoices contain a Pay with PayFast button, allowing them to immediately pay you by credit card, Instant EFT or voucher.

WP Invoice

Key Features

  • Runs on your existing WordPress theme
  • Automatically emails customers
  • Customised emails

Integration

See PayFast integration

How do I use PayFast with WP-Invoice?

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.

What are the installation requirements?

  • A working WordPress installation with the WP-Invoice Plugin installed

INSTALLATION AND TESTING

How do I install the PayFast module for WP-Invoice v3?

To install the PayFast payment module, follow the instructions below:

  1. Download the payment module from our site
  2. Unzip the module to a temporary location on your computer
  3. 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 instructions below
  4. Login to the WordPress Administrator console
  5. Using the main menu, navigate to Settings -> Invoice -> Settings -> Payments
  6. Select the default payment method drop down and click on PayFast
  7. Click on the PayFast link that appears and the options will then be shown below.
  8. Leave everything else as per default and click “Save All Settings”
  9. The module is now and ready to be tested with the Sandbox. To test with the sandbox, use the following login credentials when redirected to the PayFast site:
    • Username: sbtu01@payfast.co.za
    • Password: clientpass

How do I copy the individual files across?

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:

template/ext/wp-invoice/core/gateways/js/wpi_payfast.js
template/ext/wp-invoice/core/gateways/payfast/payfast_common.inc
template/ext/wp-invoice/core/gateways/templates/wpi_payfast-frontend.tpl.php
template/ext/wp-invoice/core/gateways/class_wpi_payfast.php

How can I test that it is working correctly?

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, login 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, Instant EFT or Ukash 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.

How do I install the PayFast module for WP-Invoice v4?

To install the PayFast payment module, follow the instructions below:

  1. Download the payment module from our site
  2. Unzip the module to a temporary location on your computer
  3. 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 instructions below
  4. Login to the WordPress Administrator console
  5. Using the main menu, navigate to Settings -> Invoice -> Settings -> Payments
  6. Select the default payment method drop down and click on PayFast
  7. Click on the PayFast link that appears and the options will then be shown below.
  8. Leave everything else as per default and click “Save All Settings”
  9. The module is now and ready to be tested with the Sandbox (note: sandbox does not currently work with subscriptions).
  10. To setup a subscription select ‘Recurring Bill’ in the right side menu and fill in the PayFast Subscription fields as necessary
  11. Ensure that subscriptions are enabled on the Integration page (under Settings) on your PayFast account

Note: When creating an invoice the current PayFast configuration is set to that invoice and 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).

I’m ready to go live! What do I do?

In order to make the module “LIVE”, follow the instructions below:

  1. Login to the WordPress Administrator console
  2. Using the main menu, navigate to Invoice -> Settings -> Payments
  3. Click on “PayFast”, change the configuration values as below:
    • PayFast Mode = “LIVE”
    • Merchant ID = <Integration Page>
    • Merchant Key = <Integration Page>
    • Log Debugging Info = No
  4. Change the other fields as per your preferences
  5. Click Save

See Upgrading and FAQs

UPGRADING

Standard Upgrade Procedure

  1. Download the payment module from our site
  2. Unzip the module to a temporary location on your computer
  3. Copy the “wp-content” folder in the archive to your base “wordpress” folder

FREQUENTLY ASKED QUESTIONS (FAQS)

What is the payment flow?

PayFast works on browser redirection and will redirect the user to PayFast for payment after they click the “Make Payment” button on the Checkout page.

At this stage, the order has already been created in MarketPress with the status “Received”.

If the payment is CANCELLED during processing on PayFast:

  • The user will be returned to the “Transaction Results” page
  • The order status will be left as “Incomplete Sale”

If the payment is SUCCESSFUL through PayFast:

  • The user will be returned to the “Confirmed” page
  • The order status will be updated to the status “Paid”

Do I need to set the ITN url on my account?

No. When using the one of our payment modules, the ITN url is set automatically and you do not need to set it on your account manually.

WordPress gives the error “invalid plugin” when I try an install your module!

Our plugin is not a plugin for WordPress itself, but for WP-Invoice, which is itself an invoicing plugin for WordPress.

To integrate with PayFast, you will need to install WP-Invoice first. Once you have installed WP-Invoice, you can then install the PayFast payment module for WP-Invoice provided by PayFast as detailed above.

Where is my “base WordPress folder”?

This is the root of your WordPress installation. Where this is, depends on what system you are using and where you are hosting.

The easiest way to find this though would be to look for the WordPress directory structure.

The base (or root) WordPress folder will look similar to the image shown below.

Simply find the folder in your installation which looks similar to this structure and that will be your “base WordPress folder”.

Directory structure of base WordPress folder

I upgraded WordPress/WP-Invoice and now “PayFast” no longer appears as a payment option!

When upgrading either WordPress or WP-Invoice, the PayFast payment module files may be deleted.

You simply need to reinstall the module following the installation procedures above and the “PayFast” option will reappear with your previous setting intact.

USEFUL LINKS