Documentation
BATCH CREDIT CARD PROCESSING ENGINE:  V2.1

 

REALTIME PROCESSING INSTALLATION AVAILABLE


System Requirements

Misc notes regarding authorize.net

If you process cards from NON US countries you will want to set $REJECTAVSMISMATCH = "FALSE".  If you dont then it will reject ALL cards from foreign countries.

Do not bother setting the $TESTREQUEST to "TRUE"  the testmode is pretty much useless and you can VOID transactions easily enough through the virtual terminal login @ authorize.net.  If you set it to TRUE the cgi may not function correctly.

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.  Make sure you use the version for Authorize.net 3.0 since 2.5 is being phased out.  You can still download the Authorize.net V2.5 compatible version if you need it.
  • 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. 

  • $LOGIN="supplied by authorize.net";
  • $PASSWORD="supplied by authorize.net";
  • $TYPE = "NA";
  • $EMAILCUSTOMER = "TRUE";
  • $REJECTAVSMISMATCH = "FALSE";  
  • $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.

Upload Your Edited CGI and Data Files

  • Upload all the files into a directory you can execute from

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 the rest to 777.

Notes on Use

To execute the script simply login to telnet and run from the command line

perl batch.cgi

This is not really meant to be a super secure billing solution.  This is just a quick way to process bulk transactions.  You should NEVER leave billing databases on a web server or on any computer connected to the internet.  However, if you upload, execute, grab the output and delete the databases from your server in a short time the chances for anyone to intercept them are minimal.   You can also run this from your desktop if you have perl installed. 

The input.txt file is the database (comma delimited) containing the billing information you want to process.  The fields go in the following order

$NAME,$ADDRESS,$CITY,$STATE,$ZIP,$COUNTRY,$EMAIL,$PHONE,$METHOD,$CARDNUM,$EXPDATE,$AMOUNT

The output.txt file is the RESULTS from processing your database - it contains time/date stamps and STATUS messages (in case the card fails).

The fields used by authorize.net are described at the TOP of each database.  Please see authorize.net documentation for any confusion regarding the structure/syntax of the form fields and their required values.