%
const CVNDisplay="Yes"
const CVNRequired="No"
const xcardissuenumber="No"
const MYSITE="" ' CHANGE THIS TO BE YOUR WEB ADDRESS - ALWAYS HAVE A FORWARD SLASH AT THE END
const xEncryptkey="agabAhjBcG" ' YOU MUST CHANGE THIS TO MATCH THE xencryptkey SETTING IN THE SHOP$CONFIG.ASP FILE
const xlanguage="" ' INSERT DEFAULT LANGUAGE HERE
Const Creditcards="Visa,Mastercard,American Express"
Const Otherpayments="Check,Cash,Phone Order"
Const AllowCreditCards="Yes" ' Select credit Cards
const AllowOtherPayment="Yes" ' Other payment types
Const AllowInvalidCreditCards="No" ' validate credit card information
'**************************************************************************
' Version 6.50 obtain Payment details Avoid security popup
' Used when SSL is on a different Server.
' Goes to sslresult.asp Task=CC, task=NOCC, task=Cancel
' oid=nnn
' add solo, switch and new subroutine to validate credit cards
' Sept 11, 2004 fix setsess lang
'*************************************************************************
' Change this line
'
Dim PaymentURL, resultinfo
Dim Serror
Dim CardTypes(10),OtherTypes(10),OtherCount,CardCount
Parserecord creditcards, cardtypes, cardcount,","
Parserecord otherpayments, othertypes, othercount,","
PaymentURL= MYSITE & "sslresult.asp" ' to authorize payment
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 strvalidfrom,strocardissue
Dim sAction
dim strocardmm,strocardyy
dim websess
'
SetSess "CurrentURL","sslshopcheckout.asp"
GetOrderInfo ' get orderid
sError=Session("PaymentError") ' on return for authorization there may be an error
SetSess "PaymentError","" ' reset
sAction=Request.form("Action")
If sAction = "" Then
NewShopPageHeader ' put out normal header
DisplayForm() ' credit card form
NewShopPagetrailer ' trailer
Else
GetFormFields
ValidateData
if sError = "" Then
UpdateCreditInfo ' add payment to daat base
GenerateLink paymenturl & "?" & Resultinfo
'response.write PaymentURL & "?" & ResultInfo
else
NewShopPageHeader
DisplayForm
NewShopPageTrailer
end if
end if
Sub DisplayForm
Response.Write(largeinfofont & LangCheckout01 & largeinfoend & "
")
If SError<>"" then
Response.Write(errorfontstart & "
" & sError & errorfontend)
end if
AddCreditCard
DisplayOtherPayment
Displaycancelbutton
End Sub
'
Sub AddCreditCard
If AllowCreditCards<>"Yes" then exit sub
'AddCreditImages
Response.Write("
<% end sub Sub NewShopPageTrailer %> <% End Sub Sub GenerateSelectNV (iFieldnames,currentvalue,selectname, count,firstfield) ' Generates select with no values dim i %> <% end sub Function LanguageGet if session("Language")="" then Setsess "Language",xlanguage end if languageGet=Session("Language") end function '***************************************************** ' Validate credit cards ' VP-ASP 5.00 '***************************************************** Sub ShopValidatecreditcard (strocardno, strocardtype, serror) dim cctype, ctype, cclength, ccprefix, prefixes, lengths dim ccNumber, number, prefixvalid, lengthvalid, prefix Dim cccheck, length, result, qsum, x, ch, sum, checkcc dim testtype ccType = ucase(Left(StrocardType,1)) testtype=left(strocardtype,5) if testtype="DINER" then cctype=I ccnumber=strocardno ctype=ucase(cctype) select case ctype case "V" ' Visa cclength="13;16" ccprefix="4" case "M" ' Mastercard cclength="16" ccprefix="51;52;53;54;55" case "A" ' American express cclength="15" ccprefix="34;37" case "I" ' Diners cclength="14" ccprefix="300;301;302;303;304;305;36;38" case "D" ' discover/Novus cclength="16" ccprefix="6011" case "E" ' ? cclength="15" ccprefix="2014;2149" case "J" ' JCB cclength="15;16" ccprefix="3;2131;1800" case "C" ' Connect cclength="16" ccprefix="4539" case "S" ' Solo Switch cclength="16;18;19" 'VP-ASP 6.50 - added extra card lengths ccprefix="6759" case "B" ' Bankcard cclength="16" ccprefix="5610" case else cclength="" ccprefix="" end select prefixes=split(ccprefix,";",-1) lengths=split(cclength,";",-1) number=trimtodigits(ccnumber) prefixvalid=false lengthvalid=false if ccprefix<>"" then for each prefix in prefixes if instr(number,prefix)=1 then prefixvalid=true end if next else prefixvalid=true end if for each length in lengths if cstr(len(number))=length then lengthvalid=true end if next result=0 if not prefixvalid then result=result+1 end if if not lengthvalid then result=result+2 end if qsum=0 for x=1 to len(number) ch=mid(number,len(number)-x+1,1) 'response.write ch if x mod 2=0 then sum=2*cint(ch) qsum=qsum+(sum mod 10) if sum>9 then qsum=qsum+1 end if else qsum=qsum+cint(ch) end if next 'response.write qsum if qsum mod 10<>0 then result=result+4 end if if cclength="" then result=result+8 end if checkcc=result if checkcc<> 0 then SError= SError & LangCheckoutError02 & "
Please use this >Link if you are not automatically transferred. <% NewShopPageTrailer end sub Sub ParseRecord (record,words,wordcount,delimiter) Dim pos Dim recordl Dim bytex Dim temprec Dim maxwords Dim i maxwords = 10 temprec = record Dim maxentries pos = 1 wordcount = 0 ' make sure word array is null maxentries = UBound(words) For i = 0 To maxentries - 1 words(i) = "" Next recordl = Len(temprec) ' first eliminate leading blanks Do bytex = Mid(temprec, pos, 1) While bytex = " " And pos <= recordl pos = pos + 1 bytex = Mid(temprec, pos, 1) Wend ' copy word into word array While bytex <> delimiter And pos <= recordl words(wordcount) = words(wordcount) & bytex pos = pos + 1 bytex = Mid(temprec, pos, 1) Wend wordcount = wordcount + 1 pos = pos + 1 If wordcount > maxentries Then Exit Sub Loop Until pos > recordl End Sub '*********************************************************************** ' Generate a select list for months '************************************************************************* Function GenerateMM (name, currentvalue) dim value value="" generatemm=value end function '*********************************************************************** ' Generate a select list for Years '************************************************************************* Function GenerateYY (name, currentvalue) dim value dim i, year, currentyear, selected, yearpart value="" Generateyy=value end function 'VP-ASP 6.5.1 - clean invalid characters from strings - moved in here from shop$db.asp function CleanChars(strWords) 'VP-ASP 6.5.1 - exit function if strwords is nothing if strwords = "" then exit function end if if isnull(strwords) then exit function end if 'VP-ASP 6.50 - replace '' with ' in case function has been run twice on same string strWords = replace(strWords, "''", "'") dim badChars,i dim newChars, decodeChars badChars = array("select ", "drop ", "--", "insert into", "delete from","update ","xp_","union ","char(","@@","|","