<%
'获取MD5加密串 by 56770.kingdge 2008-1-8
Function BillSignMsg(inputCharset,pageUrl,bgUrl,version,language,signType,merchantAcctId,payerName,payerContactType,payerContact,orderId,orderAmount,orderTime,productName,productNum,productId,productDesc,ext1,ext2,payType,bankId,redoFlag,pid,key)
	signMsgVal=appendParam(signMsgVal,"inputCharset",inputCharset)
	signMsgVal=appendParam(signMsgVal,"pageUrl",pageUrl)
	signMsgVal=appendParam(signMsgVal,"bgUrl",bgUrl)
	signMsgVal=appendParam(signMsgVal,"version",version)
	signMsgVal=appendParam(signMsgVal,"language",language)
	signMsgVal=appendParam(signMsgVal,"signType",signType)
	signMsgVal=appendParam(signMsgVal,"merchantAcctId",merchantAcctId)
	signMsgVal=appendParam(signMsgVal,"payerName",payerName)
	signMsgVal=appendParam(signMsgVal,"payerContactType",payerContactType)
	signMsgVal=appendParam(signMsgVal,"payerContact",payerContact)
	signMsgVal=appendParam(signMsgVal,"orderId",orderId)
	signMsgVal=appendParam(signMsgVal,"orderAmount",orderAmount)
	signMsgVal=appendParam(signMsgVal,"orderTime",orderTime)
	signMsgVal=appendParam(signMsgVal,"productName",productName)
	signMsgVal=appendParam(signMsgVal,"productNum",productNum)
	signMsgVal=appendParam(signMsgVal,"productId",productId)
	signMsgVal=appendParam(signMsgVal,"productDesc",productDesc)
	signMsgVal=appendParam(signMsgVal,"ext1",ext1)
	signMsgVal=appendParam(signMsgVal,"ext2",ext2)
	signMsgVal=appendParam(signMsgVal,"payType",payType)
	signMsgVal=appendParam(signMsgVal,"bankId",bankId)
	signMsgVal=appendParam(signMsgVal,"redoFlag",redoFlag)
	signMsgVal=appendParam(signMsgVal,"pid",pid)
	signMsgVal=appendParam(signMsgVal,"key",key)
    BillSignMsg = Ucase(md5(signMsgVal))
End Function 

'功能函数。将变量值不为空的参数组成字符串
Function appendParam(returnStr,paramId,paramValue)
		If returnStr <> "" Then
		        If paramValue <> "" then
				        returnStr=returnStr&"&"&paramId&"="&paramValue
		        End if
		Else 
		        If paramValue <> "" then
			            returnStr=paramId&"="&paramValue
		        End if
		End if
		appendParam=ReturnStr
End Function

'功能函数。获取14位的日期
Function getDateStr() 
        dim dateStr1,dateStr2,strTemp 
        dateStr1=split(cstr(formatdatetime(now(),2)),"-") 
        dateStr2=split(cstr(formatdatetime(now(),3)),":") 
        for each StrTemp in dateStr1 
                If len(StrTemp)<2 Then  
                        getDateStr=getDateStr & "0" & strTemp 
                Else  
                        getDateStr=getDateStr & strTemp 
                End If  
        Next  
        For each StrTemp in dateStr2 
                If len(StrTemp)<2 Then  
                        getDateStr=getDateStr & "0" & strTemp 
                Else  
                        getDateStr=getDateStr & strTemp 
                End If 
        Next 
End function 
%>

