问题描述
<%@pagelanguage="java"contentType="text/html;charset=GBK"%><%@pageimport="com.bocom.netpay.b2cAPI.*"%><%@pageimport="com.cn.ohd.face.ordermanager.OrderFace"%><%@pageimport="com.cn.ohd.entity.ordermanage.UserOrder"%><html><head><title>交通银行商户测试结果页面</title><metahttp-equiv="Content-Type"content="text/html;charset=gb2312"></head><bodybgcolor="#FFFFFF"text="#000000"><%out.print("商户结果页面");out.print("<br>");out.print("--------------------------");out.print("<br>");StringnotifyMsg=request.getParameter("notifyMsg");//获取银行通知结果intlastIndex=notifyMsg.lastIndexOf("|");StringsignMsg=notifyMsg.substring(lastIndex+1,notifyMsg.length());//获取签名信息StringsrcMsg=notifyMsg.substring(0,lastIndex+1);intveriyCode=-1;[com.bocom.netpay.b2cAPI.NetSignServernss=newcom.bocom.netpay.b2cAPI.NetSignServer();//初始化签名库nss.NSDetachedVerify(signMsg.getBytes("GBK"),srcMsg.getBytes("GBK"));//对通知结果进行验签veriyCode=nss.getLastErrnum();if(veriyCode<0){//验签出错[/color]out.print("商户端验证签名失败:returncode:"+veriyCode);return;}java.util.StringTokenizerstName=newjava.util.StringTokenizer(srcMsg,"|");//拆解通知结果到Vectorjava.util.Vectorvc=newjava.util.Vector();inti=0;while(stName.hasMoreTokens()){Stringvalue=(String)stName.nextElement();if(value.equals(""))value=" ";vc.add(i++,value);}%><tablewidth="75%"border="1"cellspacing="0"cellpadding="0"><tr><tdwidth="14%">商户客户号</td><tdwidth="86%"><%out.print(vc.get(0));%></td></tr><tr><tdwidth="14%">订单编号</td><tdwidth="86%"><%out.print(vc.get(1));Stringorderno=vc.get(1).toString();%></td></tr><tr><tdwidth="14%">交易金额</td><tdwidth="86%"><%out.print(vc.get(2));%></td></tr><tr><tdwidth="14%">交易币种</td><tdwidth="86%"><%out.print(vc.get(3));%></td></tr><tr><tdwidth="14%">平台批次号</td><tdwidth="86%"><%out.print(vc.get(4));%></td></tr><tr><tdwidth="14%">商户批次号</td><tdwidth="86%"><%out.print(vc.get(5));%></td></tr><tr><tdwidth="14%">交易日期</td><tdwidth="86%"><%out.print(vc.get(6));%></td></tr><tr><tdwidth="14%">交易时间</td><tdwidth="86%"><%out.print(vc.get(7));%></td></tr><tr><tdwidth="14%">交易流水号</td><tdwidth="86%"><%out.print(vc.get(8));%></td></tr><tr><tdwidth="14%">交易结果</td><tdwidth="86%"><%OrderFaceorderFace=newOrderFace();out.print(vc.get(9));UserOrderuserorder=orderFace.getUserOrderByOrderNo(orderno);userorder.setOrderStateCode("7");//未处理已支付的订单状态orderFace.updateByOrder(userorder);%> [1:成功]</td></tr><tr><tdwidth="14%">手续费总额</td><tdwidth="86%"><%out.print(vc.get(10));%></td></tr><tr><tdwidth="14%">银行卡类型</td><tdwidth="86%"><%out.print(vc.get(11));%> [0:借记卡1:准贷记卡2:贷记卡]</td></tr><tr><tdwidth="14%">银行备注</td><tdwidth="86%"><%out.print(vc.get(12));%></td></tr><tr><tdwidth="14%">错误信息描述</td><tdwidth="86%"><%out.print(vc.get(13));%></td></tr></table><p> </p></body></html>
解决方案
解决方案二:
红色的是报错返回那个界面报500的位置