Created : 25 April 2019
Last Modified : 25 April 2019

***********************************************************************************
Contents:

A. SUMMARY
B. FILE STRUCTURE
C. INSTALLATION INSTRUCTION
D. HOW IT WORKS
E. CONFIGURATION SETTINGS
F. DATABASE TABLES MODIFIED
G. LANGUAGE SETTINGS CHANGED
H. CHANGE LOGS
I. TROUBLESHOOTING
J. FAQ
K. COPYRIGHT NOTICE
L. TERMS AND CONDITIONS
***********************************************************************************

A. SUMMARY
==========
This interface is for use with PayFast ITN (Instant Transaction Notification) Payment Gateway.
It is supporting credit card payment.

This payment gateway is supporting normal checkout and onepage checkout.

To use this module, you must register an account first with PayFast. More info at: https://www.payfast.co.za

***********************************************************************************

B. FILE STRUCTURE
===================

Files included in the zip are:
- $READ_ME_FIRST_payfastitn900.HTML
- payfastitn_execute.asp
- payfastitn_process.asp
- payfastitnconfig.asp
- payfastitngateway.asp
- payfastitnmd5.asp
- payfastitnresult.asp
- admin/payfastitn_setup.asp
- admin/payfastitn_setup_config.asp
- admin/payfastitn_setup_process.asp
- admin/sqlscripts/payfastitn/*

***********************************************************************************

C. INSTALLATION INSTRUCTION
============================

1. Upload the below files to your VPCart 9.00 root folder.
- payfastitn_execute.asp
- payfastitn_process.asp
- payfastitnconfig.asp
- payfastitngateway.asp
- payfastitnmd5.asp
- payfastitnresult.asp

2. Upload the below files to your ADMIN folder. If you have renamed your ADMIN folder, then this must be placed in the renamed folder.
- admin/payfastitn_setup.asp
- admin/payfastitn_setup_config.asp
- admin/payfastitn_setup_process.asp
- admin/sqlscripts/payfastitn/*

3. Log into super admin and execute page below:
http://www.yourdomain.com/<your admin folder>/payfastitn_setup.asp

Note: Replace the below with your VPCart site
{ www.yourdomain.com } : your site domain
{ your admin folder } : your admin folder

Click Install Now button.

4. After installation completed, you should see message below:
_______________________________________________________
The PayFast ITN Payment solution initial setup has now been completed.

Please go to modules configuration page for further setup.
_______________________________________________________

5. Please click the "modules configuration page" link to setup.

- Enable? : Set to Yes to enable PayFast ITN Payment gateway.

- Merchant ID
: Please enter your PayFast merchant ID. Please refer to https://support.payfast.co.za/article/102-where-is-my-merchant-id-and-key on how to obtain this.

- Merchant Key: Please enter your PayFast merchant Key. Please refer to https://support.payfast.co.za/article/102-where-is-my-merchant-id-and-key on how to obtain this.

- Test Mode ?: Value can be True or False
Enter True for testing / sandbox account
Enter False for live / production account

- Sandbox Gateway URL: PayFast sandbox web service URL. Default is https://sandbox.payfast.co.za/eng/process

- Live Gateway URL: PayFast live web service URL. Default is https://www.payfast.co.za/eng/process

- Passphrase (optional): If your PayFast account setting has set a passphrase, then you must enter the passphrase here. Please refer to https://support.payfast.co.za/article/120-how-do-i-enable-a-passphrase-on-my-payfast-account on how to set a Passphrase (optional). You can leave as empty if you don't set in your account.

Click Save button.

6. You are done.

***********************************************************************************

D. HOW IT WORKS
===============

After you have installed PayFast ITN payment gateway module, when customers do a checkout, they will see a button "Click here to Pay by Credit Card" on the checkout page. When it is clicked, customers will be redirected to PayFast site to enter their card.

Once payment is made on Payfast site, PayFast will then send a silent notification to the merchant site using the page payfastitnresult.asp to post result of the transaction.

Upon receiving the response from PayFast, VPCart will do the checking below:

a. Verify the returned Signature is same with calculated Signature. If not matching, the payment status will be marked as below:

ocardtype : PayFastITN-FAILED
oauthorisation : Returned Signature not matching

b. Verify the valid PayFast domain that sent the response.
The valid PayFast domains are: www.payfast.co.za, w1w.payfast.co.za, w2w.payfast.co.za and sandbox.payfast.co.za
If the response is sent from none of above, the payment status will be marked as below:

ocardtype : PayFastITN-FAILED
oauthorisation : An unauthorized domain has sent response for this payment: http://www.example.com

c. Verify the returned total amount charged by PayFast is same with total order amount in merchant site.
If not matching, the payment status will be marked as below:

ocardtype : PayFastITN-FAILED
oauthorisation : Total amount charged by Payfast is different with total order amount in your cart site. Total amount charged by Payfast is Rxx and Total order amount on cart site is Ryy.

d. Verify the Payment Status returned by Payfast.
If it is a COMPLETE payment status, customers will be returned back to the merchant site at shopthanks.asp.
For a success transction, VPCart will then update the following Orders table fields as below eg :

ocardtype : PayFastITN
oauthorisation : TransID=xxxxxx Status=COMPLETE

If it is a FAILED payment status, VPCart will then update the following Orders table field as below eg :

ocardtype : PayFastITN-FAILED
oauthorisation : Credit card transaction failed<br>Either retry it<br>or select another payment method

If it is a PENDING payment status, VPCart will then update the following Orders table field as below eg :

ocardtype : PayFastITN-PENDING
oauthorisation : -

***********************************************************************************

E. CONFIGURATION SETTINGS
=================

New configs:
xpayfastitn_enable
xpayfastitn_merchant_id
xpayfastitn_merchant_key
xpayfastitn_test
xpayfastitn_live_url
xpayfastitn_sandbox_url
xpayfastitn_passphrase

F. DATABASE TABLES MODIFIED
===========================

NONE

***********************************************************************************

G. LANGUAGE SETTINGS CHANGED
============================

NONE

***********************************************************************************

H. CHANGE LOGS
============================

NONE

***********************************************************************************

I. TROUBLESHOOTING
============================

Please submit a ticket to our helpdesk at https://helpdesk.vpcart.com and our support team will assist you.

***********************************************************************************

J. FAQ
============================

NONE

***********************************************************************************
K. COPYRIGHT NOTICE
============================

Copyright (c) 1999-2019 Rocksalt International Pty. Ltd.
All rights reserved.

This software and documentation constitute a published work and
contains valuable trade secrets and proprietary information
belonging to Rocksalt International Pty. Ltd. .
None of the foregoing material may be copied,
duplicated or disclosed without the express written permission
of Rocksalt International Pty. Ltd. .

LICENSEE ACCEPTS VP-ASP Shopping Cart "AS IS" "WITH ALL FAULTS",
Rocksalt International Pty. Ltd. accepts no responsibility for the
operation or performance of the VP-ASP Shopping Cart.
The entire risk of use and consequences of use of the
VP-ASP Shopping Cart falls completely on the Licensee
and Rocksalt International Pty. Ltd. shall not be liable in any respect
for any claims, loss or injury alleged to have resulted
from use of or in reliance on VP-ASP Shopping Cart.

Licensee acknowledges that it has read the foregoing
disclaimers of warranty and limitation of liability
and understands that Licensee assumes
the entire risk of using VP-ASP Shopping Cart.


***********************************************************************************

L. TERMS AND CONDITIONS
============================
ROCKSALT INTERNATIONAL GRANTS TO THE LICENSEE A NON-EXCLUSIVE,
NON-SUB LICENSABLE, NONTRANSFERABLE LICENSE
TO INSTALL AND USE THIS APPLICATION ON A SINGLE DOMAIN FOR
A SINGLE SHOP.

THE CODE IN THE APPLICATION MAY BE MODIFIED FOR USE IN
SETTING UP A SINGLE SHOPPING SITE ON THE WORLD WIDE WEB.

LICENSEE MAY MAKE A COPY OF THE APPLICATION FOR
BACK-UP AND ARCHIVAL PURPOSES, PROVIDED THAT ANY COPY
MUST CONTAIN ALL PROPRIETARY NOTICES INCLUDED
WITH THE APPLICATION.

LICENSEE IS PROHIBITED FROM SELLING OR DISTRIBUTING
THE APPLICATION IN ANY MANNER.

LIMITATION OF LIABILITY.

ROCKSALT INTERNATIONAL AND ITS LICENSORS SHALL
NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE OR ANY
THIRD PARTY AS A RESULT OF USING OR DISTRIBUTING THIS
APPLICATION.

IN NO EVENT WILL ROCKSALT INTERNATIONAL OR ITS LICENSORS
BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
OR FOR DIRECT, INDIRECT, SPECIAL,
CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES,
HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LI
ARISING OUT OF THE USE OF OR INABILITY TO USE THE SOFTWARE,
EVEN IF ROCKSALT INTERNATIONAL HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.