mirror of
https://gitee.com/dromara/dax-pay
synced 2026-08-09 22:45:58 +08:00
refactor(lakala): 拉卡拉调用路由由 channel-one 切换至 channel-two
This commit is contained in:
@@ -18,7 +18,7 @@ import org.springframework.web.service.annotation.PostExchange;
|
||||
|
||||
/// # 拉卡拉通道客户端
|
||||
///
|
||||
/// 声明式 HTTP 接口, 调用子应用 dax-pay-channel-one 的拉卡拉通道接口。
|
||||
/// 声明式 HTTP 接口, 调用子应用 dax-pay-channel-two 的拉卡拉通道接口。
|
||||
/// 拉卡拉为聚合服务商模式, 不区分直连/服务商, 路径前缀 `/channel/lakala`。
|
||||
@HttpExchange(accept = MediaType.APPLICATION_JSON_VALUE, contentType = MediaType.APPLICATION_JSON_VALUE)
|
||||
public interface LakalaChannelClient {
|
||||
|
||||
@@ -4,7 +4,7 @@ import lombok.Data;
|
||||
|
||||
/// # 拉卡拉 SDK 凭证(主应用侧)
|
||||
///
|
||||
/// 与子应用 dax-pay-channel-one 的 `LakalaSdkCredential` 镜像, 跨 HTTP 传输时字段对齐。
|
||||
/// 与子应用 dax-pay-channel-two 的 `LakalaSdkCredential` 镜像, 跨 HTTP 传输时字段对齐。
|
||||
/// 主应用从服务商密钥配置(LakalaIsvKeyConfig) + 通道商户绑定(LakalaIsvChannelMerchant) 组装,
|
||||
/// 下发给子应用发起拉卡拉 API 调用。
|
||||
@Data
|
||||
|
||||
@@ -12,7 +12,7 @@ import org.springframework.web.service.invoker.HttpServiceProxyFactory;
|
||||
///
|
||||
/// 复用全局 [RestClient](由 common-spring 的 RestClientConfiguration 提供, 已预装:
|
||||
/// OTel traceparent 透传 / BusinessContextInterceptor 业务上下文透传 / Apache HttpClient5 连接池),
|
||||
/// 经 `mutate()` 派生出绑定 channel-one baseUrl 的实例。
|
||||
/// 经 `mutate()` 派生出绑定 channel-two baseUrl 的实例。
|
||||
///
|
||||
/// baseUrl 从 [DaxpayChannelProperties] 统一读取。
|
||||
@Configuration
|
||||
@@ -25,7 +25,7 @@ public class LakalaClientConfig {
|
||||
// mutate 派生: 继承全局 RestClient 的拦截器 / observation / requestFactory, 仅覆盖 baseUrl
|
||||
RestClient channelClient = restClient
|
||||
.mutate()
|
||||
.baseUrl(channelProperties.getOne().getBaseUrl())
|
||||
.baseUrl(channelProperties.getTwo().getBaseUrl())
|
||||
.build();
|
||||
return HttpServiceProxyFactory
|
||||
.builderFor(RestClientAdapter.create(channelClient))
|
||||
|
||||
@@ -19,7 +19,7 @@ import org.springframework.stereotype.Service;
|
||||
/// # 拉卡拉服务商通道凭证组装器
|
||||
///
|
||||
/// 从服务商密钥配置([LakalaIsvKeyConfig]) + 通道商户绑定([LakalaIsvChannelMerchant]) 组装通道调用凭证,
|
||||
/// 下发给子应用 dax-pay-channel-one 发起拉卡拉 API 调用。
|
||||
/// 下发给子应用 dax-pay-channel-two 发起拉卡拉 API 调用。
|
||||
///
|
||||
/// 字段映射(对齐拉卡拉 V3 接口):
|
||||
/// - lkl_app_id ← [LakalaIsvKeyConfig.lklAppId] (拉卡拉应用编号, 全局唯一)
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
/// # 拉卡拉服务商支付执行业务服务
|
||||
///
|
||||
/// 通过 [LakalaChannelClient] 调用子应用 dax-pay-channel-one 完成拉卡拉支付下单。
|
||||
/// 通过 [LakalaChannelClient] 调用子应用 dax-pay-channel-two 完成拉卡拉支付下单。
|
||||
/// 请求构建、响应解析全部在本类中完成。
|
||||
///
|
||||
/// 拉卡拉聚合通道: 一个接口承载微信/支付宝/银联三种底层渠道, 由 accountType + transType 决定路由。
|
||||
|
||||
Reference in New Issue
Block a user