Documentation
VTERM:  V2.2

authnet.gif (6418 bytes)

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

Only a few variables have to be changed.  Many can be left at their default values.

configure.cgi

  • $mailprogram = '/var/qmail/bin/sendmail';  path to sendmail
  • $adminemail = "info\@yourdomain.com"; your email address
  • $help="/demo/vterm/help.html";   path to the help.html file
  • $referer = "yourdomain.com"; your domain name
  • $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
  • $remote = "secure.authorize.net"; do not change
  • $script = "/gateway/transact.dll"; do not change
  • $port = "443"; do not change:
  • $TYPE = "NA"; see below
  • $AUTHCODE = ""; see below
  • $EMAILCUSTOMER = "TRUE"; see below
  • $ECHODATA = "TRUE"; see below
  • $REJECTAVSMISMATCH = "FALSE"; see below
  • $TESTREQUEST = "FALSE"; 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 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.

Form actions

Change the form action of index.html to point to upload.cgi

Permissions

Set all the file permissions to 755.   Upload everything into your cgi-bin somewhere.

Creating a database to upload

You have two options.  You can create a database from scratch or upload an existing flatfile database from your desktop.  Note - the UPLOAD does not actually upload the database across the internet.  Rather it uploads directly into your web browser.  There is a DEMO database file containing 3 records included in the tarfile.  Use this to play around and test the software.

Click on the BROWSE button to locate your flatfile billing database.  The database must be created in a field delimited, flat file format using the PIPE | character to separate fields.  The fields must be arranged EXACTLY in the following order:

$NAME|$ADDRESS|$CITY|$STATE|$ZIP|$COUNTRY|$PHONE|$EMAIL|$ACCTNO|$ABACODE|$BANKNAME|

$CARDNUM|$EXPDATE|$AMOUNT|$REBILL|$CYCLE|$METHOD|$STATUS|

$RESPONSE

Each field is described below

FIELD Description
$NAME The cardholders name (first and last)
$ADDRESS Billing address
$CITY Billing city
$STATE billing state
$ZIP billing zipcode
$COUNTRY billing country (optional)
$PHONE billing phone number
$EMAIL billing email address
$ACCTNO checking account number (if billing by check)
$ABACODE checking routing number (if billing by check)
$BANKNAME checking bank name (if billing by check)
$CARDNUM credit card number (if billing by credit card)
$EXPDATE expiration date (if billing by credit card)  format is monthyear (eg:  0202)
$AMOUNT

 

amount to bill.  must be followed by 2 decimal places.  eg:  10.00
$REBILL days between billing periods.  eg:  30 for every 30 days
$CYCLE days since last billing.  when this value exceeds the REBILL value billing may occur
$METHOD method of billing.  values must equal one of the following:  ACH (for checking), Visa, MasterCard, Discover,Amex, Diners Club, JCB.  This field is case sensitive.
$STATUS values equal passed, failed or testing.  If the last billing attempt failed this will cause the entry to be highlighted in red.  This value can be re-initialized in the edit menu.  This field value is generated by the billing software.
$RESPONSE this field contains error messages returned by authorize.net.  The problem must be corrected in the edit menu in order to bill successfully.

 

Operation Notes

View Clients     Allows you to see your current billing database clients.  You can edit, delete, or bill individual records by using the PROCESS buttons.  Note that entries highlighted in YELLOW are ready for billing.  These accounts have been active for longer than their normal billing cycle (CYCLE > REBILL).  Accounts highlighted in RED have experienced problems with billing (card bounced, bad expiration date, card rejected, etc).  If you click on EDIT you can find out the specific problem with the account and correct it by switching the STATUS drop down menu to CLEAR STATUS.

DIFFERENT HIGHLIGHT COLORS MEAN DIFFERENT THINGS

HIGHLIGHTED YELLOW = CLIENT SCHEDULED TO BE BILLED
NO HIGHLIGHT = CLIENT NOT DUE FOR BILLING
HIGHLIGHTED RED = THERE IS A PROBLEM WITH THIS CLIENTS BILLING INFORMATION

Download      Dumps the current billing database to your browser as a flat file database.  You can then save the updated database to your desktop for future use.    Make sure that you DO NOT DIRECTLY SAVE the browser output from the DOWNLOAD feature.  CLICK DOWNLOAD, then VIEW SOURCE, then save the text file that your browser opens up.  Save as a txt file and not html.

Add Client     Allows you to manually add a new client to your billing database.

Edit    The edit radio box causes the process button for that client to pull up an edit form.  You can make changes to the individual client records and make them permanent by clicking on the submit button inside the edit menu.  It will also bring up any BILLING ERRORS previously experienced with the account being edited which can be corrected by the STATUS pull down menu by selecting "CLEAR STATUS".

Delete    The delete radio box causes the corresponding process button to delete the record from your billing database.  This is not reversible.  To delete ALL of the accounts and start over simply quit your browser.

Bill    The BILL radio box when checked causes the corresponding process button for that client to bill their credit card through your authorize.net account.  The billing will only occur when the billing CYCLE exceeds the REBILL time.  CYCLE is the number of days since the last billing occurred.  REBILL is the number of days between billing cycles.  Thus if CYCLE > REBILL the account will be highlighted in yellow unless there was a previous billing failure and it will be highlighted in red.  If you wish to alter the billing CYCLE use the edit menu to bump up the CYCLE value.  Also note that when you bill a client the CYCLE value will be reset to zero.  The CYCLE value will increment by 1 each day thereafter.  Accounts that are not highlighted in YELLOW (eg white or red) cannot be billed.

Notify    Clicking on the notify button will email billing messages to all the clients with bad billing data informing them that they need to submit corrected billing information.  It will send the error message contained in the $RESPONSE field so your clients will know what they need to do to correct their billing information.

If you want to start over     If, for whatever reason, you want to completely start over and clear out all the data simply quit your browser.  This will dump all of the information out of your browser.

Help Link     This pulls up the help menu.