Glossary Item Box

Squirrelcart v6.1.0

PayFast

Overview

PayFast is a South African based payment system. It provides an alternative way to allow your customers to pay using credit cards and other forms of payment without you having to incur the expenses of a merchant account. PayFast performs the transaction on their website, and adds the money to your PayFast account. For more information about PayFast, see their official site at https://www.payfast.co.za.

Before you can accept payments via PayFast, you will need to sign up for a business account on their website.

Requirements

Supported Features

Auto Return

Auto Return returns the customer to your website after they submit payment at PayFast. Squirrelcart automatically makes use of this feature, you do not have to enable it.

Payment Data Transfer (PDT)

When PayFast returns the customer to your website after they submit payment, they do not provide any data to indicate the status of that payment. PDT is used to make a behind the scenes query to PayFast to obtain information about the transaction. This allows us to determine if the transaction was approved or not. PDT requires CURL and OpenSSL.

PDT is used when the customer is returned to your website. If the transaction was successful, the order is completed in Squirrelcart.

Instant Transaction Notification (ITN)

The combination of AutoReturn and PDT is enough for most orders to complete in Squirrelcart. However, AutoReturn relies on the customer's browser. Should the customer close their browser window before returning, AutoReturn and PDT won't be able to complete the order. In these instances, ITN is used to complete the order via a silent post.

ITN provides immediate notification of PayFast payments you receive. ITN requires CURL and OpenSSL.

Enabling PayFast
While PDT and ITN are not required by PayFast, Squirrelcart's integration does require them. You must enable both PDT and ITN for PayFast to function properly. Instructions for both are included below.
  1. If you do not have a PayFast account, visit PayFast.co.za and signup.
  2. Login to your PayFast.co.za account at: https://www.payfast.co.za
  3. Click SETTINGS
  4. Under the heading MERCHANT IDENTIFIERS, you'll see a Merchant ID and a Merchant Key. Write these down very carefully, or copy them for later use.
  5. Click the EDIT button to the right of PAYMENT DATA TRANSFER.
  6. Change the PDT Status field to Enabled
  7. Click Update
  8. You should now see a PDT Key listed in the PAYMENT DATA TRANSFER section. Write this down or copy it for later use.
  9. Click the EDIT button to the right of INSTANT TRANSACTION NOTIFICATION 
  10. Change the ITN Status field to Enabled
  11. For the Notify URL field, enter the URL as follows:

    http://www.EXAMPLE.COM/squirrelcart/payfast_itn.php

    Change the domain name to match your site. If you have installed Squirrelcart in a subdirectory, be sure to add that to the URL. For example, if your storefront page is http://www.example.com/store/store.php, then your ITN URL would be http://www.example.com/store/squirrelcart/payfast_itn.php. 
  12. Click Update
  13. Login to Squirrelcart as admin and open the control panel.
  14. Click Settings > Payment > Methods from the admin menu system.
  15. Click on the record labeled PayFast
  16. Enter your PayFast Username, Merchant ID, Merchant Key, and PDT Key in the corresponding fields. Username is the same username you logged in with at PayFast.co.za and should also be your email address. The other three settings were obtained in the steps above this one.
  17. Make sure the Payment Mode field is set to Live
  18. Check the Enabled field
  19. Click Save Changes

Testing

The best way to test is with Payment Mode set to Live. Create a product that has a low price, and place an order for it.

PayFast offers a sandbox environment for testing. If you wish to test with that environment, set the Payment Mode field to Test and change all your credentials in Squirrelcart to match the ones they provide for their sandbox environment:

https://www.payfast.co.za/s/std/integration-guide 

 

 


© 2001-2017 Lighthouse Development. All Rights Reserved.