pos支付相关
This commit is contained in:
@@ -25,6 +25,7 @@ import cn.pluss.platform.sxf.pay.SxfPayService;
|
||||
import cn.pluss.platform.user.impl.GeneralPushUtil;
|
||||
import cn.pluss.platform.userApp.UserAppService;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import cn.pluss.platform.util.TokenUtil;
|
||||
import cn.pluss.platform.vo.MemberScanVO;
|
||||
import cn.pluss.platform.vo.MerchantOrderVO;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -424,6 +425,33 @@ public class MerchantOrderController {
|
||||
return ResultGenerator.genFailResult(e.getMessage());
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 博实结pos机反扫支付
|
||||
* @param merchantOrderDTO
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/posScanPay")
|
||||
public Result<Object> posScanPay(@RequestBody MerChantOrderDTO merchantOrderDTO) {
|
||||
//首先验签
|
||||
Map<String, String> token = TokenUtil.getToken(merchantOrderDTO.getTimestamp(), merchantOrderDTO.getRequestId());
|
||||
boolean sign = token.get("TOKEN").equals(merchantOrderDTO.getToken());
|
||||
System.out.println(token);
|
||||
MsgException.check(!sign,"签名错误");
|
||||
//通过后进行支付操作
|
||||
UserApp tokenUa = userAppService.queryUserAppByToken();
|
||||
merchantOrderDTO.setMerchantCode(tokenUa.getMerchantCode());
|
||||
//校验金额
|
||||
if (!StringUtil.isMoney(String.valueOf(merchantOrderDTO.getConsumeFee()))){
|
||||
MsgException.throwException("金额异常");
|
||||
}
|
||||
try {
|
||||
return merchantOrderService.toActivePay(merchantOrderDTO);
|
||||
} catch (Exception e){
|
||||
e.printStackTrace();
|
||||
return ResultGenerator.genFailResult(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 主扫会员支付
|
||||
|
||||
@@ -55,6 +55,7 @@ public class TokenRegistryInterceptor extends HandlerInterceptorAdapter {
|
||||
limitUri.add("/api/callback/");
|
||||
limitUri.add("/api/open/login");
|
||||
limitUri.add("/api/index.html");
|
||||
limitUri.add("/api/merchantOrder/posScanPay");
|
||||
boolean passFlag = limitUri.stream().anyMatch(s -> s.equals(requestUri) || requestUri.startsWith(s));
|
||||
if (passFlag) {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user