namespace com.hitrust.b2b.trustpay.client.b2b
|
|
{
|
|
using com.hitrust.b2b.trustpay.client;
|
|
using System;
|
|
using System.Text;
|
|
|
|
public class TrnxResult : TrxResponse
|
|
{
|
|
public TrnxResult init(string aMessage)
|
|
{
|
|
LogWriter writer = null;
|
|
try
|
|
{
|
|
writer = new LogWriter(MerchantConfig.getTrxLogFile("TrnxResultLog"));
|
|
writer.logNewLine("接收到的支付结果通知:\n[" + aMessage + "]");
|
|
Base64 base2 = new Base64();
|
|
string aXMLString = Encoding.GetEncoding("gb2312").GetString(base2.decode(aMessage));
|
|
writer.logNewLine("经过Base64解码后的支付结果通知:\n[" + aXMLString + "]");
|
|
writer.logNewLine("验证支付结果通知的签名:");
|
|
writer.logNewLine("验证通过!\n 经过验证的支付结果通知:\n[" + MerchantConfig.verifySign(new XMLDocument(aXMLString)).ToString() + "]");
|
|
base.init(new XMLDocument(aXMLString));
|
|
}
|
|
catch (TrxException exception)
|
|
{
|
|
this.setReturnCode(exception.Code);
|
|
this.setErrorMessage(exception.Message + "-" + exception.DetailMessage);
|
|
writer.log("验证失败!\n");
|
|
}
|
|
if (writer != null)
|
|
{
|
|
writer.closeWriter();
|
|
}
|
|
return this;
|
|
}
|
|
}
|
|
}
|
|
|