| | |
| | | import java.io.BufferedReader;
|
| | | import java.io.IOException;
|
| | | import java.io.PrintWriter;
|
| | | import java.math.BigDecimal;
|
| | | import java.security.SignatureException;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | |
| | | import com.yeshi.fanli.service.inter.push.PushService;
|
| | | import com.yeshi.fanli.service.inter.shop.BanLiShopOrderService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.rocketmq.MQMsgBodyFactory;
|
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName;
|
| | | import com.yeshi.fanli.util.shop.BanLiShopOrderUtil;
|
| | | import com.yeshi.fanli.util.wx.BanLiShopWXPayUtil;
|
| | |
| | |
|
| | | @RequestMapping(value = "banlishop/pay")
|
| | | public void banLiShopPay(HttpServletRequest request, PrintWriter out) {
|
| | |
|
| | | Map<String, String> map = WXUtil.parseXML(request);
|
| | | JSONObject json = JSONObject.fromObject(map);
|
| | | LogHelper.test("商城微信支付回调:" + json.toString());
|
| | | String sign = map.get("sign");
|
| | | map.remove("sign");
|
| | | boolean isSuccess = BanLiShopWXPayUtil.signIsRight(map, sign);
|
| | |
| | | if (!StringUtil.isNullOrEmpty(orderNo)) {
|
| | | BanLiShopOrder order = banLiShopOrderService.selectByOrderNo(orderNo);
|
| | | if (order != null) {// 支付成功消息推送
|
| | | BanLiShopOrderMQMsg msg = new BanLiShopOrderMQMsg(order.getId(), order.getUid());
|
| | | Message message = new Message(MQTopicName.TOPIC_ORDER.name(),
|
| | | OrderTopicTagEnum.banLiShopOrderPaid.name(), new Gson().toJson(msg).getBytes());
|
| | | BanLiShopOrderMQMsg msg = new BanLiShopOrderMQMsg(order.getId(), order.getUid(),
|
| | | new BigDecimal(map.get("total_fee")).multiply(new BigDecimal("0.01")));
|
| | | Message message =MQMsgBodyFactory.create(MQTopicName.TOPIC_ORDER,
|
| | | OrderTopicTagEnum.banLiShopOrderPaid, msg);
|
| | | producer.send(message);
|
| | | Map<String, String> returnMap = new HashMap<>();
|
| | | returnMap.put("return_code", "SUCCESS");
|