Custom CGI Interface Specifications

To enable the custom CGI, go to the back office, the config menu, and the technical settings menu. Find the "Location of Custom CGI" item and enter the name of the custom CGI (e.g. custom.cgi). ShopSite assumes that the custum CGI exists within the shopping cart directory.
Location of Custom CGI.
If the file exists and is executable, thankyou.cgi will run it instead of running its own routine that prints out the customer receipt. Note: the CGI should reside in the shopping cart directory.

A sample perl custom CGI ships with ShopSite. It is custom-dump.pl and is located in the shopping cart directory. This CGI will display all the information that is passed to it.

After you leave technical settings, you will find a new option, Custom CGI, in the main config menu. Pressing this button will take you to the Custom CGI setup menu.

E-mail receipts to buyer, merchant?
Screen receipt for buyer?

Defaults are as shown -- which assumes that the CGI will not be writing to standard output (i.e. browser screen).

Interface

From the point of view of the CGI, it's running like any other CGI called with the POST method. It's input is a '&' delimited series of name value pairs (name=value) and the whole thing is URL-encoded.

The CGI should find the pairs, determine the name and value for each, and decode the name and value. The CGI can then do whatever CGIs do. Anything written to standard output will go to the server, etc.

The input is currently in five parts.

The first part is the original input to thankyou.cgi. Names and descriptions of the values.

prevlocation
The location (and QUERY method string) where the order entered the shopping cart system of CGIs.
sbid
Shopping basket id. A unique identifier for the shopping cart making the CGI calls.
storeid
The store identifier of the store being shopped. This is the same id as in the auth file. Store ids are unique at each host.
The next 11 items are those entered in by the customer in the "Your Shopping Cart" form.
PayType
PayType is payment method chosen by the customer in the Shopping Cart form. It is a digit that corresponds to the order of the payment types in the back office -> config -> Payment Types menu. E.G. PayType 0 is Visa, PayType 5 is C.O.D.
These differ according to the PayType. For Visa, pay1 is card number, pay2 is name on card, pay3 is Company, and pay4 is the expiration date. For PayType C.O.D. all of these will be '--'.
function
A guide to where to go inside thankyou.cgi. Usual value is OK.

The next block of pairs represents the settings file for the store. All names are prefaced by 'S-'. Many of these may be seen in the Technical settings menu.

S-bo_dir
URL of back office CGIs.
S-bo_reg_url
URL of back office CGIs.
S-bo_secure_url
Secure URL of back office.
S-bo_use_security
Use security in back office?
S-ccprocessor
Credit Card Processor Type.
S-customcgi
Location of Custom CGI.
S-datadir
Data directory.
S-from_addr
"From" address in e-mail receipts.
S-outputdir
Output directory.
S-outputurl
URL of store.
S-perl_loc
Location of PERL executable.
S-sb_dir
Shopping basket directory.
S-sb_prompt_comments
Prompt for comments?
S-sb_prompt_orderinst
Prompt for ordering instructions?
S-sb_reg_url
URL of shopping cart CGIs.
S-sb_secure_url
Secure URL of shopping cart.
S-sb_use_security
Use security in shopping cart?
S-sendmail_loc
Location of sendmail executable.

The next block of name value pairs come from an internal thankyou.cgi table. All are prefaced by 'F-'. Much duplication.

Items from the Checkout form.

The PayType stuff again:

Miscellaneous information:

The next block of name value pairs come from the record for this order in the orders database. Each name is prefixed by 'O-' and the name is the field name in the data base. Again, duplication.

O-Date
Date of the order.
O-OrderNum
Order number.

Items from the various forms:

Items for the shipping information. If the shipping information is the same as the billing information, these fields will have value '--'. PayType stuff: More form stuff: Last, some items not on the form.
O-NumItems
Number of items in this order.
O-RefName
Associate name, if the customer arrived at the store via an associate referral.
O-OrderData
Some binary coded garbage. Usually a couple of random bytes (BSDI, Linux) or nothing (Solaris).
O-Viewed
Whether the order has been viewed from the back office by the merchant. 'n' or 'y'.
Last, information for each of the products in the order from the basket db. Each name starts with 'B' and a two or more digit preface, which differs for each product. The products are numbered starting with '01'. So, for the first product (item) in the basket, the prefix will be 'B01-'.

The names and functions can be best understood by looking in the back office in the Products -> Add product form.


Back to Main Help Page | Search | Give Feedback
If you are not finding the help you need, please give detailed feedback.