## Opt - 调整接口名称&回调成功验证&单号查询条件

This commit is contained in:
sangelxiu1 2025-07-04 14:59:31 +08:00
parent c97dfbcb57
commit afa7e63a25
5 changed files with 13 additions and 6 deletions

View File

@ -11,7 +11,8 @@ public class JdPayConstant {
/**
* 三方聚合统一收单 url
**/
public static final String AGGREGATE_CREATE_ORDER_URL = "/api/createAggregateOrder";
// public static final String AGGREGATE_CREATE_ORDER_URL = "/api/createAggregateOrder";
public static final String AGGREGATE_CREATE_ORDER_URL = "/api/createIndustryOrder";
/**
* 交易查询 url
**/

View File

@ -300,7 +300,7 @@ public class JdPayServiceImpl implements IJdPayService {
.tradeAmount(onlinePayment.getPayMoney())
.outTradeNo(request.getOutTradeNo())
.build();
if ("0000".equals(response.getResultCode())) {
if ("00000".equals(response.getResultCode())) {
// 请求响应成功
// 京东唯一订单号
onlinePayment.setPayNumber(response.getTradeNo());

View File

@ -1,5 +1,6 @@
package com.hzs.third.pay.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hzs.activity.base.IActivityServiceApi;
import com.hzs.common.core.constant.CacheConstants;
@ -66,7 +67,9 @@ public class PayServiceImpl implements IPayService {
try {
// 校验支付信息状态业务与支付金额是否一致等
TOnlinePayment onlinePayment = itOnlinePaymentService.queryByBusiness(Integer.valueOf(businessType), businessCode, null);
TOnlinePayment onlinePayment = itOnlinePaymentService.queryByBusiness(
ObjectUtil.isNotEmpty(businessType) ? Integer.valueOf(businessType) : null
, businessCode, null);
if (null == onlinePayment || EPayStatus.PAID.getValue() == onlinePayment.getPayStatus()) {
log.error("支付信息不存在或已支付");
return false;

View File

@ -384,7 +384,7 @@ public class RefundServiceImpl implements IRefundService {
// 请求京东退款接口
JdPayRefundResponse response = jdPay.refund(request);
if ("0000".equals(response.getResultCode())) {
if ("00000".equals(response.getResultCode())) {
// 请求响应成功
// 申请退款成功保存退款
TOnlineRefund tOnlineRefund = new TOnlineRefund();
@ -465,7 +465,7 @@ public class RefundServiceImpl implements IRefundService {
itOnlineRefundService.save(tOnlineRefund);
return "提交退款成功";
} else {
log.info("提交退款失败");
log.error("提交退款失败! {}", JSONUtil.toJsonStr(response));
return "提交退款失败!["+response.getResultDesc()+"]";
}
} catch (Exception e) {

View File

@ -1,5 +1,6 @@
package com.hzs.third.pay.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzs.common.domain.third.pay.TOnlinePayment;
@ -33,7 +34,9 @@ public class TOnlinePaymentServiceImpl extends ServiceImpl<TOnlinePaymentMapper,
if (null != pkCountry) {
queryWrapper.eq(TOnlinePayment::getPkCountry, pkCountry);
}
if(ObjectUtil.isNotEmpty(businessType)){
queryWrapper.eq(TOnlinePayment::getBusinessType, businessType);
}
queryWrapper.eq(TOnlinePayment::getBusinessCode, businessCode);
return baseMapper.selectOne(queryWrapper);
}