包含文件:alipay_payto.asp
<!--#include file="Alipay_md5.asp"-->
<%
Class creatAlipayItemURL
'获得最终的购买url
Public Function creatAlipayItemURL(t1,t4,t5,service,partner,sign_type,subject,body,out_trade_no,price,show_url,quantity,seller_email,notify_url,return_url,key,logistics_fee_1,logistics_fee,logistics_type_1,logistics_type,logistics_payment,logistics_payment_1,payment_type)
Dim itemURL
dim INTERFACE_URL,imgsrc,imgtitle
'初始化各必要变量
INTERFACE_URL = t1 '支付接口
imgsrc = t4 '支付宝按钮图片
imgtitle = t5 '按钮悬停说明
Count=16
mystr = Array("service="&service,"partner="&partner,"subject="&subject,"body="&body,"out_trade_no="&out_trade_no,"price="&price,"show_url="&show_url,"quantity="&quantity,"seller_email="&seller_email,"notify_url="¬ify_url,"return_url="&return_url,"logistics_fee_1="&logistics_fee_1,"logistics_fee="&logistics_fee,"logistics_type_1="&logistics_type_1,"logistics_type="&logistics_type,"logistics_payment="&logistics_payment,"logistics_payment_1="&logistics_payment_1,"payment_type="&payment_type)
Count=ubound(mystr)
For i = Count TO 0 Step -1
minmax = mystr( 0 )
minmaxSlot = 0
For j = 1 To i
mark = (mystr( j ) > minmax)
If mark Then
minmax = mystr( j )
minmaxSlot = j
End If
Next
If minmaxSlot <> i Then
temp = mystr( minmaxSlot )
mystr( minmaxSlot ) = mystr( i )
mystr( i ) = temp
End If
Next
For j = 0 To Count Step 1
value = SPLIT(mystr( j ), "=")
If value(1)<>"" then
If j=Count Then
md5str= md5str&mystr( j )
Else
md5str= md5str&mystr( j )&"&"
End If
End If
Next
md5str=md5str&key
' response.write md5str
sign=md5(md5str)
itemURL = itemURL&INTERFACE_URL
For j = 0 To Count Step 1
value = SPLIT(mystr( j ), "=")
If value(1)<>"" then
itemURL= itemURL & mystr(j) & "&"
End If
Next
itemURL = itemURL&"sign="&sign&"&sign_type="&sign_type
'response.write itemURL
creatAlipayItemURL = get_AlipayButtonURL (itemURL,imgtitle,imgsrc)
End Function
Public Function get_AlipayButtonURL(itemURL,imgtitle,imgsrc)
dim responseText1
responseText1 = responseText1 & "<a href='" & itemURL & "' target='_blank'>" '购买网址
responseText1 = responseText1 & "<img alt='" & imgtitle & "' src='" '图片说明
responseText1 = responseText1 & imgsrc '图片地址
responseText1 = responseText1 & "' align='absmiddle' border='0'/></a>"
get_AlipayButtonURL=responseText1
End Function
End Class
%>
集成用到的主要就是这两个文件,其他文件可以从这个地方下载。