TMMOrder Instructions

You must provide several options to this script as hidden fields on the submission form. This will allow the script to operate in a way most compatible with your site.

Required Administrative Fields

The following fields are required. If they are not present, this error message will be displayed.

Optional Administrative Fields

The following fields allow finer control over the behavior of the script.

Required User Input Fields

The following fields must be entered by the user or the script will generate an error.

You can also make other fields required. In order to do this, make a hidden field called [name]_required where [name] is the name of the field. For instance, to require the user to enter the last_name field, use

 <input type="hidden" name="last_name_required" value="true"> 

Items

The following fields are required for each item:

Tax

The following is how to specify tax rates

Shipping

If you want to give the option to use an alternate shipping address, simply add a checkbox named "diffship" as in this example:

 Check here if you want this order shipped to a different address:
    <input type="checkbox" name="diffship"> 

Choose one of the following methods for determining shipping rate. The methods are listed in order of precedence; if two methods are used, the one of higher precedence will be the one that actually determines the rate for shipping.

Returning to CGI Scripts

It is possible to make the Total Merchant Manager Virtual Terminal return directly to result_url instead of printing the validation information and then dumping the appropriate HTML. This is useful if you want to return to a CGI script, such as one that will add a user to a database. If it is necessary to pass variables based on the user input, the following methods of setting variables to pass through the TMM Virtual Terminal are available:

These will be passed through as POST variables USER1 - USER9. passthruX corresponds to USERX.

Total Merchant Manager returns the following variables:

These indicate status of validation (Y is validated, N is not), and the approval code if the card was validated. TMM does not return the credit card number unless there is a secure URL whose SSL certificate matches the Merchant Name. Contact TMM for more information.

Note on result_url and result_url_unverified

The HTML page pointed to by result_url or result_url_unverified should not be a full HTML page, but rather the latter half of one. The output of the script will print out the beginning tags, and state whether the credit card was validated or not, then dump the HTML code from either result_url or result_url_unverified as appropriate.

The above is only true if no_print_validated is unset. If no_print_validated is set, result_url must be either a full HTML page or a CGI script, and result_url_unverified is ignored.

See the section Returning to CGI Scripts above for more information.


This script was written by Riad Wahby (rsw@mit.edu). I provide no warranties of any kind. Any damage done by this script is not my responsibility. If you have any questions or suggestions for improving this script, please mail them to me.

TMMOrder version 1.0

The newest version is always available at ftp://positron.mit.edu/pub/tmmorder.