Search Search

#1 worldwide
FREE Coding Lessons

since 1996
   THE BEST WAY to learn ASP & Asp.net!
Advertise Here!
click for details
Credits Host:
DiscountASP.net
Server Admin:
The "Team"
Contact Info.
Charles M. Carroll

my Blog
[prev. Lesson]  AOL detection w/BrowserHawk
     [next Lesson]  Reverse DNS lookups w/BrowserHawk

Detecting if the MS Wallet is supported

Many developers are chosing to use the Microsoft Wallet for securely taking customer credit card / payment information for their e-commerce site.  The MS Wallet is implemented as a client-side ActiveX control.  This means that in order for your customers to purchase using the MS Wallet, their browser needs to support ActiveX controls.

Unfortunately not all browsers have this ability, including several popular browsers such those from Netscape and Opera (not even in the latest versions).  Therefore if you are implementing the MS Wallet in your site, you'll want to make sure to provide an alternative form of secure payment for those visitors without support for this component.

Microsoft provides useful scripts for implementing the Wallet in your ASP code.  Unfortunately their scripts rely on the MS browser capability component, which frequently misidentifies browsers and ActiveX support in particular.  Therefore relying on the MS component for this information will result in situations where you send the Wallet to those who can not handle it, and  several cases where you do not send it to users when you should have..

To work around this problem, simply search through the MS scripts related to the Wallet and change all occurances of the class string "MSWC.BrowserType" in the CreateObject statements in the scripts to "cyScape.browserObj".  This will ensure that you accurately identify which users can support the Wallet and provide alternatives for those who can not.

For simple demonstration purposes, the following code snippet is provided.  For real-world uses of this technique start with the scripts available for MS Wallet and change the class string as instructed above.

   filename=/browserhawk/walletcheck.asp

<Test Script Below>


<html>

<head>
<title>Purchase</title>
</head>

<body>

<p>Payment info:<br>
<%
set bh = Server.CreateObject("cyScape.browserObj")
if bh.ActiveXControls then
   response.write "... send MS Wallet control"
else
   response.write "... send alternative code for collecting payment info"
end if
%></p>

<p>%&gt;</p>
</body>
</html>

Need a copy of BrowserHawk? See our section on Getting Started.

Copyright (c) 1999 cyScape, Inc.  All rights reserved.  This material may not be published, distributed, or reprinted without written consent from cyScape.

Chaz Wish List
Tall Tip $5
Grande Tip $20
Venti Tip $39
Tip Jar Thanks
2004 Thanks
2005 Thanks
HUGE Tip -love site