| | |
| | | |
| | | import com.panzhihua.applets.umf.MyAESUtil; |
| | | import com.panzhihua.applets.umf.UmfPayUtil; |
| | | import com.panzhihua.applets.unionpay.Query; |
| | | import com.panzhihua.applets.unionpay.QueryEntiy; |
| | | import com.panzhihua.applets.unionpay.Refund; |
| | | import com.panzhihua.common.model.dtos.wx.UnionpayCarWash; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | @GetMapping("wxNotifyAll") |
| | | public void payCallbackAll(HttpServletRequest request, HttpServletResponse response) { |
| | | //获取联动发送请求的参数 |
| | | String requestParam = request.getQueryString(); |
| | | System.out.println("请求参数 :" + requestParam); |
| | | System.out.println("花城洗车请求参数 :" + requestParam); |
| | | //调用异步通知解析方法 |
| | | UmfService service = new UmfServiceImpl("53461",file); |
| | | Map respMap = null; |
| | |
| | | //调用uu洗车支付成功回调 |
| | | Map map=new HashMap(); |
| | | map.put("orderId",respMap.get("order_id")); |
| | | HttpClientUtil.sendPostByJson("https://api.uucsh.cn/notify/wx/pzh-pay",JSONObject.toJSONString(map),1,"appid","10000");; |
| | | HttpClientUtil.sendPostByJson("https://uu-api.imashuo.com/notify/wx/pzh-pay",JSONObject.toJSONString(map), |
| | | 1,"appid","10000"); |
| | | log.error("花城洗车回调成功 :" + respMap.get("order_id")); |
| | | } |
| | | //调用SDK生成返回联动平台字符串,加到CONTENT中 |
| | | String resMetaData = service.responseUMFMap(respMap); |
| | |
| | | out.flush(); |
| | | out.close(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 银联支付回调专用 银联方面只能是有个post |
| | | * @param response |
| | | */ |
| | | @PostMapping("wxNotifyAllUnionpay") |
| | | public void payCallbackAllUnionpay(@RequestParam("merOrderId") String merOrderId, HttpServletResponse response) |
| | | { |
| | | //获取联动发送请求的参数 |
| | | log.error("花城洗车请求参数 :" + merOrderId); |
| | | log.error("花城洗车请求参数response :" + response.toString()); |
| | | //调用异步通知解析方法 |
| | | String content=Query.query(merOrderId); |
| | | QueryEntiy queryEntiy=JSONObject.parseObject(content,QueryEntiy.class); |
| | | log.error("花城洗车请求参数queryEntiy :" + queryEntiy.toString()); |
| | | if(queryEntiy.getErrCode().equals("SUCCESS")) |
| | | { |
| | | //查询银联单号对应的洗车单号 |
| | | R r=communityService.carWashById(merOrderId); |
| | | if(r.getCode()==200) |
| | | { |
| | | |
| | | HashMap unionpayCarWash= (HashMap) r.getData(); |
| | | //调用uu洗车支付成功回调 |
| | | Map map=new HashMap(); |
| | | map.put("orderId",unionpayCarWash.get("carWashId")); |
| | | HttpClientUtil.sendPostByJson("https://uu-api.imashuo.com/notify/wx/pzh-pay",JSONObject.toJSONString(map), |
| | | 1,"appid","10000"); |
| | | log.error("花城洗车回调成功 :" + queryEntiy.getMerOrderId()+" : 洗车号" |
| | | +unionpayCarWash.get("carWashId")+" : 银联号"+unionpayCarWash.get("unionpayOrderId")); |
| | | } |
| | | |
| | | } |
| | | //调用SDK生成返回联动平台字符串,加到CONTENT中 |
| | | response.setContentType("text/html;charset=utf-8"); |
| | | PrintWriter out = null; |
| | | try { |
| | | out = response.getWriter(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | out.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">"); |
| | | out.println("<HTML>"); |
| | | out.println("<HEAD><META NAME=\"MobilePayPlatform\" CONTENT=\"" + content + "\" /></HEAD>"); |
| | | out.println("<BODY>"); |
| | | out.println("</BODY>"); |
| | | out.println("</HTML>"); |
| | | out.flush(); |
| | | out.close(); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("uu洗车退款接口") |
| | | @PostMapping("/uuRepay") |
| | | public R uuRepay(@RequestBody String aesString){ |
| | | public R uuRepay(@RequestBody String aesString) |
| | | { |
| | | try { |
| | | Map<String, String> aesMap= (Map<String, String>) JSON.parse(aesString); |
| | | String desString=MyAESUtil.Decrypt(aesMap.get("aesString"),"Ryo7M3n8loC5Abcd"); |
| | | Map<String,String> desMap= (Map) JSON.parse(desString); |
| | | Map map=umfPayUtil.repay(desMap.get("orderId"),desMap.get("merdate"), DateUtils.getDateFormatString(new Date(),"yyMMddHHmmss")+"0001",desMap.get("refundAmount"),desMap.get("orgAmount")); |
| | | Map map=umfPayUtil.repay(desMap.get("orderId"),desMap.get("merdate"), DateUtils.getDateFormatString(new Date(), |
| | | "yyMMddHHmmss")+"0001",desMap.get("refundAmount"),desMap.get("orgAmount")); |
| | | |
| | | if(desMap.get("orderId")!=null) |
| | | { |
| | | R r=communityService.queryById(desMap.get("orderId")); |
| | | if(r.getCode()==200) |
| | | { |
| | | HashMap wash= (HashMap) r.getData(); |
| | | if(wash!=null) |
| | | { |
| | | String re=Refund.sendOrder(wash.get("money").toString(), |
| | | wash.get("unionpayOrderId").toString()); |
| | | map.put("unionpay","退款成功"); |
| | | log.error("花城洗车银联退款成功 :" + re); |
| | | } |
| | | |
| | | } |
| | | } |
| | | return R.ok(map); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | } |
| | | |
| | | |
| | | @PostMapping("flowerWxNotify") |
| | | @PostMapping("/flower/wxNotify") |
| | | @ApiOperation("花城支付回调") |
| | | public void flowerWxNotify(HttpServletRequest request, HttpServletResponse response) { |
| | | log.error("微信支付回调start"); |
| | | String inputLine = ""; |
| | |
| | | notifyOrderDTO.setCashFee(cashFee); |
| | | |
| | | // 根据订单号修改订单信息 |
| | | communityService.wxOrderPayNotify(notifyOrderDTO); |
| | | communityService.wxOrderPayNotifyFlower(notifyOrderDTO); |
| | | |
| | | // 封装 返回值 |
| | | StringBuffer buffer = new StringBuffer(); |