|
@@ -1,7 +1,6 @@
|
|
package cn.iocoder.yudao.framework.pay.core.client.impl;
|
|
package cn.iocoder.yudao.framework.pay.core.client.impl;
|
|
|
|
|
|
import cn.hutool.extra.validation.ValidationUtil;
|
|
import cn.hutool.extra.validation.ValidationUtil;
|
|
-import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants;
|
|
|
|
import cn.iocoder.yudao.framework.pay.core.client.AbstractPayCodeMapping;
|
|
import cn.iocoder.yudao.framework.pay.core.client.AbstractPayCodeMapping;
|
|
import cn.iocoder.yudao.framework.pay.core.client.PayClient;
|
|
import cn.iocoder.yudao.framework.pay.core.client.PayClient;
|
|
import cn.iocoder.yudao.framework.pay.core.client.PayClientConfig;
|
|
import cn.iocoder.yudao.framework.pay.core.client.PayClientConfig;
|
|
@@ -11,7 +10,6 @@ import cn.iocoder.yudao.framework.pay.core.client.dto.PayRefundUnifiedReqDTO;
|
|
import cn.iocoder.yudao.framework.pay.core.client.dto.PayRefundUnifiedRespDTO;
|
|
import cn.iocoder.yudao.framework.pay.core.client.dto.PayRefundUnifiedRespDTO;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
-import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
|
|
import static cn.iocoder.yudao.framework.common.util.json.JsonUtils.toJsonString;
|
|
import static cn.iocoder.yudao.framework.common.util.json.JsonUtils.toJsonString;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -26,7 +24,6 @@ public abstract class AbstractPayClient<Config extends PayClientConfig> implemen
|
|
* 渠道编号
|
|
* 渠道编号
|
|
*/
|
|
*/
|
|
private final Long channelId;
|
|
private final Long channelId;
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 渠道编码
|
|
* 渠道编码
|
|
*/
|
|
*/
|
|
@@ -40,10 +37,6 @@ public abstract class AbstractPayClient<Config extends PayClientConfig> implemen
|
|
*/
|
|
*/
|
|
protected Config config;
|
|
protected Config config;
|
|
|
|
|
|
- protected Double calculateAmount(Long amount) {
|
|
|
|
- return amount / 100.0;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
public AbstractPayClient(Long channelId, String channelCode, Config config, AbstractPayCodeMapping codeMapping) {
|
|
public AbstractPayClient(Long channelId, String channelCode, Config config, AbstractPayCodeMapping codeMapping) {
|
|
this.channelId = channelId;
|
|
this.channelId = channelId;
|
|
this.channelCode = channelCode;
|
|
this.channelCode = channelCode;
|
|
@@ -75,6 +68,10 @@ public abstract class AbstractPayClient<Config extends PayClientConfig> implemen
|
|
this.init();
|
|
this.init();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ protected Double calculateAmount(Long amount) {
|
|
|
|
+ return amount / 100.0;
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public Long getId() {
|
|
public Long getId() {
|
|
return channelId;
|
|
return channelId;
|
|
@@ -96,12 +93,9 @@ public abstract class AbstractPayClient<Config extends PayClientConfig> implemen
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
protected abstract PayCommonResult<?> doUnifiedOrder(PayOrderUnifiedReqDTO reqDTO)
|
|
protected abstract PayCommonResult<?> doUnifiedOrder(PayOrderUnifiedReqDTO reqDTO)
|
|
throws Throwable;
|
|
throws Throwable;
|
|
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
public PayCommonResult<PayRefundUnifiedRespDTO> unifiedRefund(PayRefundUnifiedReqDTO reqDTO) {
|
|
public PayCommonResult<PayRefundUnifiedRespDTO> unifiedRefund(PayRefundUnifiedReqDTO reqDTO) {
|
|
PayCommonResult<PayRefundUnifiedRespDTO> resp;
|
|
PayCommonResult<PayRefundUnifiedRespDTO> resp;
|
|
@@ -115,7 +109,6 @@ public abstract class AbstractPayClient<Config extends PayClientConfig> implemen
|
|
return resp;
|
|
return resp;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
protected abstract PayCommonResult<PayRefundUnifiedRespDTO> doUnifiedRefund(PayRefundUnifiedReqDTO reqDTO) throws Throwable;
|
|
protected abstract PayCommonResult<PayRefundUnifiedRespDTO> doUnifiedRefund(PayRefundUnifiedReqDTO reqDTO) throws Throwable;
|
|
|
|
|
|
}
|
|
}
|