| | |
| | | import com.java110.core.base.controller.BaseController; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.core.context.PageData; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.intf.user.IUserInnerServiceSMO; |
| | | import com.java110.utils.constant.CommonConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.StringUtil; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import com.java110.core.log.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | @RestController |
| | | @RequestMapping(path = "/app/payment") |
| | | public class PaymentController extends BaseController { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(PaymentController.class); |
| | | |
| | | @Autowired |
| | |
| | | private IOweFeeToNotifySMO oweFeeToNotifySMOImpl; |
| | | |
| | | @Autowired |
| | | private ITempCarFeeToNotifySMO tempCarFeeToNotifySMOImpl; |
| | | |
| | | @Autowired |
| | | private IToQrPayOweFeeSMO toQrPayOweFeeSMOImpl; |
| | | |
| | | @Autowired |
| | | private IToPayInGoOutSMO toPayInGoOutSMOImpl; |
| | | |
| | | @Autowired |
| | | private IToPayBackCitySMO toPayBackCitySMOImpl; |
| | | |
| | | @Autowired |
| | | private IToPayTempCarFeeSMO toPayTempCarFeeSMOImpl; |
| | | |
| | | @Autowired |
| | | private IUserInnerServiceSMO userInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * <p>统一下单入口</p> |
| | |
| | | appId = request.getHeader("APP-ID"); |
| | | } |
| | | |
| | | IPageData newPd = PageData.newInstance().builder(pd.getUserId(), pd.getUserName(), pd.getToken(), postInfo, |
| | | "", "", "", pd.getSessionId(), appId, pd.getPayerObjId(), pd.getPayerObjType(), pd.getEndTime()); |
| | | JSONObject param = JSONObject.parseObject(postInfo); |
| | | UserDto userDto = new UserDto(); |
| | | userDto.setUserId(pd.getUserId()); |
| | | List<UserDto> users = userInnerServiceSMOImpl.getUsers(userDto); |
| | | Assert.listOnlyOne(users, "查询用户信息错误!"); |
| | | |
| | | IPageData newPd = PageData.newInstance().builder(pd.getUserId(), users.get(0).getName(), pd.getToken(), postInfo, |
| | | "", "", "", pd.getSessionId(), appId, param.getString("payerObjId"), param.getString("payerObjType"), |
| | | param.getString("endTime")); |
| | | return toPaySMOImpl.toPay(newPd); |
| | | } |
| | | |
| | |
| | | |
| | | IPageData newPd = PageData.newInstance().builder(pd.getUserId(), pd.getUserName(), pd.getToken(), postInfo, |
| | | "", "", "", pd.getSessionId(), |
| | | appId,pd.getHeaders()); |
| | | appId, pd.getHeaders()); |
| | | return toPayOweFeeSMOImpl.toPay(newPd); |
| | | } |
| | | |
| | |
| | | |
| | | IPageData newPd = PageData.newInstance().builder(pd.getUserId(), pd.getUserName(), pd.getToken(), postInfo, |
| | | "", "", "", pd.getSessionId(), |
| | | appId,pd.getHeaders()); |
| | | appId, pd.getHeaders()); |
| | | return toPayTempCarFeeSMOImpl.toPay(newPd); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | String preStr = buildSignString(params); |
| | | paramIn.put("preSign",preStr); |
| | | paramIn.put("sign",sign); |
| | | paramIn.put("preSign", preStr); |
| | | paramIn.put("sign", sign); |
| | | //判断签名是否相等 |
| | | |
| | | // 收到通知后记得返回SUCCESS |
| | |
| | | |
| | | |
| | | String preStr = buildSignString(params); |
| | | paramIn.put("preSign",preStr); |
| | | paramIn.put("sign",sign); |
| | | paramIn.put("preSign", preStr); |
| | | paramIn.put("sign", sign); |
| | | |
| | | return oweFeeToNotifySMOImpl.toNotify(paramIn.toJSONString(), request); |
| | | } |
| | |
| | | public ResponseEntity<String> tempCarFeeNotifyUrl(@RequestBody String postInfo, HttpServletRequest request) { |
| | | logger.debug("微信支付回调报文" + postInfo); |
| | | |
| | | return oweFeeToNotifySMOImpl.toNotify(postInfo, request); |
| | | return tempCarFeeToNotifySMOImpl.toNotify(postInfo, request); |
| | | } |
| | | |
| | | /** |