Forum OpenACS Q&A: Re: Integration of payment gateway CGI PAYSAT.COM

Collapse
Posted by tomy orange on
CGI Merchant Application Program Interface
Paysat®

Paysat Merchant API

Overview

API integration is a solution provided by PaySat Inc. to all merchants that have their own orders database, and desire to keep the order page under their identity.

Paysat offers two solutions that vary according to the environment of the merchant site:
    CGI script (platform independent).
    Managed .Net DLL, for integration with .Net web projects.

This document illustrate the CGI integration module

CGI Script API Integration

To use the CGI Script API, the following steps must be performed:

a.    The merchant will download CGI API version from his Paysat Merchant Profile which will contain 4 files (asci.cgi, merchant.cgi,  psmain.cgi, rsa.cgi & testing_paysat_apis.htm)
b.    These Scripts must be deployed on the hosting environment (e.g. /cgi-bin under Apache/Tomcat web server or IIS using ISAPI extension for CGI) and they must place into the scripts Directory that will be configured for this purpose.
c.    The Code in these Scripts needs to be modified to work on your Server

In psmain.cgi you need to change the following:

my $path = 'http://localhost:8080/cgi-bin';;

This line of Code refers to the location of the scripts folder, you will change it to the path in which your scripts are located in.

my $weburl = url('http://localhost:8080/cgi-bin/Merchant.cgi ?

This line of Code refers to the location of the Merchant.cgi Script.

In merchant.cgi you need to change the following:

my $url = url("http://localhost:8080/cgi-bin/rsa.cgi"." ?m=".$m."&e=".$e."&n=".$n);

This line of Code refers to the location of the rsa.cgi Script which will be responsible of encrypting the data being sent to PaySat.

You will find the file (testing_paysat_apis.htm) attached with Merchant API Package, it is a sample Html page that user can enter his Data in and it will pass the data to the Script psmain.cgi through this Code

<form method="get" action="http://localhost:8080/cgi-bin/psmain.cgi">

And you will need to change this Path also referring to (psmain.cgi) location on your Server.

You need also to change this line of Code to refer to your Return page

<input type="hidden" name="returnpath" id="returnpath" value="http://www.paysat.com/default.aspx" size="31">

Please note that the following Parameters will be sent to PaySat without Encryption

In case of Amount Order if($DropDown == '0')
(orderID, domainID, countryID, state, address, zipCode, email, phone, city, ip, amount, currency & orderDesc)

In case of Amount Order if($DropDown == '1')
(orderID, domainID, countryID, state, address, zipCode, email, phone, city, ip, productID)

In case of Recurring Order if($DropDown == '2')
(orderID, domainID, countryID, state, address, zipCode, email, phone, city, ip, productID)

Please note that the following Parameters will be sent to PaySat with Encryption
(login, password, cardType, cardNo, validateMonth, validateYear, cvv, holderName)

There is also a function that will be executed if($DropDown == '3') it is used to know the status of Order.