Documentation
SUPERCART:  V3.0

 


System Requirements

  • Unix, Lynyx or NT Operating System
  • Secure Webspace with CGI Capability Recommended
  • Online merchant bank that accepts POST transmissions required for realtime validation
  • Sendmail or Qmail
  • For realtime validation you will need a programmer
  • For interfacing into AGENTS OF FORTUNE affiliate software you should have prior experience installing CGI

Preliminaries

  • Determine the path to PERL 5 on your web server host.  Note that some web hosting companies run both PERL 4 and PERL 5.  Make ABSOLUTELY sure you are not setting this up under PERL 4.  Ask your administrator if you are not sure.
  • Download the tarfile for this program and save it to your desktop.
  • Unpack the tar archive on your desktop using a program that unpacks UNIX TAR ARCHIVES. If you don't have such a program then download WINZIP FREE from SHAREWARE.COM
  • After you have unpacked the TAR archive you will have a collection of folders and files on your desktop.  Now you have to do some basic editing of each of these files (or at least some of them).  Use a text editor such as wordpad, notepad, BBEdit, simpletext, or teachtext to edit the files.  These are NOT WORD PROCESSOR DOCUMENTS they are just simple TEXT files so don't save them as word processor documents or save them with extentions such as .txt or they will NOT WORK.   Note that there may be a some files inside of folders which are "blank".   This is normal.

Preparing the CGI scripts

Define Path To PERL 5

The first step is to open up each and every file that has a .cgi extention and edit line number one of each script.  Each of the cgi scripts is written in perl 5. For your scripts to run they must know where perl 5 is installed on your web server. The path to perl 5 is defined to a cgi script in the first line of the file. In each of the cgi scripts the first line of code looks something like this:

#!/usr/bin/perl

If the path to perl 5 on your web server is different from /usr/bin/perl you must edit the first line of each cgi script to reflect the correct path. If the path to perl 5 is the same no changes are necessary. If you do not know the path to perl 5 ask the webmaster or system administrator at your server site.  

Configure the .cgi files

configure.cgi

This is the entire cgi.  There are several variables to edit, all of which should be pretty straightforward.

  • $sendmail = path to sendmail
  • $billing=Your email address (include backslash)
  • $subject = Subject line for email invoices
  • $bottomhtml = path to the bottom.html (customizable footer) file
  • $tophtml = path to the top.html (customizable header) file
  • $thankyouhtml = path to the thankyou.html (customizable thank you page) file

Upload Your Edited CGI and Data Files

  • Upload all of the cgi files (.cgi) into your cgi-bin
  • Upload top.html, bottom.html, and thankyou.html into your cgi-bin

File Access Permissions

File access permissions must be set correctly for this program to run.  You must set the access permissions for each of these files.  Set all the .cgi files to 755.   Set top.html, bottom.html and thankyou.html to 777.

Creating the html forms for your mall products

First check out the sample mall page for an example of how to create the html for your mall. The following GENERIC example shows the form fields that are ABSOLUTELY REQUIRED. No specific ordering of fields is necessary but The name fields must match EXACTLY. The order of the first four fields MUST MATCH EXACTLY. Any other fields such as color, size, etc may be placed after ITEMNAME and before SUBMIT. See the DEMO for more examples.

REQUIRED FIELDS (order is not important)

  • action = the url of the supermall.cgi script
  • item = the name of the product
  • url = the url of the webpage this product is ordered FROM
  • cost = cost for each unit item
  • qty = QUANTITY of item
GENERIC HTML for ADD TO CART shopping cart button
 
<form method=POST action="supermall.cgi">
          <input type="HIDDEN" name="item" value="name of item">
<input type="HIDDEN" name="url" value="url of this items webpage">
<input type="HIDDEN" name="cost" value="unit cost of item">
 
INSERT OTHER FORM FIELD DATA HERE (style, color, other options)
 
Quantity <INPUT TYPE="TEXT" size="2" NAME="qty" value="1" ALIGN=left>
 
<INPUT TYPE="SUBMIT" VALUE="Add to Cart" ALIGN=middle>
</form>

Notes on Interfacing to Agents of Fortune

Edit the following lines inside of mailorder.cgi

#require "/full/path/to/payout.cgi";
#&payout;

Uncomment both lines and edit the full path to the payout.cgi file (which you should put in the agents cgi files directory btw)   There is a sample file (payout.cgi) in the tar archive that shows how Agent's payout.cgi file is configured to work with Supercart.  In this example I set primary affiliates to 10% of sales and secondary to 5%.  I also used their email address to keep track of the sales data inside of agents.

Make sure you call agents.cgi, payout.cgi, and mailorder.cgi from the SAME DOMAIN AND PORT!!!  These pass cookies and as you should already know you can't READ cookies from a different IP or port than you SET them.

Notes on Interfacing to Online Merchant Banks

You will need to splice both socket posting and data parsing routines/flags inside of mailorder.cgi.  Since there is very little continuity between one merchant bank to the next there is no code actually included in the file.  You will require an advanced programmer to interface your cart into a bank.   The routines for posting and parsing are already located inside of mastergate's (basictp.cgi) and you can use these to piece the routines together.

Interfacing with Authorize.net

Once you have setup an account with authorize.net you will need to replace some of the files in supercart with the special versions created and stored inside the supercart tarball inside the authorize.net folder.  They are mailorder.cgi, checkout.cgi, configure.cgi, and nothankyou.html.  Set permissions on the .cgi files to 755 and all others to 777.   Many of the configure variables are the same but there are some new ones dealing with your authorize.net account. 

  • $LOGIN="supplied by authorize.net";
  • $PASSWORD="supplied by authorize.net";
  • $TYPE = "PA";
  • $EMAILCUSTOMER = "TRUE";
  • $REJECTAVSMISMATCH = "TRUE";
  • $TESTREQUEST = "FALSE";
  • $DELIMCHARACTER = "|";
  • $ENCAPSULATE = "FALSE";

  • LOGIN
    Required for transactions other than test transactions.  This is the assigned Authorize.Net login id.

    PASSWORD
    Required for Credit or Post Authorization transactions. For details on the use of transaction types, see the Authorize.Net User's Guide.

    TYPE
    May be one of: NA (means Normal Authorization)
     AO (means Authorization Only)
     CR (means Credit)
     PA (means Post Authorization)

    EMAILCUSTOMER
    Set this value to "TRUE" if you want an email sent to the Buyer's E-mail(the value specified in the EMAIL field) notifying him of the transaction details.(The fields INVOICE AMOUNT METHOD DESCRIPTION CUSTID NAME ADDRESS CITY STATE ZIP COUNTRY PHONE FAX EMAIL and their values will be included in the email)

    ECHODATA
    If this field is not provided with a value of "TRUE", only the first 5 RESPONSE fields (see below) will be returned, otherwise all allowed fields provided in the request will be returned in the response.

    REJECTAVSMISMATCH
    If this field is not provided with a value of "TRUE", the transaction will be accepted if it is authorized by FDC, even if the AVS response is a mismatch.   Otherwise, the transaction must pass the "AVS test" with either a matching zip code, address, or both.

    TESTREQUEST
    If this field is provided with a value of "TRUE" the script will perform all validation functions except actually authorizing the transaction and storing it in the merchant's batch, regardless of whether the merchant's configuration is set to LIVE or TEST mode. In other words, the response would be equivalent to the merchant being in TEST mode

    DELIMCHARACTER
    If you want the RESPONSE FIELDS delimited by something other than the default (comma), provide the DELIMCHARACTER here.

    ENCAPSULATE
    If you want the response fields encapsulated in double quotes (ex. "response data"), provide this request field set to "TRUE"; otherwise, the response fields will not be encapsulated.