| @@ -14,6 +14,7 @@ import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.PostMapping; | import org.springframework.web.bind.annotation.PostMapping; | ||||
| import org.springframework.web.bind.annotation.RequestAttribute; | |||||
| import org.springframework.web.bind.annotation.RequestBody; | import org.springframework.web.bind.annotation.RequestBody; | ||||
| import org.springframework.web.bind.annotation.RequestMapping; | import org.springframework.web.bind.annotation.RequestMapping; | ||||
| import org.springframework.web.bind.annotation.ResponseBody; | import org.springframework.web.bind.annotation.ResponseBody; | ||||
| @@ -187,8 +188,21 @@ public class AliPayController extends BaseController { | |||||
| * @throws Exception 可能产生的任何异常 | * @throws Exception 可能产生的任何异常 | ||||
| */ | */ | ||||
| @RequestMapping(value = "/notify") | @RequestMapping(value = "/notify") | ||||
| public void __Notify(@RequestBody Map<String, Object> paramMap) throws Exception { | |||||
| public void __Notify(@RequestAttribute Map<String, Object> paramMap) throws Exception { | |||||
| logger.info(">>>>>>>>alipay callback"+paramMap); | logger.info(">>>>>>>>alipay callback"+paramMap); | ||||
| String msgMethod = (String) paramMap.get("msg_method"); | |||||
| if (StringUtils.isBlank(msgMethod)) { | |||||
| logger.error("alipay notify notify error. msg_method empity:"+paramMap); | |||||
| }else { | |||||
| //支付成功 | |||||
| if ("alipay.business.mall.trade.success".equals(msgMethod)) { | |||||
| String notifyId = (String) paramMap.get("notify_id"); | |||||
| Map bizContent = (Map) paramMap.get("biz_content"); | |||||
| //{"mall_cell_type":"PID","gmt_payment":"2021-04-26 11:46:39","mall_pid":"2088141123923631","mall_store_id":"1001","buyer_id":"2088622858197040","mall_cell_id":"2088222130914462","notify_receive_pid":"2088141123923631","out_trade_no":"16194087949622858197040","total_amount":"0.10","mall_id":"10020001","trade_no":"2021042622001497041452058065","mall_name":"富茂链客","receipt_amount":"0.10"} | |||||
| System.out.println(bizContent); | |||||
| } | |||||
| } | |||||
| } | } | ||||
| } | } | ||||