fix:支付宝支付回调
This commit is contained in:
+4
-4
@@ -169,9 +169,9 @@ public class AliPayController {
|
|||||||
// ISV(服务商)模式下应优先使用 auth_app_id 定位商家应用
|
// ISV(服务商)模式下应优先使用 auth_app_id 定位商家应用
|
||||||
String authAppId = params.get("auth_app_id");
|
String authAppId = params.get("auth_app_id");
|
||||||
String lookupAppId = (authAppId != null && !authAppId.isEmpty()) ? authAppId : appId;
|
String lookupAppId = (authAppId != null && !authAppId.isEmpty()) ? authAppId : appId;
|
||||||
AlipayConfig config = alipayConfigService.getConfigByAppId(lookupAppId);
|
AlipayConfig config = alipayConfigService.getConfigByAppIdAndType(lookupAppId, "PAY");
|
||||||
if (config == null) {
|
if (config == null) {
|
||||||
log.error("支付宝配置不存在,appId: {}, authAppId: {}", appId, authAppId);
|
log.error("支付宝支付配置不存在,appId: {}, authAppId: {}", appId, authAppId);
|
||||||
return "failure";
|
return "failure";
|
||||||
}
|
}
|
||||||
TenantContextHolder.setTenant(config.getTenantId());
|
TenantContextHolder.setTenant(config.getTenantId());
|
||||||
@@ -300,9 +300,9 @@ public class AliPayController {
|
|||||||
// ISV 模式下应使用 auth_app_id 定位商家应用
|
// ISV 模式下应使用 auth_app_id 定位商家应用
|
||||||
String authAppId = params.get("auth_app_id");
|
String authAppId = params.get("auth_app_id");
|
||||||
String lookupAppId = (authAppId != null && !authAppId.isEmpty()) ? authAppId : appId;
|
String lookupAppId = (authAppId != null && !authAppId.isEmpty()) ? authAppId : appId;
|
||||||
AlipayConfig config = alipayConfigService.getConfigByAppId(lookupAppId);
|
AlipayConfig config = alipayConfigService.getConfigByAppIdAndType(lookupAppId, "PAY");
|
||||||
if (config == null) {
|
if (config == null) {
|
||||||
log.error("支付宝配置不存在,appId: {}, authAppId: {}", appId, authAppId);
|
log.error("支付宝支付配置不存在,appId: {}, authAppId: {}", appId, authAppId);
|
||||||
return "failure";
|
return "failure";
|
||||||
}
|
}
|
||||||
TenantContextHolder.setTenant(config.getTenantId());
|
TenantContextHolder.setTenant(config.getTenantId());
|
||||||
|
|||||||
+2
-1
@@ -59,7 +59,8 @@ public class AlipayConfigServiceImpl
|
|||||||
public AlipayConfig getConfigByAppId(String appId) {
|
public AlipayConfig getConfigByAppId(String appId) {
|
||||||
LambdaQueryWrapper<AlipayConfig> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<AlipayConfig> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.eq(AlipayConfig::getAppId, appId)
|
wrapper.eq(AlipayConfig::getAppId, appId)
|
||||||
.eq(AlipayConfig::getStatus, 1);
|
.eq(AlipayConfig::getStatus, 1)
|
||||||
|
.last("LIMIT 1");
|
||||||
return baseMapper.selectOne(wrapper);
|
return baseMapper.selectOne(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user