This commit is contained in:
2023-07-07 11:22:10 +08:00
parent bbaa7aed67
commit 5efbc85804
4 changed files with 27 additions and 3 deletions

View File

@@ -909,6 +909,28 @@ public class OrderService {
// 使用微信支付 // 使用微信支付
payInfo.setPayMode(OrderPayModeEnum.PAYMENT_OF_WECHATPAY.getValue()); payInfo.setPayMode(OrderPayModeEnum.PAYMENT_OF_WECHATPAY.getValue());
payInfo.setPayModeDesc(OrderPayModeEnum.PAYMENT_OF_WECHATPAY.getLabel()); payInfo.setPayModeDesc(OrderPayModeEnum.PAYMENT_OF_WECHATPAY.getLabel());
// 判断是微信支付还是汇付支付
MemberTransactionRecord record = memberTransactionRecordService.selectByOrderCode(orderCode);
if (record != null) {
String paymentInstitutions = record.getPaymentInstitutions();
if (StringUtils.equals(paymentInstitutions, PaymentInstitutionsEnum.WECHAT_PAY.getValue())) {
// 查微信支付回调记录
WxpayCallbackRecord wxpayCallbackRecord = wxpayCallbackRecordService.selectByOrderCode(orderCode);
if (wxpayCallbackRecord != null) {
payInfo.setOutTradeNo(wxpayCallbackRecord.getOutTradeNo());
payInfo.setTransactionId(wxpayCallbackRecord.getTransactionId());
}
} else if (StringUtils.equals(paymentInstitutions, PaymentInstitutionsEnum.ADAPAY.getValue())) {
// 查询汇付支付回调
AdapayCallbackRecord adapayCallbackRecord = adapayCallbackRecordService.selectByOrderCode(orderCode);
if (adapayCallbackRecord != null) {
payInfo.setOutTradeNo(adapayCallbackRecord.getPaymentId());
payInfo.setTransactionId(adapayCallbackRecord.getOutTransId());
}
}
}
// 查微信支付回调记录 // 查微信支付回调记录
WxpayCallbackRecord wxpayCallbackRecord = wxpayCallbackRecordService.selectByOrderCode(orderCode); WxpayCallbackRecord wxpayCallbackRecord = wxpayCallbackRecordService.selectByOrderCode(orderCode);
if (wxpayCallbackRecord != null) { if (wxpayCallbackRecord != null) {

View File

@@ -40,7 +40,9 @@ public class CacheConstants {
public static final String PILE_PROGRAM_VERSION = "pile_program_version_"; public static final String PILE_PROGRAM_VERSION = "pile_program_version_";
// 查询订单回调 // 查询订单回调
public static final String QUERY_ORDER_CALLBACK = "query_order_callback:"; public static final String QUERY_ORDER_WECHAT_CALLBACK = "query_order_wechat_callback:";
public static final String QUERY_ORDER_ADAPAY_CALLBACK = "query_order_adapay_callback:";
// 汇付支付参数 // 汇付支付参数
public static final String ADAPAY_ORDER_PARAM = "adapay_order_param:"; public static final String ADAPAY_ORDER_PARAM = "adapay_order_param:";

View File

@@ -64,7 +64,7 @@ public class AdapayCallbackRecordServiceImpl implements AdapayCallbackRecordServ
if (StringUtils.isBlank(orderCode)) { if (StringUtils.isBlank(orderCode)) {
return null; return null;
} }
String redisKey = CacheConstants.QUERY_ORDER_CALLBACK + orderCode; String redisKey = CacheConstants.QUERY_ORDER_ADAPAY_CALLBACK + orderCode;
AdapayCallbackRecord record = redisCache.getCacheObject(redisKey); AdapayCallbackRecord record = redisCache.getCacheObject(redisKey);
if (record != null) { if (record != null) {
return record; return record;

View File

@@ -61,7 +61,7 @@ public class WxpayCallbackRecordServiceImpl implements WxpayCallbackRecordServic
if (StringUtils.isBlank(orderCode)) { if (StringUtils.isBlank(orderCode)) {
return null; return null;
} }
String redisKey = CacheConstants.QUERY_ORDER_CALLBACK + orderCode; String redisKey = CacheConstants.QUERY_ORDER_WECHAT_CALLBACK + orderCode;
WxpayCallbackRecord wxpayCallbackRecord = redisCache.getCacheObject(redisKey); WxpayCallbackRecord wxpayCallbackRecord = redisCache.getCacheObject(redisKey);
if (wxpayCallbackRecord != null) { if (wxpayCallbackRecord != null) {
return wxpayCallbackRecord; return wxpayCallbackRecord;