<!--#include file="md5alipay.asp"-->
<%
'/***************************************************************************************************************
	'* FileName:	Alipay.asp
	'* Author:		dboyzhang
	'* Version:		Ver 2.0.0 Beta2
	'* Contact_Me:	wangwang:dboyzhang
'****************************************************************************************************************/

Class creatAlipayItemURL
	'获得最终的购买url
	
	Public Function creatAlipayItemURL(t1,t2,t3,t4,t5,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,s14,s15,s16,s17,s18,s19,s20)
		Dim itemURL,str2CreateAc
		dim INTERFACE_URL,sellerEmail,keyCode,imgsrc,imgtitle
		'初始化各必要变量
		INTERFACE_URL	= t1+t2		'支付接口
		sellerEmail		= t2		'商户支付宝账户（改成你自己的）
		keyCode			= t3		'安全校验码（改成你自己的）
		imgsrc			= t4		'支付宝按钮图片
		imgtitle		= t5		'按钮悬停说明
		
		str2CreateAc	=	"cmd" & s1 & "subject" & s2
		str2CreateAc	=	str2CreateAc & "body" & s3
		str2CreateAc	=	str2CreateAc & "order_no" & s4
		str2CreateAc	=	str2CreateAc & "price" & s5
		str2CreateAc	=	str2CreateAc & "url" & s6
		str2CreateAc	=	str2CreateAc & "type" & s7
		str2CreateAc	=	str2CreateAc & "number" & s8
		str2CreateAc	=	str2CreateAc & "transport" & s9
		str2CreateAc	=	str2CreateAc & "ordinary_fee" & s10
		str2CreateAc	=	str2CreateAc & "express_fee" & s11
		str2CreateAc	=	str2CreateAc & "readonly" & s12
		str2CreateAc	=	str2CreateAc & "buyer_msg" & s13
		str2CreateAc	=	str2CreateAc & "seller" & sellerEmail
		str2CreateAc	=	str2CreateAc & "buyer" & s14
		str2CreateAc	=	str2CreateAc & "buyer_name" & s15
		str2CreateAc	=	str2CreateAc & "buyer_address" & s16
		str2CreateAc	=	str2CreateAc & "buyer_zipcode" & s17
		str2CreateAc	=	str2CreateAc & "buyer_tel" & s18
		str2CreateAc	=	str2CreateAc & "buyer_mobile" & s19
		str2CreateAc	=	str2CreateAc & "partner" & s20
		str2CreateAc	=	str2CreateAc & keyCode
		
		acCode			= 	MD5(str2CreateAc)

		itemURL			= 	INTERFACE_URL & "?cmd=" & s1
		itemURL			= 	itemURL & "&subject=" & Server.HTMLEncode(s2)
		itemURL			= 	itemURL & "&body=" & Server.HTMLEncode(s3)
		itemURL			= 	itemURL & "&order_no=" & s4
		itemURL			= 	itemURL & "&price=" & s5
		itemURL			= 	itemURL & "&url=" & s6
		itemURL			= 	itemURL & "&type=" & s7
		itemURL			= 	itemURL & "&number=" & s8
		itemURL			= 	itemURL & "&transport=" & s9
		itemURL			= 	itemURL & "&ordinary_fee=" & s10
		itemURL			= 	itemURL & "&express_fee=" & s11
		itemURL			= 	itemURL & "&readonly=" & s12
		itemURL			= 	itemURL & "&buyer_msg=" & Server.HTMLEncode(s13)
		itemURL			= 	itemURL & "&buyer=" & Server.HTMLEncode(s14)
		itemURL			= 	itemURL & "&buyer_name=" & Server.HTMLEncode(s15)
		itemURL			= 	itemURL & "&buyer_address=" & Server.HTMLEncode(s16)
		itemURL			= 	itemURL & "&buyer_zipcode=" & s17
		itemURL			= 	itemURL & "&buyer_tel=" & s18
		itemURL			= 	itemURL & "&buyer_mobile=" & s19
		itemURL			= 	itemURL & "&partner=" & s20
		itemURL			= 	itemURL & "&ac=" & acCode
		creatAlipayItemURL	=	get_AlipayjumptoURL(itemURL,imgtitle,imgsrc)
	End Function
		'私有接口,取得请求后返回的html
	Public Function getHTTPURL(strPath)
        Dim strTemp
		strTemp			= GetBody(strPath)
        getHTTPURL		= getHTTPURL'BytesToBstr(strTemp,"GB2312")
	End function
	Public Function get_AlipayjumptoURL(s1,s2,s3)
		dim responseText1
		responseText1	=	s1		'跳转地址
		get_AlipayjumptoURL=responseText1
	End Function
	Public Function get_AlipayButtonURL(s1,s2,s3)
		dim responseText1
		responseText1	=	responseText1 & "<a href='" & s1 & "' target='_blank'>"		'购买网址
		responseText1	=	responseText1 & "<img alt='" & s2 & "' src='"				'图片说明
		responseText1	=	responseText1 & s3											'图片地址
		responseText1	=	responseText1 & "' align='absmiddle' border='0'/></a>"
		get_AlipayButtonURL=responseText1
	End Function
End Class
%>