一个以电子商务为主的信息资讯门户网站——lk163.net
网站首页 | 信息资讯 | 网上商城 | 企业黄页 | 人才市场 | 供求信息 | 房产交易 | 二手市场
消费e店 | 时尚生活 | 在线影院 | flash动漫 | 范文频道 | 真情交友 | 电子相册 | 博客日志

您所在的位置:龙口在线 > 浏览正文
asp charge 的例程
lk163.net  发布:2008-8-19 22:37:00  来自:龙口在线  浏览:

  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("Im 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 shouldnt 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 >


(编辑:) 留言评论】【在线投稿】【打印网页】【关闭窗口】【↑顶部
+ 相关信息咨讯
·使用asp建设私人搜索引擎
·asp设计常见问题及解答精要
·asp提速技巧五则
·用asp.net实现的把本文推荐给好友功能
·asp中使用组件搜索
·php入门速成(1)
·php入门速成(2)
·php入门速成(3)
·对php文件上传存在漏洞的解决办法
·实例学习php之投票程序篇(一)
版权与免责声明:
1.凡本网注明来源为“龙口在线”的所有作品,包括文字与图片,未经本网授权不得转载。违反上述声明者,本网将依法追究法律责任。
2. 凡注明"来源:xxx(非本站)"的作品,均转载自其它媒体,本网转载的目的在于传播更多信息,此类稿件并不代表本网观点,本网不承担此类稿件侵权行为的直接责任及连带责任。
3. 如因作品内容、版权等需要同本网联系的,请在作品在本网发表之日起30日内联,否则视为放弃相关权利