mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
update
This commit is contained in:
@@ -588,9 +588,8 @@ public class MemberService {
|
||||
createAdaPaymentParam.setPay_amt(AdapayUtil.formatAmount(dto.getAmount()));
|
||||
createAdaPaymentParam.setApp_id(ADAPAY_APP_ID); // 移动到配置文件中
|
||||
createAdaPaymentParam.setPay_channel("wx_lite"); // todo 如果以后有支付宝等别的渠道,这里需要做修改,判断是什么渠道的请求
|
||||
createAdaPaymentParam.setGoods_title("余额");
|
||||
createAdaPaymentParam.setGoods_title("充值余额");
|
||||
createAdaPaymentParam.setGoods_desc("会员充值余额");
|
||||
// createAdaPaymentParam.setDescription("充电费用3");
|
||||
createAdaPaymentParam.setExpend(JSONObject.toJSONString( ImmutableMap.of("open_id", dto.getOpenId())));
|
||||
//异步通知地址,url为http/https路径,服务器POST回调,URL 上请勿附带参数
|
||||
createAdaPaymentParam.setNotify_url(ADAPAY_CALLBACK_URL);
|
||||
|
||||
@@ -2328,48 +2328,6 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信支付订单逻辑 获取支付参数
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
private Map<String, Object> wechatPayOrder(PayOrderDTO dto) throws Exception {
|
||||
// 相同参数重复请求,返回同一个支付对象
|
||||
String redisKey = CacheConstants.WECHAT_PAY_ORDER_PARAM + dto.getOrderCode();
|
||||
Map<String, Object> cacheObject = redisCache.getCacheObject(redisKey);
|
||||
if (cacheObject != null) {
|
||||
return cacheObject;
|
||||
}
|
||||
|
||||
OrderBasicInfo orderInfo = dto.getOrderBasicInfo();
|
||||
if (orderInfo == null) {
|
||||
orderInfo = this.getOrderInfoByOrderCode(dto.getOrderCode());
|
||||
}
|
||||
String openId = wxAppletRemoteService.getOpenIdByCode(dto.getCode());
|
||||
if (StringUtils.isBlank(openId)) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_GET_OPEN_ID_BY_CODE_ERROR);
|
||||
}
|
||||
WeixinPayDTO weixinPayDTO = new WeixinPayDTO();
|
||||
weixinPayDTO.setOpenId(openId);
|
||||
weixinPayDTO.setAmount(dto.getPayAmount().toString());
|
||||
// 支付订单 附加参数
|
||||
PaymentScenarioDTO paymentScenarioDTO = PaymentScenarioDTO.builder()
|
||||
.type(ScenarioEnum.ORDER.getValue())
|
||||
.orderCode(dto.getOrderCode())
|
||||
.memberId(orderInfo.getMemberId())
|
||||
.build();
|
||||
weixinPayDTO.setAttach(JSONObject.toJSONString(paymentScenarioDTO));
|
||||
weixinPayDTO.setDescription("充电费用");
|
||||
Map<String, Object> payV3 = wechatPayService.weixinPayV3(weixinPayDTO);
|
||||
if (payV3 != null) {
|
||||
// 表示已经获取到支付参数了,后续再有支付请求就拒绝
|
||||
redisCache.setCacheObject(redisKey, payV3, 15, TimeUnit.MINUTES);
|
||||
}
|
||||
return payV3;
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用汇付支付
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user