## Opt - 调整接口名称&回调成功验证&单号查询条件
This commit is contained in:
parent
b5381548e2
commit
c4b6ea06cf
|
@ -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
|
||||
**/
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
queryWrapper.eq(TOnlinePayment::getBusinessType, businessType);
|
||||
if(ObjectUtil.isNotEmpty(businessType)){
|
||||
queryWrapper.eq(TOnlinePayment::getBusinessType, businessType);
|
||||
}
|
||||
queryWrapper.eq(TOnlinePayment::getBusinessCode, businessCode);
|
||||
return baseMapper.selectOne(queryWrapper);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue