| | |
| | | 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; |
| | |
| | | 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; |
| | | |
| | |
| | | RedisUtils redisUtils; |
| | | @Autowired |
| | | private IApiMallMemberWalletService memberWalletService; |
| | | |
| | | // @Autowired |
| | | // private WxPayService wxPayService; |
| | | // |
| | | // @Autowired |
| | | // private IXcxCodePayService xcxCodePayService; |
| | | |
| | | @Autowired |
| | | private IXcxPayService iXcxPayService; |
| | |
| | | |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | String attach="{'rechargeNo':CZ_2022083117160259880,'memberId':47}"; |
| | | JSONObject jsonObject = JSONUtil.parseObj(attach); |
| | | String rechargeNo = (String) jsonObject.get("rechargeNo"); |
| | | Long memberId = Long.parseLong(jsonObject.get("memberId").toString()); |
| | | System.out.println(memberId); |
| | | System.out.println(rechargeNo); |
| | | } |
| | | // public static void main(String[] args) { |
| | | // String attach="{'rechargeNo':CZ_2022083117160259880,'memberId':47}"; |
| | | // JSONObject jsonObject = JSONUtil.parseObj(attach); |
| | | // String rechargeNo = (String) jsonObject.get("rechargeNo"); |
| | | // Long memberId = Long.parseLong(jsonObject.get("memberId").toString()); |
| | | // System.out.println(memberId); |
| | | // System.out.println(rechargeNo); |
| | | // } |
| | | /** |
| | | * 微信支付回调接口 |
| | | */ |
| | |
| | | if (order != null && OrderStatusEnum.WAIT_PAY.getValue() == order.getStatus()) { |
| | | log.debug("检查支付金额payMoney={},order.getPayMoney()={}", payMoney, order.getAmount()); |
| | | order.setStatus(OrderStatusEnum.WAIT_SHIPPING.getValue()); |
| | | order.setPayResult("1"); |
| | | order.setPayResult(1); |
| | | order.setPayTime(new Date()); |
| | | order.setDeliveryState(OrderDeliveryStateEnum.DELIVERY_WAIT.getValue()); |
| | | mallOrderInfoMapper.updateById(order); |
| | |
| | | // resXml = AppConstance.RESULT_XML_FAIL.replace(ERRORMSG, "支付回调签名错误"); |
| | | } finally { |
| | | // 通知线程消息 |
| | | PayThreadPool.notifyThread(Integer.valueOf(orderId), threadResult); |
| | | // PayThreadPool.notifyThread(Integer.valueOf(orderId), threadResult); |
| | | sendResultBack(response, resXml); |
| | | } |
| | | return; |
| | |
| | | out.close(); |
| | | } |
| | | |
| | | |
| | | // @PostMapping(value = "/xcxCodePayCallBack") |
| | | // public String xcxCodePayCallBack(@RequestBody String xmlData) throws WxPayException { |
| | | // log.info("=======微信支付码付款回调:{}========", xmlData); |
| | | // WxPayOrderNotifyResult notifyResult = wxPayService.parseOrderNotifyResult(xmlData); |
| | | // xcxCodePayService.payCallback(notifyResult.toMap()); |
| | | // return WxPayNotifyResponse.success("成功"); |
| | | // } |
| | | |
| | | |
| | | } |