This commit is contained in:
2023-07-10 16:53:16 +08:00
parent d5c4384e33
commit 0c95333234
3 changed files with 26 additions and 18 deletions

View File

@@ -350,8 +350,8 @@ public class PayController extends BaseController {
public void adapayCallback(HttpServletRequest request) {
try {
orderService.adapayCallback(request);
// String type = request.getParameter("type");
// logger.info("汇付回调type:{}", type);
String type = request.getParameter("type");
logger.info("汇付回调type:{}", type);
} catch (Exception e) {
logger.error("汇付支付回调失败 error", e);
}

View File

@@ -26,6 +26,7 @@ import com.jsowell.common.core.page.PageResponse;
import com.jsowell.common.core.redis.RedisCache;
import com.jsowell.common.enums.InvoiceRecordEnum;
import com.jsowell.common.enums.MemberWalletEnum;
import com.jsowell.common.enums.adapay.AdapayEventEnum;
import com.jsowell.common.enums.ykc.*;
import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.util.AdapayUtil;
@@ -1325,10 +1326,17 @@ public class OrderService {
return;
}
if (StringUtils.equals("payment.succeeded", type)) {
if (StringUtils.equals(AdapayEventEnum.payment_succeeded.getValue(), type)) {
paymentSucceeded(data);
}
// switch (type) {
// case AdapayEventEnum.payment_succeeded.getValue():
//
// }
}
private void paymentSucceeded(String data) throws JsonProcessingException {

View File

@@ -2145,22 +2145,22 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
// 微信支付
dto.setOrderBasicInfo(orderInfo);
Map<String, Object> weixinMap = null;
Map<String, Object> weixinMap = adapayPayOrder(dto);
// 从字典中获取使用汇付支付的站点
List<SysDictData> adapay_station = DictUtils.getDictCache("adapay_station");
List<String> stationIdList = Lists.newArrayList();
if (CollectionUtils.isNotEmpty(adapay_station)) {
for (SysDictData sysDictData : adapay_station) {
stationIdList.add(sysDictData.getDictValue());
}
}
if (stationIdList.contains(orderInfo.getStationId())) {
logger.info("该站点:{}在字典中配置了使用汇付支付", orderInfo.getStationId());
weixinMap = adapayPayOrder(dto);
} else {
logger.info("该站点:{}使用微信支付", orderInfo.getStationId());
weixinMap = wechatPayOrder(dto);
}
// List<SysDictData> adapay_station = DictUtils.getDictCache("adapay_station");
// List<String> stationIdList = Lists.newArrayList();
// if (CollectionUtils.isNotEmpty(adapay_station)) {
// for (SysDictData sysDictData : adapay_station) {
// stationIdList.add(sysDictData.getDictValue());
// }
// }
// if (stationIdList.contains(orderInfo.getStationId())) {
// logger.info("该站点:{}在字典中配置了使用汇付支付", orderInfo.getStationId());
// weixinMap = adapayPayOrder(dto);
// } else {
// logger.info("该站点:{}使用微信支付", orderInfo.getStationId());
// weixinMap = wechatPayOrder(dto);
// }
// 返回微信支付参数
resultMap.put("weixinMap", weixinMap);