Created : 10 April 2018
Last Modified : 13 November 2018

***********************************************************************************
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 Payhere Payment Gateway
It is supporting credit card payment.

This module is available for normal checkout and onepage checkout.

This is using iframe integration where the hosted payment page is placed in an iframe in order to achieve a smooth direct and PCI DSS compliant integration in your checkout.

To use this module, you must register an account first with Payhere. More info at: www.payhere.lk

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

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

Files included in the zip are:
- $READ_ME_FIRST_payhere900.HTML
- admin\payhere_setup.asp
- admin\payhere_setup_config.asp
- admin\payhere_setup_process.asp
- admin\sqlscripts\payhere\*
- payhere_execute.asp
- payhere_process.asp
- payherecallback.asp
- payhereconfig.asp
- payheregateway.asp
- payhereresult.asp

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

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

1. Upload below files to your ADMIN folder. If you have renamed your ADMIN folder, then this must be placed in the renamed folder.
- admin\payhere_setup.asp
- admin\payhere_setup_config.asp
- admin\payhere_setup_process.asp
- admin\sqlscripts\payhere\*

2. Upload below files to your VPCart root folder.
- payhere_execute.asp
- payhere_process.asp
- payherecallback.asp
- payhereconfig.asp
- payheregateway.asp
- payhereresult.asp

3. Log into super admin and execute setup file below eg :
http://www.yourdomain.com/youradminfolder/payhere_setup.asp

Note:
Replace www.yourdomain.com with your VPCart site url
Replace youradminfolder with your VPCart admin folder name

4. After setup the module, would be redirected Module configuration page for configure the module.

Enable? : Please set to Yes to activate this gateway.
Test Mode: Enter True for Testing mode. Enter False for production/live mode.
Your Payhere Merchant ID: You need to enter your Payhere Merchant ID.
Currency Code (LKR or USD): Enter your currency. Default is LKR.
Success Payment Label For Orders : For approved transaction, the order will be tagged with this value eg PayHere.
Failed Payment Label For Orders : For declined transaction, the order will be tagged with this value eg PayHere-DECLINED.

Click Save button once all filled in.

5. Create a new folder in your VPCart root called "payhere_logs" and please allow read/write permission for this folder.
You can ask your web host to set the folder permission.

6. You are done.

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

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

After you have installed and setup the Payhere gateway module, when customers do a checkout, they will see a button "Pay With Credit Card" on the checkout page. When it is clicked, customers will be redirected to Payhere site to enter their card.

Once payment is made on Payhere site, Payhere will send notification (payment status code and other response parameters) back to the merchant site by calling the page payherecallback.asp silently. On this file payherecallback.asp, VPCart will receive the payment status code from Payhere site for a transaction eg :

Status code 2 : success
Status code 0 : pending
Status code -1 : canceled
Status code -2 : failed
Status code -3 : chargedback

If a payment status is 2 which is a success payment, then VPCart will update the following Orders table fields as below eg :

ocardtype :
PayHere

oauthorization
:
Status Code = 2 (success)
Payment ID = 320025016899

If a payment status other than 2 which is not a success payment then VPCart will update the following Orders table fields as below eg :

ocardtype :
PayHere-DECLINED

oauthorization
:
Status Code = 0 (pending)
or Status Code = -1 (canceled)
or Status Code = -2 (failed)
or Status Code = -3 (chargedback)

When a payment notification is sent from Payhere site to your site, VPCart will automatically create a log file eg payhere_[date]_[ordernumber].txt into folder "payhere_logs".

For a success payment, VPCart will then redirect customers to final checkout page (shopthanks.asp).
For a failed payment, VPCart will redirect customers back to shopcheckout.asp to retry their payment.

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

E. CONFIGURATION SETTINGS
=================
New configs :
xpayhere_enable
xpayhere_merchantid
xpayhere_testmode
xpayhere_currency
xpayhere_approved_code
xpayhere_declined_code


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.