string sSIGN = this.Request["SIGN"];
string sURL = "";
string sORDERID = this.Request["ORDERID"];
string sPAYMENT = this.Request["PAYMENT"];
string sCURCODE = this.Request["CURCODE"];
string sSUCCESS = this.Request["SUCCESS"];
//取得用于加密的URL串
int iPos = sPara.LastIndexOf('&');
if (iPos > 0)
{
sURL = sPara.Substring(0, iPos);
}
else
{
showPayMsg("非法的URL!");
return;
}
string PublicKey = ConfigurationManager.AppSettings["PublicKey"].ToString();
CCBRSA.RSASig rsa;
try
{
rsa = new CCBRSA.RSASigClass();
}
catch (Exception ex)
{
showPayMsg("支付失败!网上银行控件失效" + ex.Message);
return;
}
bool bRet;
rsa.setPublicKey(PublicKey);
bRet = rsa.verifySigature(sSIGN, sURL);
if (bRet)
{
if (sSUCCESS == "Y") //如果执行成功,则验证数据是否正确
{
//验证金额是否正确
checkPayment("ccb", sORDERID, Convert.ToDouble(sPAYMENT), ref this.Exc, Global.Conn);
if (this.Exc.ErrCode == 0)//
{
showPayMsg("支付成功!");
}
else
{
showPayMsg("支付失败。" + this.Exc.ErrDesc);
}
}
else
{
showPayMsg("支付失败!");
}
}
else
showPayMsg("非法的URL!");