Documentation
FORM MAIL 2000:  V2.1

 


System Requirements

  • Unix, Lynyx or NT operating system
  • Perl 5 with sockets library installed
  • Sendmail
  • Secure Webspace with CGI capability recommended
  • Merchant Account with Online Validation and ability to communicate through cgi interface REQUIRED for realtime validation

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

  • $thankyoupage = "/path/to/thankyou.html";  this is the thankyou page for a good transaction
  • $badcard = "/path/to/badcard.html";  this is the error page if credit card is bad
  • $mailprog = '/var/qmail/bin/sendmail';  path to sendmail
  • $adminemail = "info\@yourdomain.com"; your email address
  • $validation = "realtime";  set to realtime for realtime validation or to "syntax" for syntax only validation
  • $referer = "yourdomain.com"; your domain name
  • $remote = "www.authorize.net"; do not change
  • $script = "/scripts/authnet25/AuthRequest.asp"; do not change
  • $port = "80"; do not change
  • $LOGIN="provided by authorize.net"; see below
  • $PASSWORD="provided by authorize.net"; see below
  • $DESCRIPTION = "whatever"; set to a description of your product you are selling
  • $TYPE = "PA"; see below
  • $AUTHCODE = "whatever"; see below
  • $EMAILCUSTOMER = "TRUE"; see below
  • $ECHODATA = "TRUE"; see below
  • $REJECTAVSMISMATCH = "TRUE"; see below
  • $TESTREQUEST = "TRUE"; see below
  • $DELIMCHARACTER = "|"; see below
  • $ENCAPSULATE = "FALSE"; see below

    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.

 

The order page

You will probably want to edit the $amount variable inside the first form field and make it a hidden form or a option select menu - the $amount must be a number followed by 2 decimal points (i.e. 1.00 or 1.23) not (1.1 or 1.0).

thankyou.html and error.html

As you probably have guessed the thankyou.html page is returned if an order passes all error checks and the card is approved, error.html is returned otherwise.  You can simply cut and paste your custom html into each of these files.

File Access Permissions

File access permissions must be set correctly for this program to run. The table below lists the permissions of each file which are to be set by the unix command ( chmod ) used to set the correct access permissions. You must set the access permissions for each of these files.  install.cgi will set these automatically.  Set validate.cgi and configure.cgi to 755 and the rest to 777.