Compare commits

...

2 Commits

1 changed files with 15 additions and 11 deletions

View File

@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.shop.controller.admin.notify;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.json.JSONUtil;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderDO;
import cn.iocoder.yudao.module.shop.dal.mysql.recharge.RechargeOrderMapper;
import cn.iocoder.yudao.module.shop.service.order.StoreOrderService;
@ -115,6 +116,7 @@ public class WxPayNotifyController {
* @return:
*/
@PostMapping("/refund_notify")
@TenantIgnore
public String wxPayRefundNotify(@RequestBody String jsonData, HttpServletRequest request, HttpServletResponse response) throws Exception {
// 支付结果通用通知文档: https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_7
// 支付成功结果通知
@ -134,6 +136,7 @@ public class WxPayNotifyController {
BigDecimal payerTotal = NumberUtil.div(result.getAmount().getPayerTotal() + "", "100", 2);
// 处理相关逻辑
RechargeOrderDO orderDO = rechargeOrderMapper.selectOne(Wrappers.<RechargeOrderDO>lambdaQuery().eq(RechargeOrderDO::getOrderId, result.getOutTradeNo()));
if(orderDO!=null){
if (payerTotal.compareTo(orderDO.getPayPrice()) != 0) {
log.error("支付金额不匹配,订单实际支付金额:{},微信入参验证金额:{}", orderDO.getPayPrice(), payerTotal);
return "failure";
@ -146,6 +149,7 @@ public class WxPayNotifyController {
// 修改订单状态
// 写入
response.setStatus(HttpServletResponse.SC_OK);
}
return "success";
}
} catch (Exception e) {