| | |
| | | * |
| | | * @return |
| | | */ |
| | | @PostMapping("/refond") |
| | | public ResponseVO<Object> refond(@RequestBody PayParam params) { |
| | | @PostMapping("/refund") |
| | | public ResponseVO<Object> refund(@RequestBody PayParam params) { |
| | | if (params.getOutTradeNo().isEmpty() || params.getOutTradeNo() == null) { |
| | | throw new BusinessException("退款参数不能为空"); |
| | | } |
| | | // 0.00 用于占位 没有实际用处 退款接口好几个地方调用 不太好改 |
| | | return ResponseUtil.success(c3mOrderService.orderRefund(params.getOutTradeNo(), |
| | | 0.00)); |
| | | return ResponseUtil.success(c3mOrderService.orderRefund(params.getOutTradeNo())); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @AnonymousAccess |
| | | @PostMapping("/advancePay") |
| | | public ResponseVO<Object> advancePayOrder(HttpServletRequest request, @RequestBody PayParam param) throws WxErrorException { |
| | | public ResponseVO<Object> advancePayOrder(HttpServletRequest request, @RequestBody PayParam param) throws WxErrorException, InterruptedException { |
| | | if (param.getOpenId().isEmpty()) { |
| | | throw new BusinessException("微信code不能为空"); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 订单状态查询 微信支付 |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @RequestMapping("/queryOrder") |
| | | public ResponseVO<Object> queryOrder(@RequestBody PayParam param) { |
| | | if (param.getOrderId() == null) { |
| | | throw new BusinessException("请输入正确的订单id"); |
| | | } |
| | | C3mOrder order = c3mOrderService.getById(param.getOrderId()); |
| | | if (order == null) { |
| | | throw new BusinessException("订单不存在"); |
| | | } |
| | | if ((OrderType.ALIPAY.getCode()).equals(order.getOrderType())) { |
| | | return ResponseUtil.success(AliPayUtils.alipayQuery(order.getOutTradeNo(), param.getPoleId())); |
| | | } else if ((OrderType.WXPAY.getCode()).equals(order.getOrderType())) { |
| | | return ResponseUtil.success(wxPayService.WxOrderQuery(param.getPoleId(), order.getOutTradeNo())); |
| | | } else { |
| | | return ResponseUtil.success("支付方式异常"); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 订单列表 |