新零售支付全家桶


接收付款结果消息

<h3>创建接收付款消息的WEB方法</h3> <p>编写ZfbController.java代码</p> <pre><code class="language-java">@ApiOperation("接收消息通知") @RequestMapping("/recieveAppMessage") public void recieveAppMessage(HttpServletRequest request, HttpServletResponse response) throws Exception { request.setCharacterEncoding("utf-8"); String tradeNo = request.getParameter("trade_no"); String code = request.getParameter("out_trade_no"); String tradeStatus = request.getParameter("trade_status"); Enumeration&lt;String&gt; enumeration=request.getParameterNames(); HashMap&lt;String,String&gt; map=new HashMap&lt;&gt;(); while(enumeration.hasMoreElements()){ String name=enumeration.nextElement(); String value=request.getParameter(name); map.put(name,value); } boolean bool=AlipaySignature.rsaCheckV1(map,app_publicKey,"UTF-8","RSA2"); if(bool){ if ("TRADE_FINISHED".equals(tradeStatus) || "TRADE_SUCCESS".equals(tradeStatus)) { UpdateWrapper wrapper = new UpdateWrapper(); wrapper.eq("code", code); wrapper.set("status", 2); wrapper.set("payment_type", 2); orderService.update(wrapper); } response.setCharacterEncoding("utf-8"); Writer writer = response.getWriter(); writer.write("success"); writer.close(); } else { response.sendError(500,"数字签名验证失败"); } }</code></pre>

页面列表

ITEM_HTML