KKSU
2023-12-21 1e51f33490015a769197c448e02c11f95e721c9f
src/main/java/cc/mrbird/febs/pay/controller/XcxPayController.java
@@ -19,6 +19,7 @@
import cc.mrbird.febs.pay.model.OrderStateMsgVo;
import cc.mrbird.febs.pay.model.WxTemplateData;
import cc.mrbird.febs.pay.service.IPayService;
import cc.mrbird.febs.pay.service.IXcxCodePayService;
import cc.mrbird.febs.pay.service.IXcxPayService;
import cc.mrbird.febs.pay.util.PayThreadPool;
import cc.mrbird.febs.pay.util.Signature;
@@ -28,15 +29,17 @@
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.github.binarywang.wxpay.bean.notify.WxPayNotifyResponse;
import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult;
import com.github.binarywang.wxpay.exception.WxPayException;
import com.github.binarywang.wxpay.service.WxPayService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import org.thymeleaf.engine.TemplateData;
@@ -69,6 +72,12 @@
    RedisUtils redisUtils;
    @Autowired
    private IApiMallMemberWalletService memberWalletService;
    @Autowired
    private WxPayService wxPayService;
    @Autowired
    private IXcxCodePayService xcxCodePayService;
    @Autowired
    private IXcxPayService iXcxPayService;
@@ -289,4 +298,14 @@
        out.close();
    }
    @PostMapping(value = "/xcxCodePayCallBack")
    public String xcxCodePayCallBack(@RequestBody String xmlData) throws WxPayException {
        log.info("=======微信支付码付款回调:{}========", xmlData);
        WxPayOrderNotifyResult notifyResult = this.wxPayService.parseOrderNotifyResult(xmlData);
        xcxCodePayService.payCallback(notifyResult.toMap());
        return WxPayNotifyResponse.success("成功");
    }
}