网站建设| 数据库类| 图形图象| 程序设计| 现代办公| 操作系统| 考试认证| 网络技术| 软件工程| 电脑相关| 文学作品
网站开发| 网页制作| 操作系统| 图象图形| 考试认证| 数据库类| 程序设计| 硬件技术| 现代办公| 网络技术| 笑话频道
 
您的位置: 电脑书库首页-> 电脑文摘-> 网站开发-> ASP/ASP.NET-> ASP Charge 的例程

ASP Charge 的例程
作者:佚名 来源:InterNet 加入时间:2003-7-21
相关文章 相关书籍:

  ASP Charge为一组件(又是外国人的),你可以在本网页的组件搜索中找到它。下面是它的一个使用例子。


< 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 >



[文章录入员:lpc]

相关文章 相关书籍:
本站推荐内容

近期主机类热搜关键词:
美国服务器 美国服务器租用 海外服务器租用 国外服务器租用

ASP/ASP.NET
ASP/ASP.NET
PHP技术
JSP技术
XML技术
CGI/PERL
WEB服务器
WordPress专题
其它
电脑教程阅读排行
·用ASP连接数据库
·ASP基础
·使用Database Acces...
·让网站活起来(1)
·创建一个简单的ASP页
·创建HTML表格
·初学者必读 ASP运行环境的搭建
·ASP中FSO的神奇功能
·VBScript 基础 使用条件...
·VBScript 基础 VBSc...