CGI Merchant Application Program Interface PaySat®
PaySat Merchant API
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 for 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
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.
Payment parameters: The web page that will call the script must provide the following parameters:
Parameter Description login Merchant username password Merchant password merchant Merchant ID domain Merchant domain id ordertype 0=Amount, 1=Single, 2=Recurring order Merchant ordered prod Product ID (Not required for Amount Orders) amount Amount (Only for amount orders) currency Currency (Only for amount orders) desc Description (Only for amount orders) cardtype 1=Visa, 2=MasterCard cardno Credit Card Number cvv Credit Card cvv2 or cvc vyear Credit Card expiry year format yyyy vmonth Credit Card expiry month format mm hname Credit Card holder name email Credit Card holder email country Country state 1 for outside USA and Canada up to 63 address Billing address city Billing City zipcode Zip code phone Phone ip Buyer current IP address Return Value: The return value will be either Success or a self descriptive error message otherwise.