| | |
| | | import cc.mrbird.febs.mall.service.IMallMoneyFlowService; |
| | | import cc.mrbird.febs.pay.model.NotifyData; |
| | | import cc.mrbird.febs.pay.service.IXcxPayService; |
| | | import cc.mrbird.febs.pay.service.WxFaPiaoService; |
| | | import cc.mrbird.febs.pay.util.Signature; |
| | | import cc.mrbird.febs.pay.util.Util; |
| | | import cc.mrbird.febs.pay.util.WechatConfigure; |
| | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.wechat.pay.contrib.apache.httpclient.notification.NotificationRequest; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.ServletOutputStream; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.BufferedReader; |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.security.InvalidKeyException; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.security.SignatureException; |
| | | import java.text.ParseException; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | |
| | | |
| | | @Autowired |
| | | private IXcxPayService iXcxPayService; |
| | | |
| | | @Autowired |
| | | private WxFaPiaoService wxFaPiaoService; |
| | | |
| | | private final XcxProperties xcxProperties = SpringContextHolder.getBean(XcxProperties.class); |
| | | /** |
| | |
| | | // } |
| | | /** |
| | | * 微信电子发票回调接口 |
| | | * POST方式回调 |
| | | * @return |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @RequestMapping(value = "/fapiaoCallBack") |
| | | public Map<Object, Object> fapiaoCallBack(HttpServletResponse response, HttpServletRequest request) throws IOException { |
| | | log.info("微信电子发票回调接口...."); |
| | | Map<Object, Object> objectObjectHashMap = new HashMap<>(); |
| | | objectObjectHashMap.put("code","SUCCESS"); |
| | | objectObjectHashMap.put("message",""); |
| | | return objectObjectHashMap; |
| | | public Map<String, Object> fapiaoCallBack(HttpServletRequest request, @RequestBody Map<String, Object> requestBody) { |
| | | return wxFaPiaoService.fapiaoCallBack(request,requestBody); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 微信支付回调接口 |
| | | */ |
| | |
| | | resXml = WechatConfigure.RESULT_XML_SUCCESS; |
| | | // 支付费用 |
| | | Double total_fee = Double.parseDouble(data.getTotal_fee()); |
| | | //微信支付订单号 |
| | | String transaction_id = data.getTransaction_id(); |
| | | // 商户订单号 |
| | | String payNum = data.getOut_trade_no(); |
| | | |
| | |
| | | order.setPayResult("1"); |
| | | order.setPayTime(new Date()); |
| | | order.setDeliveryState(OrderDeliveryStateEnum.DELIVERY_WAIT.getValue()); |
| | | order.setPayOrderNo(transaction_id); |
| | | mallOrderInfoMapper.updateById(order); |
| | | |
| | | agentProducer.sendOrderCoupon(order.getId()); |
| | | // agentProducer.sendGetScoreMsg(order.getId()); |
| | | |
| | | mallMoneyFlowService.addMoneyFlow( |
| | | order.getMemberId(), |