asp tutorials, asp.net tutorials, sample code, and Microsoft news from 15Seconds
Data Access  |   Troubleshooting  |   Security  |   Performance  |   ADSI  |   Upload  |   Email  |   Control Building  |   Component Building  |   Forms  |   XML  |   Web Services  |   ASP.NET  |   .NET Features  |   .NET 2.0  |   App Development  |   App Architecture  |   IIS  |   Wireless
 
Pioneering Active Server
 Power Search





Active News
15 Seconds Weekly Newsletter
• Complete Coverage
• Site Updates
• Upcoming Features

More Free Newsletters
Reference
News
Articles
Code Samples
Components
Tools
New
Free
Downloads
Vendors
FAQ
Feedback
Books
Links
DL Archives
Community
Messageboard
List Servers
Mailing List
WebHosts
Consultants
Tech Jobs
15 Seconds
Home
Site Map
Press
Legal
Privacy Policy
internet.commerce














internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

HardwareCentral
Compare products, prices, and stores at Hardware Central!


<HTML>
<HEAD>
<TITLE>ASPCharge Test Form</TITLE>
</HEAD>
<CENTER>
<H1>ASPCharge Test Form</H1>
</CENTER>
<%If Request.ServerVariables("Content_Length")>0 Then
  Set charger = Server.CreateObject( "ASPCharge.CC" )
  charger.ICVerifyCommand = "c:\inetpub\icverify\icverify.cmd"
  charger.Logging = "c:\inetpub\icverify"
  charger.DataDir = "c:\inetpub\icverify\datadir"
  charger.Timeout = 45
  charger.Name = Trim(Request("First")) + " " + Trim(Request("Last"))
  charger.ProductCode = Trim(Request("Product"))
  charger.Address = Trim(Request("Address1"))
  charger.City = Trim(Request("City"))
  charger.State = Trim(Request("State"))
  charger.Zip = Trim(Request("Zip"))
  charger.Country = Trim(Request("Country"))
  charger.Amount = Trim(Request("Cost"))
  charger.CCType = Trim(Request("CCType"))
  charger.CCNum = Trim(Request("CCNum"))
  charger.CCMonth = Trim(Request("CCMon"))
  charger.CCYear = Trim(Request("CCYear"))

  charger.TestMode=0
  
  charger.Go()
  	
  CCError=charger.LastError

  if charger.Cleared = "Y" Then
    Response.Write("Thank you," & Request("First") & " for purchasing a " & Request("Product") & ".  We appreciate your business.<P>")
	Application("NextTestLicense") = Application("NextTestLicense") + 1

    Response.Write("Your unique order number is " & Application("NextTestLicense"))
  elseif charger.Cleared = "N" Then
    Response.Write("I'm sorry your card was declined.")
  elseif charger.Cleared = "X" Then
    if charger.LastError = 1006 Then
	  Response.Write("ASPCharge detected a duplicate charge and did not charge the credit card.")
	else  
	  Response.Write("ASPCharge responded with a code of " & charger.LastError & "<BR>")
      Response.Write("The code: " & charger.LastErrorMsg)
	end if
  else
    Response.Write("This shouldn't ever be seen!")
  end if
  
  Response.Write("<P>")
  
else
%>
  <CENTER>
  <FONT SIZE="+3">Pretend to buy a Blue Squirrel Coffee Mug</FONT>
  <BR>
  <FONT SIZE="2" COLOR="Red">Not Real - Credit card will not be charged.<BR>Try valid or invalid information and see how ASPCharge responds.<BR>Note: ASPCharge will be in test-mode and will not contact the clearinghouse.<BR>These are just sample responses.  All messages can be customized.</FONT>
  <P>
  </CENTER>
  
  <FORM ACTION="<%=Request.ServerVariables("SCRIPT_NAME")%>" METHOD=POST>
  <table border=0 width=610>
	<tr>
    <th align=right>First:</th>
    <th align=left><INPUT type="text" size="20" name="First"></th>
    <td> </td>
    <th align=right>Last:</th>
    <th align=left><INPUT type="text" size="20" name="Last"></th>
	</tr>
	<tr>
    <th align=right>E-mail:</th>
    <th align=left><INPUT type="text" size="20" name="Email"></th>
    <td> </td>
    <th align=right>Phone:</th>
    <th align=left><INPUT type="text" size="20" name="Phone"></th>
	</tr>
	<tr>
    <th align=right>Address:</th>
    <th align=left><INPUT type="text" size="20" name="Address1"></th>
    <td> </td>
    <th align=right>Address:</th>
    <th align=left><INPUT type="text" size="20" name="Address2"></th>
	</tr>
	<tr>
    <th align=right>City:</th>
    <th align=left><INPUT type="text" size="20" name="City"></th>
    <td> </td>
    <th align=right>State:</th>
    <th align=left><INPUT type="text" size="20" name="State"></th>
	</tr>
	<tr>
    <th align=right>Postal Code:</th>
    <th align=left><INPUT type="text" size="20" name="Zip"></th>
    <td> </td>
    <th align=right>Country:</th>
    <th align=left><INPUT type="text" size="20" name="Country" value="United States"></th>
	</tr>
  </table>
  
  <INPUT TYPE="HIDDEN" NAME="Product" VALUE="Blue Squirrel Coffee Mug">
  <INPUT TYPE="HIDDEN" NAME="Cost" VALUE="12.95">
  
  <HR>
<DD><STRONG>Charge To:</STRONG>
<SELECT NAME="CCType">
<OPTION SELECTED="SELECTED" VALUE="MasterCard">MasterCard
</OPTION>
<OPTION VALUE="Visa">Visa
</OPTION>
<OPTION VALUE="American Express">American Express
</OPTION>
<OPTION VALUE="Discover">Discover Card
</OPTION>
<OPTION VALUE="Novus">Novus
</OPTION>
</SELECT>
<DD>
<INPUT TYPE="text" NAME="CCNum" SIZE=32 MAXLENGTH="120"> Credit Card #
<DD><select name="CCMon" size=1>
<option>(month)</option><option>01</option><option>02</option><option>03</option><option>04</option><option>05</option><option>06</option>
<option>07</option><option>08</option><option>09</option><option>10</option><option>11</option><option>12</option></select>
<select name="CCYear" size=1>
<option>(year)</option><option>97</option><option>98</option><option>99</option><option>00</option><option>01</option></select>
expiration date (month / year)
</DL>
<INPUT TYPE=submit VALUE="Register"> <INPUT TYPE=reset VALUE="Clear">
<%end if%>

</HTML>





email this code sample to a colleague

Related Products
A$Pcharge
A$PCharge is a COM wrapper for the ICVerify interface that allows you to charge credit cards from your Active Server Pages in real-time over a modem. A$PCharge also can communicate with TCP/IP credit card clearing networks, Epoch or CyberSource, with no additional software or hardware required.
[Top]


Support the Active Server Industry

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers