|
@@ -14,6 +14,7 @@ import io.swagger.annotations.Api;
|
14
|
14
|
import io.swagger.annotations.ApiImplicitParam;
|
15
|
15
|
import io.swagger.annotations.ApiImplicitParams;
|
16
|
16
|
import io.swagger.annotations.ApiOperation;
|
|
17
|
+import lombok.extern.slf4j.Slf4j;
|
17
|
18
|
import org.slf4j.Logger;
|
18
|
19
|
import org.slf4j.LoggerFactory;
|
19
|
20
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -40,6 +41,7 @@ import static com.alipay.api.AlipayConstants.CHARSET_UTF8;
|
40
|
41
|
@RefreshScope
|
41
|
42
|
@RequestMapping("/")
|
42
|
43
|
@Api(value = "支付宝支付 API", description = "支付宝支付 API")
|
|
44
|
+@Slf4j
|
43
|
45
|
public class AliPayController {
|
44
|
46
|
|
45
|
47
|
private Logger log = LoggerFactory.getLogger(AliPayController.class);
|
|
@@ -56,7 +58,7 @@ public class AliPayController {
|
56
|
58
|
@ApiOperation(value = "统一下单", notes = "统一下单")
|
57
|
59
|
@ApiImplicitParams({
|
58
|
60
|
@ApiImplicitParam(paramType = "path", dataType = "String", name = "outTradeNo", value = "订单号"),
|
59
|
|
- @ApiImplicitParam(paramType = "form", dataType = "String", name = "type", value = "订单类型:type: 类型(car 车缴费, bill 物业缴费)"),
|
|
61
|
+ @ApiImplicitParam(paramType = "query", dataType = "String", name = "type", value = "订单类型:type: 类型(car 车缴费, bill 物业缴费)"),
|
60
|
62
|
@ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token") })
|
61
|
63
|
@RequestMapping(value = "/aliPayOrder/{outTradeNo}",method = RequestMethod.GET)
|
62
|
64
|
public ResponseBean wxUnifiedOrder(@PathVariable("outTradeNo") String outTradeNo, @RequestParam("type") String type, HttpSession session){
|
|
@@ -77,12 +79,14 @@ public class AliPayController {
|
77
|
79
|
@ApiOperation(value = "支付宝手机订单支付完成后回调 物业缴费", notes = "支付宝手机订单支付完成后回调")
|
78
|
80
|
@RequestMapping(value = "/aliPayBillNotify",method = RequestMethod.POST)
|
79
|
81
|
public void aliPayBillNotify(HttpServletRequest request, HttpServletResponse response){
|
|
82
|
+ log.info("支付宝手机订单支付完成后回调 物业缴费");
|
80
|
83
|
wxNotify(request, Constant.PAY_TYPE_BILL);
|
81
|
84
|
}
|
82
|
85
|
|
83
|
86
|
@ApiOperation(value = "支付宝手机订单支付完成后回调 车缴费", notes = "支付宝手机订单支付完成后回调 车缴费")
|
84
|
87
|
@RequestMapping(value = "/aliPayCarNotify",method = RequestMethod.POST)
|
85
|
88
|
public void aliPayCarNotify(HttpServletRequest request, HttpServletResponse response){
|
|
89
|
+ log.info("支付宝手机订单支付完成后回调 车缴费");
|
86
|
90
|
wxNotify(request, Constant.PAY_TYPE_CAR);
|
87
|
91
|
}
|
88
|
92
|
|
|
@@ -92,7 +96,7 @@ public class AliPayController {
|
92
|
96
|
* @param type
|
93
|
97
|
*/
|
94
|
98
|
private void wxNotify(HttpServletRequest request, String type) {
|
95
|
|
- System.out.println("alipay result start =======");
|
|
99
|
+ log.info("支付宝 alipay result start =======");
|
96
|
100
|
Map<String,String> params = new HashMap<String,String>();
|
97
|
101
|
Map requestParams = request.getParameterMap();
|
98
|
102
|
for (Iterator iter = requestParams.keySet().iterator(); iter.hasNext();) {
|