feat(alipay-isv): 新增代运营授权回调地址查询端点

This commit is contained in:
DaxPay Dev
2026-07-10 10:10:30 +08:00
parent d4a35838a1
commit a431aa8162
2 changed files with 17 additions and 0 deletions

View File

@@ -64,4 +64,11 @@ public class AlipayIsvChannelMerchantController {
public Result<AlipayIsvAuthUrlResult> genAuthUrl(@RequestBody @Validated AlipayIsvAuthParam param) {
return Res.ok(alipayIsvAuthService.genAuthUrl(param));
}
@PermCode(code = "view", nameCn = "通道商户查看", nameEn = "Channel Merchant View")
@Operation(summary = "获取代运营授权回调地址")
@GetMapping("/auth-callback-url")
public Result<String> getAuthCallbackUrl() {
return Res.ok(alipayIsvAuthService.getAuthCallbackUrl());
}
}

View File

@@ -83,6 +83,16 @@ public class AlipayIsvAuthService {
return new AlipayIsvAuthUrlResult().setAuthUrl(authUrl);
}
/// 获取代运营授权回调地址(用于支付宝开放平台配置)
public String getAuthCallbackUrl() {
String gatewayBase = platformUrlConfigService.getUrlConfig().getPaymentGatewayBaseUrl();
if (StrUtil.isBlank(gatewayBase)) {
throw new BizInfoException(DaxPayErrorCode.OPERATION_FAIL,
"error.channel.alipay.paymentGatewayUrlRequired");
}
return gatewayBase + "/isv-auth/alipay";
}
/// H5 回调: 授权码换 token + 绑定校验 + 写回通道商户
@Transactional(rollbackFor = Exception.class)
public void auth(AlipayIsvAuthParam param) {