无关风月
2025-02-20 0d4c9f50ee2bc3e4a03abd91ac7c9e03891d37f2
ruoyi-service/ruoyi-payment/src/main/java/com/ruoyi/payment/controller/WxPayController.java
@@ -101,7 +101,7 @@
     */
    @ApiOperation("订单退款")
    @PostMapping(value = "refundOrderR")
    public R<String> refundOrderR(@RequestBody WxPaymentRefundModel model) {
    public R<Map<String, Object>> refundOrderR(@RequestBody WxPaymentRefundModel model) {
        Map<String, Object> result = wxV3Pay.refund(model);
        log.info("退款结果:{}", result);
        // 微信支付退款单号
@@ -116,7 +116,7 @@
        String success_time = Objects.nonNull(result.get("success_time")) ? result.get("success_time").toString() : null;
        // 退款状态 RefundEnum
        String status = result.get("status").toString();
        return R.ok(status);
        return R.ok(result);
    }
    /**
     * 支付回调
@@ -172,7 +172,7 @@
     * 退款回调
     */
    @PostMapping("refund/notify")
    public R<WxRefundNotifyResp> refundNotify(HttpServletRequest request) throws IOException {
    public void refundNotify(HttpServletRequest request) throws IOException {
        try {
            Map<String, Object> params = wxV3Pay.verifyNotify(request, new TypeReference<Map<String, Object>>() {
            });
@@ -216,14 +216,13 @@
                resp.setRefund_id(refund_id);
                resp.setSuccess_time(success_time);
                wxV3Pay.ack();
                return R.ok(resp);
            } else {
                wxV3Pay.ack(false, "不是成功的退款状态");
            }
        } catch (Exception e) {
            e.printStackTrace();
            wxV3Pay.ack(false, e.getMessage());
        }
        return R.fail();
    }
    
    /**