Configuration
Introduction
The sample shopping application is configured, when installed, to run from
the WWWMRCH library and to locate all the IFS stream files in /WWWSERV/WEBDOCS/SHIPPED/MERCHANT.
The application can be run for testing from these locations, but if another
version of Merchant/400 is installed, these will be overwritten. If you
plan to use the sample application for a store of your own. please follow
the complete directions below.
The sample store is configured when installed to call a test processing
center at I/NET. This server will do minimal validation of the data passed
to it and will either return a success or failure, allowing the API to
be tested without incurring transaction fees. The test processing center
only accepts one test credit card. The credit card is: Master Card, 5499740000000032,
and expires 1/1999. This is not a real credit card.
Running the Sample Store (for Testing Only)
To run the sample from the installed locations, you will need to the following:
-
Add the WWWMRCH library to the Commerce Server/400 library list. To do
this you will need to add WWWMRCH to your library list using the ADDLIBLE
command before starting Commerce Server/400. You will to have Commerce
Server/400 configured to use the current library list as its library list
for this to work. This can be set by calling CHGWWWCFG INLLIBL(*CURRENT).
-
Add the WWWMRCH library to the Commerce Server/400 script libraries. Run
the ADDWWWSCPL command to do this. See the Script
Libraries documentation for more information.
-
Add the ability to serve both HTTP and SSL documents from the WWWMRCH library.
Run the CHGWWWCFG and WRKWWWDIR command to do this. See the setup
documentation for more information about enabling Commerce Server/400
to do SSL.
You should now be able to run the sample store. Call the following URL
to open the store from your browser (substituting your servers name for
www.server.com):
http://www.server.com/qsys/wwwmrch/merchant.
You should see the Order Form. Select one or more products to buy and click
"Cash Register". On the Cash Register screen, click "Yes". You should now
see a secured Product Check Out entry form. Select "Master Card" number
5499740000000032 with an expiration date of 1/1999. Fill in the rest of
the customer information and click "Complete Order". You then should see
a Thank You screen. You have just completed a test transaction.
Please do not enter a real credit card number, as this will be transmitted
to our test processor at I/NET , and we do not want to know your credit
card information.
If you want to test a transaction method of MERCH_METHOD2 (Anacom Communications),
you will need to follow the instructions listed above, plus the following:
-
Change the Transmission Method (GTMETH)
in the global configuration physical file (MGLOBALP) to MERCH_METHOD2.
-
Make sure the Merchant Name (GMRCID)
in the global configuration physical file (MGLOBALP) is set to "merchantid".
Our test processor will only accept requests from this Merchant Name.
Configuring the Sample Store for a Production Environment
To configure the store for a production environment you will need to move
all of the files to a new location and to configure the application to
find them. You will also need to change the IFS files that contain the
HTML that is displayed to represent your company. Last, you will need to
update the product database to contain the products or services that you
will have for sale in your online store.
The following is a list of steps that need to be performed to configure
a store.
-
Copy the WWWMRCH library. This library contains the various programs and
databases needed to run the application. You can copy the library using
the CPYLIB command. For the remainder of this documentation, it will be
assumed that the new library name will be MERCHANT. If it has another name,
just use that library in place of MERCHANT.
Note that the CPYLIB command will create the new objects with you as
the owner and WWWUSER with *ALL object authority. This authority will allow
the application to run, but you may want to change the owner back to WWWUSER.
-
Add the MERCHANT library to the Commerce Server/400 library list. To do
this you will need to add MERCHANT to your library list using the ADDLIBLE
command before starting Commerce Server/400. You will to have Commerce
Server/400 configured to use the current library list as its library list
for this to work. This can be set by calling CHGWWWCFG INLLIBL(*CURRENT).
If you added the WWWMRCH library to the library list earlier, you will
need to remove it. Note: the database files are found through the library
list, which causes a restriction that only one store can be running on
a single instance of Commerce Server/400.
-
Add the MERCHANT library to the Commerce Server/400 script libraries. Run
the ADDWWWSCPL command to do this. See the Script
Libraries documentation for more information.
-
Copy the contents of /WWWSERV/WEBDOCS/SHIPPED/MERCHANT directory to another
directory. For the remainder of this documentation, it will be assumed
that the new directory will be /WWWSERV/WEBDOCS/MERCHANT. If the document
root of your Commerce Server/400 is not /WWWSERV/WEBDOCS then you should
copy the file to a directory under your document root. This directory contains
the HTML that is displayed at the top and bottom of the application and
a variety of GIF files used by the application.
-
Change the IFS
File Path (GIFSPT) in the global configuration physical file (MGLOBALP)
to /WWWSERV/WEBDOCS/MERCHANT. This can be done with DFU.
-
Edit the new HTML header and footer files. See Editing
the Store Headers and Footers for more information.
-
Edit the MRCHMSGF
message file in the MERCHANT library. The location of the GIF files
used in the application are stored in message descriptions. Change the
message text for messages MRC0400 through MRC0406 to reflect the new location.
MRC0400 should look like the following: '<IMG SRC="/MERCHANT/MASTERCD.GIF"
alt="MasterCard" WIDTH=102 HEIGHT=63 BORDER=0>', if you copied the GIF
files into a merchant directory under your document root.
Other messages in this message file can be changed in a similar fashion
to customize your store.
-
Update the global
configuration physical file (MGLOBALP). This physical file contains
a single record that stores a variety of information that the application
needs to run. This also where you set many of the Merchant/400 API parameters,
like host service name, transmission method, partner host name, and partner
SSL port, that will be used for your credit card transactions.
-
Add the products or services that you will include in your store to the
Product
Description physical file (MPRODCTP)