新零售支付全家桶


创建前端回调方法

<p>编写UnionPayController.java</p> <pre><code class="language-java">@RequestMapping("/recvFrontResponse") @ApiOperation("接收银联页面跳转请求") public void recvFrontResponse(HttpServletRequest request, HttpServletResponse response) throws Exception { request.setCharacterEncoding("UTF-8"); HashMap&lt;String, String&gt; reqParam = new HashMap&lt;&gt;(); Enumeration&lt;String&gt; enumeration = request.getParameterNames(); while (enumeration.hasMoreElements()) { String name = enumeration.nextElement(); String value = request.getParameter(name); reqParam.put(name, value); } Map&lt;String, String&gt; valideData = null; String htmlCode = null; if (!reqParam.isEmpty()) { Iterator&lt;Map.Entry&lt;String, String&gt;&gt; it = reqParam.entrySet().iterator(); valideData = new HashMap&lt;String, String&gt;(reqParam.size()); while (it.hasNext()) { Map.Entry&lt;String, String&gt; e = it.next(); String key = (String) e.getKey(); String value = (String) e.getValue(); valideData.put(key, value); } } if (acpService.validate(valideData, "UTF-8")) { System.out.println("前端回调签名验证成功"); String respCode = request.getParameter("respCode"); String queryId = request.getParameter("queryId"); String code = request.getParameter("orderId"); if ("00".equals(respCode)) { UpdateWrapper updateWrapper = new UpdateWrapper(); updateWrapper.eq("code", code); updateWrapper.set("status", 2); updateWrapper.set("payment_type", 3); updateWrapper.set("prepay_id", queryId); orderService.update(updateWrapper); } } response.sendRedirect(orderUrl); }</code></pre>

页面列表

ITEM_HTML