由于工行的支付接口目前是没有向B2B商户提供按订单号查询订单状态的,因此处理订单成功支付后的消息就显得非常重要了,以下为鲁炬在做银行支付项目时处理工行订单支付成功通知的核心代码。
/**
* 处理工行支付成功通知
*/
public void notifyDate(String notifyDataBase64, String signMsg, String merVAR, String realPath) {
String encoding = "gbk";
log.debug("接收工行通知信息原文:notifyData:" + notifyDataBase64);
log.debug("接收工行通知信息原文:signMsg:" + signMsg);
log.debug("接收工行通知信息原文:merVAR:" + merVAR);
byte[] notifyDataBytes = null;
String notifyData = null;
try {
notifyDataBytes = ReturnValue.base64dec(notifyDataBase64.getBytes(encoding));
notifyData = new String(notifyDataBytes, encoding);
log.debug("接收工行通知信息:notifyData:base64解码后:" + notifyData);
} catch(UnsupportedEncodingException e) {
log.error("工行解析通知内容出错:", e);
throw new RuntimeException(e);
}
String