mirror of
https://gitee.com/dromara/dax-pay.git
synced 2025-11-29 01:05:12 +08:00
style 一些代码样式的修改
This commit is contained in:
@@ -96,6 +96,24 @@ public class AliPayConfigService {
|
||||
channelConfigManager.updateById(channelConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取异步通知地址
|
||||
*/
|
||||
public String getNotifyUrl() {
|
||||
var mchAppInfo = PaymentContextLocal.get().getMchAppInfo();
|
||||
var platformInfo = platformConfigService.getConfig();
|
||||
return StrUtil.format("{}/unipay/callback/{}/alipay",platformInfo.getGatewayServiceUrl(), mchAppInfo.getAppId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取同步通知地址
|
||||
*/
|
||||
public String getReturnUrl() {
|
||||
MchAppLocal mchAppInfo = PaymentContextLocal.get().getMchAppInfo();
|
||||
var platformInfo = platformConfigService.getConfig();
|
||||
return StrUtil.format("{}/unipay/return/{}/{}/alipay",platformInfo.getGatewayServiceUrl(), mchAppInfo.getAppId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取支付宝支付配置
|
||||
*/
|
||||
@@ -124,24 +142,6 @@ public class AliPayConfigService {
|
||||
return this.getAlipayClient(aliPayConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取异步通知地址
|
||||
*/
|
||||
public String getNotifyUrl() {
|
||||
var mchAppInfo = PaymentContextLocal.get().getMchAppInfo();
|
||||
var platformInfo = platformConfigService.getConfig();
|
||||
return StrUtil.format("{}/unipay/callback/{}/alipay",platformInfo.getGatewayServiceUrl(), mchAppInfo.getAppId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取同步通知地址
|
||||
*/
|
||||
public String getReturnUrl() {
|
||||
MchAppLocal mchAppInfo = PaymentContextLocal.get().getMchAppInfo();
|
||||
var platformInfo = platformConfigService.getConfig();
|
||||
return StrUtil.format("{}/unipay/return/{}/{}/alipay",platformInfo.getGatewayServiceUrl(), mchAppInfo.getAppId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取支付宝SDK的配置
|
||||
*/
|
||||
|
||||
@@ -43,7 +43,7 @@ public class AliPayAuthService {
|
||||
return new AuthUrlResult();
|
||||
} else {
|
||||
PlatformConfig platformConfig = platformsConfigService.getConfig();
|
||||
AliPayConfig aliPayConfig = aliPayConfigService.getAliPayConfig();
|
||||
AliPayConfig aliPayConfig = aliPayConfigService.getAndCheckConfig();
|
||||
String queryCode = RandomUtil.randomString(10);
|
||||
|
||||
// 授权地址
|
||||
|
||||
@@ -47,8 +47,7 @@ public class AliPayService {
|
||||
* 支付前检查支付方式是否可用
|
||||
*/
|
||||
public void validation(PayParam payParam) {
|
||||
AliPayConfig alipayConfig = aliPayConfigService.getAliPayConfig();
|
||||
|
||||
AliPayConfig alipayConfig = aliPayConfigService.getAndCheckConfig();
|
||||
// 验证订单金额是否超限
|
||||
if(BigDecimalUtil.isGreaterThan(payParam.getAmount(), alipayConfig.getLimitAmount())){
|
||||
throw new AmountExceedLimitException("支付宝支付金额超过限额");
|
||||
|
||||
@@ -103,7 +103,7 @@ public class AliPayTransferService {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 转换收款人类型
|
||||
*/
|
||||
public String getIdentityType(TransferPayeeTypeEnum payeeType){
|
||||
switch (payeeType){
|
||||
|
||||
@@ -35,7 +35,7 @@ public class AliPayCloseStrategy extends AbsPayCloseStrategy {
|
||||
*/
|
||||
@Override
|
||||
public void doBeforeCloseHandler() {
|
||||
this.alipayConfig = alipayConfigService.getAliPayConfig();
|
||||
this.alipayConfig = alipayConfigService.getAndCheckConfig();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONException;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Setter;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.http.*;
|
||||
import org.apache.http.client.HttpResponseException;
|
||||
@@ -308,6 +309,7 @@ public class ClientHttpRequest<T> extends HttpEntityEnclosingRequestBase impleme
|
||||
* @return 对应的响应对象
|
||||
* @throws IOException 响应类型文本转换时抛出异常
|
||||
*/
|
||||
@SneakyThrows
|
||||
private T toBean(HttpEntity entity, String[] contentType) throws IOException {
|
||||
|
||||
|
||||
@@ -330,7 +332,7 @@ public class ClientHttpRequest<T> extends HttpEntityEnclosingRequestBase impleme
|
||||
if (responseType == OutputStream.class){
|
||||
t= new ByteArrayOutputStream();
|
||||
}else {
|
||||
t = (OutputStream) responseType.newInstance();
|
||||
t = (OutputStream) responseType.getDeclaredConstructor().newInstance();
|
||||
}
|
||||
entity.writeTo( t);
|
||||
return (T) t;
|
||||
|
||||
Reference in New Issue
Block a user