Table Suffix |
Purpose |
_basket |
Stores customer shopping cart data |
_dept |
Contains dept_id and descriptions for departments |
_dept_prod |
Contains entire list of _products by dept_id |
multi_val_attr |
An optional set of attributes describing each product |
_promo_cross |
Used for promotional cross-sale of products |
promo_price |
Stores promotional price for promotional sales |
_product |
Contains product information and price |
_receipt |
After a sale, the customer's order and shopping cart are converted to a receipt |
_receipt_item |
Tracks in detail each item purchased and the price paid |
_single_val_attr |
An optional set of attributes describing each product |
_variant |
A combination of the data in _product and the two _val_attr tables that assigns a different SKU number to every variation of product available for customers to purchase |
Figure 3 OrderForm Properties
shipping_method
ship_to_name
bill_to_name
ship_to_street
bill_to_street
ship_to_city
bill_to_city
ship_to_state
bill_to_state
ship_to_zip
bill_to_zip
ship_to_country
bill_to_country
ship_to_phone
bill_to_phone
Figure 8 Post-order Processing
sqlText = MSCSQueryMap.AVS_Result.SQLCommand
sqlText = Replace(sqlText, ":1", mscsorderForm("vpos_cc_transaction_id"))
cmdTemp.CommandText = sqlText
Set rsAVS = Server.CreateObject("ADODB.Recordset")
rsAVS.Open cmdTemp, , adOpenForwardOnly, adLockReadOnly
if rsAVS.EOF then
vpos_avs_verify = ""
else
vpos_avs_verify = Cstr(rsAVS("navsresult").value)
end if
REM Only do AVS for US customers
if mscsorderForm.bill_to_country = "US" or mscsorderForm.bill_to_country = "USA" then
REM 0 - resultUnavailable; This result is not processed in this script
REM 4 - fullMatch; No processing required
if vpos_avs_verify = "1" or vpos_avs_verify = "3" then
if not IsNull(mscsorderForm("bill_to_email")) then
HandleAVS = True
REM 1 - noMatch
REM 3 - postalCodeMatchOnly
REM - This is where we send e-mail to the customer
REM - Get the order ID
real_order_id = mscsOrderForm.order_id
REM - send e-mail to the shopper with the order id
Set ShopperMail = Server.CreateObject("CDONTS.NewMail")
ShopperMail.From = "Support@DigitalMarketplace.com"
ShopperMail.To = mscsorderForm.bill_to_email
ShopperMail.Subject = "Credit Card Address Verification"
ShopperMail.Body = "This is the body of the e-mail message sent to the
shopper."
ShopperMail.Send
Set ShopperMail = Nothing
else
REM - No valid e-mail address and the address did not match.
errorList.Add("We can not complete your order. You did not supply a
valid e-mail address and the address you supplied did not
match your credit card address.")
end if
end if
end if
if HandleAVS = True then
order_id = -1
else
REM Save the order id before we delete it
order_id = mscsOrderForm.order_id
end if
Figure 9 Sample Use of AVS
<%@ Language=VBScript enablesessionstate=false %>
<!--#INCLUDE FILE="i_shop.asp" -->
<% if Request.Form("order_id") = "" then %>
<html>
<head>
<body>
<h1>E-Mail Confirmation of Address Verification</h1>
<form method="post" action="EmailConfirmation.asp">
<table>
<tr>
<td>Shopper ID:</td>
<td><input name="shopper_id"></td></tr>
<tr>
<td>Order Confirmation Number:</td>
<td><input name="order_id"></td></tr>
</table>
<input type="submit" value="Submit Verfication">
</form>
<p>
Copy and paste the shopper ID and order ID sent to you in e-mail. You may
do this now, or access this page at a later time using the URL sent in the
confirmation e-mail message.</p>
<%Else
Response.Redirect "confirmed.asp?" & mscsPage.URLShopperArgs("order_id",
Request.form("order_id"),"shopper_id",Request.Form("shopper_id"))
End If%>
</body>
</html>