<!--#include file="../../conn.asp"-->
<!--#include file="../../config.asp"-->
<!--#include file="classes/MediPayResponseHandler.asp"-->
<% dim  opayid

opayid=5
set rs=server.CreateObject("adodb.recordset")
rs.open "select opayid,opayname,opaypassword,opayrturl,opayparter from sdx_opay where opayid="&opayid,conn,1,1
payid=rs("opayname")
paypwd=rs("opaypassword")
payurl="http://"&Request.ServerVariables("HTTP_HOST")&"/"&rs("opayrturl")
payparter=rs("opayparter")
rs.close
set rs=nothing

%>
<%
'---------------------------------------------------------
'财付通中介担保支付成功显示页面示例，商户按照此文档进行开发即可
'---------------------------------------------------------

'平台商密钥
Dim key
key = payid

'创建支付应答对象
Dim resHandler
Set resHandler = new MediPayResponseHandler
resHandler.setKey(key)

'判断签名
If resHandler.isTenpaySign() = True Then
	
	Dim cft_tid
	Dim total_fee
	Dim retcode
	Dim status

	'财付通交易单号
	cft_tid = resHandler.getParameter("cft_tid")
	
	'金额金额,以分为单位
	total_fee = resHandler.getParameter("total_fee")

	'返回码
	retcode = resHandler.getParameter("retcode")

	'状态
	status = resHandler.getParameter("status")
	
	'------------------------------
	'处理业务开始
	'------------------------------ 

	'注意交易单不要重复处理
	'注意判断返回金额
	
	'返回码判断
	If "0" = retcode Then
		
		'买家付款成功
		If "3" = status Then
			
			Response.Write("支付成功")
		End If
	Else
		Response.Write("支付失败")
	End If
	
	'------------------------------
	'处理业务完毕
	'------------------------------
	
Else

	'签名失败
	Response.Write("签名签证失败")

	'Dim debugInfo
	'debugInfo = resHandler.getDebugInfo()
	'Response.Write("<br/>debugInfo:" & debugInfo & "<br/>")

End If


%>