uShopOrderCustomCGI.class
The uShopOrderCustomCGI applet is an order form which collects the
customer's personal and payment information and then securely sends the
information to your secure server. It is similar to the other uShop order
applets, except this order applet allows to you to configure:
- Whether you want the "Ship To" section or not.
- Whether you want the credit card fields or not.
- The text on each of the labels.
- And whether the fields are required or not.
To use this applet, you must have configured the ushop_cgiscript.pl in
your cgi directory on your secure server.
See also ushop_cgiscript.pl.
In addition, this applet also allows you to setup shipping, tax, and payment
options as described below.
Parameters
- scriptpath - The full path to the ushop_cgiscript.pl on your server. Example:
"http://www.mystore.com/cgi-bin/ushop_cgiscript.pl".
- states - This parameter lets you specify a list of states to which orders
can be sent. Separate each state in the list with a comma. The list
can be as long as you like. The default value is:
"AK,AL,AR,AZ,CA,CO,CT,DC,DE,FL,GA,HI,IA,ID,IL,IN,KS,KY,LA,MA,MD,ME,MI,
MN,MO,MS,MT,NC,ND,NE,NH,NJ,NM,NY,NV,OH,OK,OR,PA,RI,SC,SD,TN,TX,UT,VA,VT,
WA,WI,WV,WY,Other".
- countries - This parameter lets you specify a list of countries to which orders
can be sent. Separate each country in the list with a comma. The list
can be as long as you like. The default value is: "United States".
- taxrate - The default tax rate. Specify this as a value 0.00 through 1.00
(ie. "0.06" or "0.07") - Or use a percent (%) sign to specify a value
of 0.00% through 100.0% (ie. "6.0%" or "7.25%")use a percent (%) sign.
- taxtable - This parameter allows you to override the default tax rate for
customers from specified states. That is, in this parameter you
can specify special tax rates for specific states. The format
should be "<state>=<taxrate>,<state>=<taxrate>,...".
You can specify as many states as you want. Example: "FL=6.0%,TX=7.0%"
would charge customers from Florida and Texas tax rates of 6% and 7%,
respectively. Note that the State abreviations should match those specified
in the "states" parameter. If you do not want to use a tax table, set this
value to "NONE".
- taxmenu - This parameter allows you to specify the tax rates for a specified state.
The list of tax rates specified in this "taxmenu" parameter will appear in
a drop-down mene from which the customer must chose if he/she is from the
specified state. The format of this parameter is <state>,<taxrate1>,
<taxrate2>,<taxrate3>,....and so on. Where the first value specifies
the state that will be charged tax and the following values are the comma-separated
tax rates for that state. If you do not want this taxmenu, set this value to
"NONE".
- taxnote - This parameter works in correlation to the "taxmenu" parameter and allows you
to specify instructions for the taxmenu, such as: "*Customers in FL must
select the tax rate for their area."
- shipping - This parameter allows you to specify what shipping methods are
available and how to calculate the shipping for each method. See
the page on shipping setup
for additional information on setting up Shipping.
- handling - This parameter allows you to specify a default handling fee that
will be added to all orders. Example: "$2.00" would charge
customers an additional $2.00 per order.
- handlingtable - This parameter allows you to override the default handling
rate for customers from specified countries. That is, in this
parameter you can specify special handling fees for specific
countries. The format should be "<country>=<handlingfee>,
<country>=<handlingfee>,...". You can specify as many countries
as you want. Example: "USA=$1.00,Canada=$1.00" would charge customers who
live in the USA or in Canada a $1.00 handling fee. Note that the Country
names should match those specified in the "countries" parameter.
- payment - This parameter lets you specify a list of payment methods that
you accept. Separate each method with a comma. Example: "Visa,
Master Card, Discover, COD" would allow customers to choose
to pay by Visa, Master Card, Discover, or COD.
- validate - This parameter lets you specify whether you want to let uShop
validate the credit card information before sending the order.
uShop has the ability to validate credit card numbers by verifying
the number of digits, checking the prefix, and performing a mod 10
checksum check on the card numbers. Supported credit card types
are MasterCard, Visa, Amex, Diners Club/Carte Blanche, Discover,
enRoute, and JCB. Set this parameter to "YES" is you want to
validate the card numbers. Otherwise, set this parameter to "NO".
The default value is "NO".
- popupwindow - This parameter allows you to specify whether you want a enable
a pop-up window to display error messages. That is, if you set this value
to "YES", then any messages to be displayed will be displayed in a pop-up
window - such as a message to indicate "You must fill in your name". If you
do not want to use a pop-up window, set this parameter to "NO". The default
value is "YES".
- message - An optional message that will be included on the bottom of the
order receipt that is sent to the customer.
- return_url - This parameter lets you specify a URL to be used as a "BACK" link
on the order receipt page. That is, if you specify a full URL here,
uShop will add a "BACK" link on the bottom of the order receipt page
to link to the specified URL. Example: "http://www.uburst.com".
- thankyou_url - Instead of letting uShop create an order receipt page after an
order is placed, this parameter lets you specify a URL of a custom
thankyou page (or any web page) that you want to appear after an
order is place. Example: "http://www.uburst.com".
- clearcart - This parameter specifies whether to clear the shopping cart
and order form after the customer has submitted the order. Valid
values are "YES" or "NO". The default value is "NO".
- textcolor - The text color of the applet. You can specify an
RGB value separated by commas ("integer,integer,integer" where
each integer is a value between 0 and 255) or specify one of
the predefined colors: white, black, lightGray, gray, darkGray,
red, green, blue, yellow, magenta, cyan, pink, and orange. The
default value is "white".
- background - The background color of the applet. You can specify an
RGB value separated by commas ("integer,integer,integer" where
each integer is a value between 0 and 255) or specify one of
the predefined colors: white, black, lightGray, gray, darkGray,
red, green, blue, yellow, magenta, cyan, pink, and orange. The
default value is "white".
- shippingfields - This parameter allows you to specify whether you want to
use the separate shipping address fields. If you set this parameter
to "YES", then the "Ship To" data entry fields are displayed. If
you set this parameter to "NO", then the "Ship To" data entry fields
are hidden. The default value is "YES".
- ccfields - This parameter allows you to specify whether you want to use the
credit card fields. If you set this parameter to "YES", then the
three credit card fields are displayed (name on card, card number,
and expiration date). If you set this parameter to "NO", then the
credit card fields are hidden. The default value is "YES".
Configuring the Labels
As shown in the example below, there are 20 field labels that can be configured. The parameter
names are "LABEL1", "LABEL2", "LABEL3",...., "LABEL20". And for each parameter you can specify
any text you want to be used as the label. If you want to make the fields required, then
just start each required field with an asterisk (*) - again as shown below. NOTE THAT
certain fields are predefined since tax and shipping calculations are based on them. That is,
"LABEL3" should always refer to an email address, "LABEL7" and "LABEL15" should always refer
to the State, "LABEL9" and "LABEL17" should always refer to the Country, and the credit card
fields ("LABEL18", "LABEL19", and "LABEL20") should always refer to the name on the credit card,
credit card number, and the expiration date, respectively.
Note: Optional parameters are in italics
Example
This order form example has been setup:
- To send the order information to the ushop_cgiscript located in our cgi-bin directory.
- To accept Visa, Master Card, Discover, and American Express payment methods.
- NOT to validate credit card numbers.
- To charge no tax, except for customers from Florida - who are charged 6% or 6.5% sales tax.
- To allow 4 shipping methods: UPS based on subtotal, FED EX based on total weight, US Air Mail based
on quantity and Over Night at a flat rate of $20.00.
- To charge no handling fees for customers in the US, a $1.00 handling fee for customers from Canada,
and a $5.00 handling fee for customers other countries.
- To add the message "Thank you for shopping with us." to all order receipts.
- To add a BACK link to "http://www.uburst.com" on the order receipt page.
- NOT to clear the shopping cart when the order is place.
- To use a pop-up window to display messages to the customer.
- And to have a light gray background color with black text.
<APPLET CODE = "uShopOrderCustomCGI.class" WIDTH=460 HEIGHT=845>
<PARAM NAME=scriptpath VALUE="https://www.uburst.com/cgi-bin/ushop/ushop_cgiscript.pl">
<PARAM NAME=states VALUE="AK,AL,AR,AZ,CA,CO,CT,DC,DE,FL,GA,HI,IA,ID,IL,IN,KS,KY,
LA,MA,MD,ME,MI,MN,MO,MS,MT,NC,ND,NE,NH,NJ,NM,NY,NV,OH,
OK,OR,PA,RI,SC,SD,TN,TX,UT,VA,VT,WA,WI,WV,WY,Other">
<PARAM NAME=countries VALUE="UNITED STATES,CANADA,UNITED KINGDOM,
ANTIGUA AND BARBUDA,ARGENTINA,AUSTRALIA,AUSTRIA,BAHAMAS,
BAHRAIN,BARBADOS,BELGIUM,BERMUDA,BRAZIL,BRUNEI DARUSSALAM,
BULGARIA,CANADA,CAYMAN ISLANDS,CHILE,CHINA,COLOMBIA,CONGO,
COSTA RICA,CROATIA (local name: Hrvatska),CUBA,CYPRUS,
CZECH REPUBLIC,DENMARK,EGYPT,FALKLAND ISLANDS (MALVINAS),
FINLAND,FRANCE,GERMANY,GIBRALTAR,GREECE,GREENLAND,HONG KONG,
HUNGARY,ICELAND,INDIA,IRELAND,ISRAEL,ITALY,JAMAICA,JAPAN,
JORDAN,KENYA,KUWAIT,LEBANON,LIECHTENSTEIN,LITHUANIA,LUXEMBOURG,
MALAYSIA,MALTA,MEXICO,MOLDOVA (REPUBLIC OF),MONACO,MOROCCO,
MOZAMBIQUE,NEPAL,NETHERLANDS,NEW ZEALAND,NORWAY,OMAN,PAKISTAN,
PANAMA,POLAND,PORTUGAL,ROMANIA,RUSSIAN FEDERATION,SAUDI ARABIA,
SEYCHELLES,SINGAPORE,SLOVAKIA (Slovak Republic),SLOVENIA,
SOUTH AFRICA,SPAIN,SRI LANKA,SUDAN,SWEDEN,SWITZERLAND,TAIWAN,
PROVINCE OF CHINA,THAILAND,TURKEY,UKRAINE,UNITED ARAB EMIRATES,
UNITED KINGDOM,UNITED STATES,VENEZUELA,VIRGIN ISLANDS (BRITISH),
VIRGIN ISLANDS (U.S.),YEMEN,YUGOSLAVIA,Other">
<PARAM NAME=taxrate VALUE="0.00%">
<PARAM NAME=taxtable VALUE="NONE">
<PARAM NAME=taxmenu VALUE="FL,6.00%,6.50%">
<PARAM NAME=taxnote VALUE="*Customers in FL must select the tax rate for their area.">
<PARAM NAME=shipping VALUE="UPS,BY_SUBTOTAL,20=$5.00,35=$7.00,50=$10.00,$15.00;
FED EX,BY_WEIGHT,10=$5.00,20=$10.00,$25.00;
US Air Mail,BY_QUANTITY,3=$3.00,6=$5.00,$7.50;
Over Night,FLAT_RATE,$20.00">
<PARAM NAME=handling VALUE="$5.00">
<PARAM NAME=handlingtable VALUE="UNITED STATES=$0.00,CANADA=$1.00">
<PARAM NAME=payment VALUE="Visa,Master Card,Discover,American Express">
<PARAM NAME=validate VALUE="NO">
<PARAM NAME=popupwindow VALUE="YES">
<PARAM NAME=message VALUE="Thank you for shopping with us.">
<PARAM NAME=return_url VALUE="http://www.uburst.com">
<PARAM NAME=thankyou_url VALUE="NONE">
<PARAM NAME=clearcart VALUE="NO">
<PARAM NAME=textcolor VALUE="black">
<PARAM NAME=background VALUE="208,208,208">
<PARAM NAME=shippingfields VALUE="YES">
<PARAM NAME=ccfields VALUE="YES">
<PARAM NAME=LABEL1 VALUE="*Name:">
<PARAM NAME=LABEL2 VALUE="*Company:">
<PARAM NAME=LABEL3 VALUE="*Email:">
<PARAM NAME=LABEL4 VALUE="*Street:">
<PARAM NAME=LABEL5 VALUE="">
<PARAM NAME=LABEL6 VALUE="*City:">
<PARAM NAME=LABEL7 VALUE="*State:">
<PARAM NAME=LABEL8 VALUE="*Zip Code:">
<PARAM NAME=LABEL9 VALUE="*Country:">
<PARAM NAME=LABEL10 VALUE="*Phone:">
<PARAM NAME=LABEL11 VALUE="Ship To:">
<PARAM NAME=LABEL12 VALUE="Street:">
<PARAM NAME=LABEL13 VALUE="">
<PARAM NAME=LABEL14 VALUE="City:">
<PARAM NAME=LABEL15 VALUE="State:">
<PARAM NAME=LABEL16 VALUE="Zip Code:">
<PARAM NAME=LABEL17 VALUE="Country:">
<PARAM NAME=LABEL18 VALUE="Name On Card:">
<PARAM NAME=LABEL19 VALUE="Credit Card Number:">
<PARAM NAME=LABEL20 VALUE="Expiration Date:">
</APPLET>