% '************************************************************************** ' Version 5.00 Add Switch Solo Checks add validatecreditcards ' we are now secure and in different session to need to reget info' ' after getting credit card details we update database with them ' unless the user has cancelled, in that case we delete order and items ' from the database ' If no prices, bypass asking for anything ' April 20, 2003 '************************************************************************* ' Change these dim sqltemp dim ScancelAction Dim AllowOtherPayment Dim AllowCreditCards, AllowInvalidCreditCards Dim encryptkey dim strocardissue dim oid dim dbc dim rstemp Dim strOcardtype Dim strOcardno Dim strOcardname Dim strOcardexpires Dim strOcardaddress Dim strOOther Dim StroMore Dim StrOAuthorization dim strOCardCVN dim sAction Dim CardTypes(10) Dim CardCount Dim OtherTypes(10) Dim OtherCount Dim PaymentURL dim strvalidfrom dim strocardmm,strocardyy Dim gateways ' '******************************************************* ' Specify credit cards, non credit cards and whether credit cards should be checked '******************************************************** AllowCreditCards=Getconfig("xallowcreditcards") ' Select credit Cards AllowOtherPayment=Getconfig("xallowotherpayments") ' Other payment types AllowInvalidCreditCards=Getconfig("xallowinvalidcards") ' validate credit card information gateways=getconfig("xgateways") paymenturl=getconfig("xpaymenturl") EncryptKey=getconfig("xEncryptKey") ' Get encrypt key Setsess "currenturl","shopcheckout.asp" setsess "followonurl","shopthanks.asp" SetSess "PaymentURL",paymentURL ' cardcount=0 If getconfig("Xcreditcardtypes")<>"" then parserecord getconfig("xcreditcardtypes"),cardtypes,cardcount,"," end if othercount=0 If getconfig("XOtherpaymenttypes")<>"" then parserecord getconfig("xotherpaymenttypes"),othertypes,othercount,"," end if GetOrderInfo ' get orderid sError=GetSess("PaymentError") ' on return for authorization there may be an error SetSess "PaymentError","" ' reset If getconfig("xDisplayPrices")<>"Yes" then response.redirect GetSess("followonurl") ' go to shopthanks end if sAction=Request.form("Action") if sAction="" then sAction=Request.form("Action.x") end if sCancelAction=Request.form("Cancel") if sCancelAction="" then sCancelAction=Request.form("Cancel.x") end if '***************************************************** ' see they pushed button or want form displayed '*************************************************** If sAction = "" and sCancelaction="" Then ShopPageHeader ' put out normal header SetDefaultvalues DisplayForm() ' credit card form ShopPagetrailer ' trailer Else GetFormFields ValidateData if sError = "" Then UpdateCreditInfo ' add payment to daat base if paymentURL<>"" then ' if there is an authorization response.redirect PaymentURL & "?oid=" & oid else response.redirect GetSess("followonurl") ' go to shopthanks end if end if ShopPageHeader DisplayForm ShopPageTrailer end if '**************************************************** ' Put our credit card and non credit card form '************************************************* Sub DisplayForm If SError<>"" then shopwriteError sError end if Displaygateways Displaycreditcard DisplayOtherPayment Displaycancelbutton End sub Sub Displaygateways Performgateway If gateways="" Then exit sub exit sub dim i, files(10), filecount parserecord gateways,files, filecount,"," for i = 0 to filecount-1 Executefile files(i) next end sub ' Sub Executefile (filename) 'on error resume next server.execute(filename) if err.number>0 then shopwriteerror err.description shopwriteerror getlang("langmenufilename") & " " & filename end if end sub ' Sub DisplayCreditcard If AllowCreditCards<>"Yes" then exit sub shopwriteheader getlang("langCheckoutCreditCard") AddCreditImages Response.Write("
" end Sub ' '*************************************************** ' Non credit card form '*************************************************** Sub DisplayOtherPayment If AllowOtherPayment<>"Yes" Then exit sub shopwriteheader getlang("langCheckoutOtherPaymentType") Response.Write("" end Sub ' '*************************************************** ' Non credit card form '*************************************************** Sub DisplayCancelButton Response.Write("" end Sub Sub GetorderInfo ' Either comes on querystring or on rentry is in session variables oid=GetSess("oid") If oid="" then shoperror getlang("langCheckoutProcessed") end if end sub ' '********************************************************** ' did they select credit card or non credit card '********************************************************* Sub ValidateData ' see if user cancelled order dim rc, action dim cancelaction if sCancelaction <>"" then DeleteOrders ' delete order from database shoperror getlang("langCheckoutCancelled") end if If stroCardtype=getlang("langCommonSelect") then stroCardtype="" end if if stroOther=getlang("langCommonSelect") then stroOther="" end if If stroOther="" and stroCardType="" then sError=getlang("langCheckoutError01") & "