| | |
| | | |
| | | @Java110ParamsDoc(params = { |
| | | @Java110ParamDoc(name = "business",length = 64, remark = "支付场景,比如场地预约 为 venueReservation"), |
| | | @Java110ParamDoc(name = "payAdapt",length = 64, remark = "支付适配器,非必填"), |
| | | @Java110ParamDoc(name = "communityId", length = 30, remark = "小区ID"), |
| | | @Java110ParamDoc(name = "tradeType", length = 30, remark = "支付类型 NATIVE JSAPI APP"), |
| | | @Java110ParamDoc(name = "...", length = 30, remark = "其他参数根据相应接口协议传"), |
| | |
| | | |
| | | private static final Logger logger = LoggerFactory.getLogger(UnifiedPaymentCmd.class); |
| | | |
| | | protected static final String DEFAULT_PAYMENT_ADAPT = "wechatPaymentAdapt";// 默认微信通用支付 |
| | | protected static final String DEFAULT_PAYMENT_ADAPT = "wechatPaymentFactory";// 默认微信通用支付 |
| | | |
| | | /** |
| | | * 校验 |
| | |
| | | } |
| | | |
| | | //2.0 相应业务 下单 返回 单号 ,金额, |
| | | PaymentOrderDto paymentOrderDto = paymentBusiness.unified(reqJson); |
| | | PaymentOrderDto paymentOrderDto = paymentBusiness.unified(context,reqJson); |
| | | |
| | | logger.debug(">>>>>>>>>>>>>>>>支付业务下单返回,{}",JSONObject.toJSONString(paymentOrderDto)); |
| | | |
| | | String env = MappingCache.getValue("HC_ENV"); |
| | | |
| | | // 3.0 如果支付金额为0 直接调用 支付完通知接口 |
| | | if (paymentOrderDto.getMoney() <= 0) { |
| | | // 这里 演示环境不向微信下单 |
| | | if (paymentOrderDto.getMoney() <= 0 || "DEV".equals(env) || "TEST".equals(env)) { |
| | | paymentBusiness.notifyPayment(paymentOrderDto,reqJson); |
| | | JSONObject param = new JSONObject(); |
| | | param.put("code", "100"); |
| | |
| | | String payAdapt = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, WechatConstant.PAYMENT_ADAPT); |
| | | payAdapt = StringUtil.isEmpty(payAdapt) ? DEFAULT_PAYMENT_ADAPT : payAdapt; |
| | | |
| | | if(reqJson.containsKey("payAdapt") && !StringUtil.isEmpty(reqJson.getString("payAdapt"))){ |
| | | payAdapt = reqJson.getString("payAdapt"); |
| | | } |
| | | |
| | | IPaymentFactoryAdapt tPayAdapt = ApplicationContextFactory.getBean(payAdapt, IPaymentFactoryAdapt.class); |
| | | |
| | | // 4.0 相应支付厂家下单 |