| | |
| | | VSP502:微信支付撤销 |
| | | VSP503:微信支付退款 |
| | | */ |
| | | if ("VSP502".equals(trxcode)|| "VSP503".equals(trxcode)){ |
| | | if ("VSP502".equals(trxcode) || "VSP503".equals(trxcode)){ |
| | | String trxid = params.get("trxid"); |
| | | updateOrderRefund(outTradeNo, trxid); |
| | | |
| | |
| | | } |
| | | |
| | | SybPayService service = new SybPayService(); |
| | | Map<String,String> map = service.close(null, orderId); |
| | | log.info("======关闭订单结果" + toJSONString(map)); |
| | | |
| | | String retcode = map.get("retcode"); |
| | | if(!"SUCCESS".equals(retcode)){ |
| | | throw new ValidationException("取消订单失败: " + map.get("retmsg")); |
| | | Map<String,String> params = service.query(orderId, up.getTransactionId()); |
| | | String trxstatus = params.get("trxstatus");//支付状态 |
| | | |
| | | if("1001".equals(trxstatus)){ |
| | | //空单 直接取消 |
| | | } else if (StringUtils.isEmpty(trxstatus) |
| | | || "2008".equals(trxstatus) |
| | | || "2000".equals(trxstatus)) { |
| | | String trxid = params.get("trxid"); |
| | | //2008或者2000 : 交易处理中,请查询交易,如果是实时交易(例如刷卡支付,交易撤销,退货),建议每隔一段时间(10秒)查询交易 |
| | | Map<String,String> map = service.close(trxid, orderId); |
| | | log.info("======关闭订单结果" + toJSONString(map)); |
| | | |
| | | String retcode = map.get("retcode"); |
| | | if(!"SUCCESS".equals(retcode)){ |
| | | throw new ValidationException("取消订单失败: " + map.get("retmsg")); |
| | | } |
| | | } else { |
| | | throw new ValidationException("订单不可取消"); |
| | | } |
| | | |
| | | Order order = orderMapper.selectById(orderId); |