|
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.example.xiaoshiweixinback.business.common.Constants;
|
|
|
import com.example.xiaoshiweixinback.business.common.Response;
|
|
|
import com.example.xiaoshiweixinback.business.common.base.Records;
|
|
|
+import com.example.xiaoshiweixinback.business.exception.BusinessException;
|
|
|
import com.example.xiaoshiweixinback.business.utils.JsonUtils;
|
|
|
import com.example.xiaoshiweixinback.business.utils.LoginUtils;
|
|
|
import com.example.xiaoshiweixinback.entity.weixinPay.*;
|
|
@@ -55,9 +56,17 @@ public class PayController {
|
|
|
Records records = new Records();
|
|
|
try {
|
|
|
GetPayTicketVO getPayTicketVO = weixinPayService.getPayTickets(weiXinPayDTO);
|
|
|
+ if(getPayTicketVO==null){
|
|
|
+ return Response.error("901","支付成功");
|
|
|
+ }
|
|
|
records.setData(getPayTicketVO);
|
|
|
+
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
+ if(e instanceof BusinessException) {
|
|
|
+ BusinessException e2 =(BusinessException) e;
|
|
|
+ return Response.error(e2.getErrorCode(), e2.getMessage());
|
|
|
+ }
|
|
|
}
|
|
|
return Response.success(records);
|
|
|
}
|