<!--#include file="Connection.Asp"-->
<!--#include file="MD5.asp"-->
<!--#include file="PayKey.Asp"-->
<%
Dim v_oid,v_pstatus,v_amount,v_moneytype,v_md5str,v_pmode,text,md5text,Rs,zhuangtai
v_oid=request("v_oid")
v_pstatus=request("v_pstatus")
v_amount=request("v_amount")
v_moneytype=request("v_moneytype")
v_md5str=request("v_md5str")
v_pmode=request("v_pmode")

'md5校验

text = v_oid&v_pstatus&v_amount&v_moneytype&key

md5text = Ucase(trim(md5(text)))
if md5text<>v_md5str then
	zhuangtai = "<font color=red>在线支付失败!</font>"	'支付失败
else
	'商户系统的逻辑处理（例如判断金额，判断支付状态，更新订单状态等等）.......
  if v_pstatus=20 then
  SendFMoneyToUser'支付成功
  zhuangtai = "<font color=red>在线支付已经支付成功</font>"
  else
	zhuangtai = "<font color=red>在线支付失败!</font>"	 '支付失败
  end if
end if


'更新订单状态,更新用户点数
Sub SendFMoneyToUser
Set Rs=Conn.ExeCute("Select * From JaNeed WHERE V_oid='"&v_oid&"' AND Stat<>1") '查找是否存在此未冲值的订单
If not Rs.eof then
Conn.ExeCute("UPDATE [JaUser] SET JaMonery=JaMonery+"&Rs("JaMm")&" WHERE JaUid='"&Rs("JaUid")&"'") '给用户冲值
Conn.ExeCute("UPDATE [JaNeed] SET Stat=1 WHERE V_oid='"&v_oid&"'") '更新订单状态
End If
Rs.close
Set Rs=Nothing
End Sub
Conn.close
Set Conn=Nothing
%>
<link href="../style/plady/css.css" rel="stylesheet" type="text/css" />
<table width="32%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td height="5"><img src="../style/plady/t_d_l.gif" width="6" height="5" /></td>
    <td background="../style/plady/t_d_m.gif"></td>
    <td><img src="../style/plady/t_d_r.gif" width="6" height="5" /></td>
  </tr>
  <tr>
    <td width="2" rowspan="2" background="../style/plady/t_m_l.gif"></td>
    <td height="32"><font color="#FF0000">提示：</font>您网上在线支付情况反馈如下：</td>
    <td width="2" rowspan="2" background="../style/plady/t_m_r.gif"></td>
  </tr>
  <tr>
    <td>

      <table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#F796B5">
        <tr>
          <td width="44%" bgcolor="#FFFFFF">此次交易编号：</td>
          <td width="56%" align="left" bgcolor="#FFFFFF"><%=v_oid%></td>
        </tr>
        <tr>
          <td bgcolor="#FFFFFF">在线支付状态：</td>
          <td align="left" bgcolor="#FFFFFF"><%=zhuangtai%></td>
        </tr>
        <tr>
          <td bgcolor="#FFFFFF">您所使用的卡为：</td>
          <td align="left" bgcolor="#FFFFFF"><%=v_pmode%></td>
        </tr>
        <tr>
          <td bgcolor="#FFFFFF">金额：</td>
          <td align="left" bgcolor="#FFFFFF"><font color=red><%=v_amount%></font>元</td>
        </tr>
      </table>
	  支付成功后，相应H币已经进入您的帐户里了，<br />
	  赶快<a href="../Login.htm"><font color="#FF9900">登陆</font></a>使用吧	  </td>
  </tr>
  <tr>
    <td><img src="../style/plady/t_t_l.gif" width="6" height="5" /></td>
    <td background="../style/plady/t_t_r.gif"></td>
    <td><img src="../style/plady/t_t_r.gif" width="6" height="5" /></td>
  </tr>
</table>
 