feat:【MALL 商城】商城分佣提现,完成对微信转账(小程序)的对接

This commit is contained in:
YunaiV 2025-05-11 12:39:05 +08:00
parent fd8567f0fa
commit 44548ee03f
10 changed files with 80 additions and 27 deletions

View File

@ -31,6 +31,7 @@ import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getLogi
@Validated @Validated
@Slf4j @Slf4j
public class AppBrokerageRecordController { public class AppBrokerageRecordController {
@Resource @Resource
private BrokerageRecordService brokerageRecordService; private BrokerageRecordService brokerageRecordService;
@ -49,4 +50,4 @@ public class AppBrokerageRecordController {
return success(brokerageRecordService.calculateProductBrokeragePrice(getLoginUserId(), spuId)); return success(brokerageRecordService.calculateProductBrokeragePrice(getLoginUserId(), spuId));
} }
} }

View File

@ -0,0 +1,36 @@
package cn.iocoder.yudao.module.pay.controller.app.transfer;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.pay.service.transfer.PayTransferService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "用户 APP - 转账单")
@RestController
@RequestMapping("/pay/transfer")
@Validated
@Slf4j
public class AppPayTransferController {
@Resource
private PayTransferService transferService;
@GetMapping("/sync")
@Operation(summary = "同步转账单") // 目的解决微信转账的异步回调可能有延迟的问题
@Parameter(name = "id", description = "编号", required = true, example = "1024")
public CommonResult<Boolean> syncTransfer(@RequestParam("id") Long id) {
transferService.syncTransfer(id);
return success(true);
}
}

View File

@ -140,7 +140,7 @@ public class PayOrderServiceImpl implements PayOrderService {
PayOrderDO order = validateOrderCanSubmit(reqVO.getId()); PayOrderDO order = validateOrderCanSubmit(reqVO.getId());
// 1.32 校验支付渠道是否有效 // 1.32 校验支付渠道是否有效
PayChannelDO channel = validateChannelCanSubmit(order.getAppId(), reqVO.getChannelCode()); PayChannelDO channel = validateChannelCanSubmit(order.getAppId(), reqVO.getChannelCode());
PayClient client = channelService.getPayClient(channel.getId()); PayClient<?> client = channelService.getPayClient(channel.getId());
// 2. 插入 PayOrderExtensionDO // 2. 插入 PayOrderExtensionDO
String no = noRedisDAO.generate(payProperties.getOrderNoPrefix()); String no = noRedisDAO.generate(payProperties.getOrderNoPrefix());
@ -237,7 +237,7 @@ public class PayOrderServiceImpl implements PayOrderService {
appService.validPayApp(appId); appService.validPayApp(appId);
// 校验支付渠道是否有效 // 校验支付渠道是否有效
PayChannelDO channel = channelService.validPayChannel(appId, channelCode); PayChannelDO channel = channelService.validPayChannel(appId, channelCode);
PayClient client = channelService.getPayClient(channel.getId()); PayClient<?> client = channelService.getPayClient(channel.getId());
if (client == null) { if (client == null) {
log.error("[validatePayChannelCanSubmit][渠道编号({}) 找不到对应的支付客户端]", channel.getId()); log.error("[validatePayChannelCanSubmit][渠道编号({}) 找不到对应的支付客户端]", channel.getId());
throw exception(CHANNEL_NOT_FOUND); throw exception(CHANNEL_NOT_FOUND);

View File

@ -98,7 +98,7 @@ public class PayRefundServiceImpl implements PayRefundService {
PayOrderDO order = validatePayOrderCanRefund(reqDTO, app.getId()); PayOrderDO order = validatePayOrderCanRefund(reqDTO, app.getId());
// 1.3 校验支付渠道是否有效 // 1.3 校验支付渠道是否有效
PayChannelDO channel = channelService.validPayChannel(order.getChannelId()); PayChannelDO channel = channelService.validPayChannel(order.getChannelId());
PayClient client = channelService.getPayClient(channel.getId()); PayClient<?> client = channelService.getPayClient(channel.getId());
if (client == null) { if (client == null) {
log.error("[refund][渠道编号({}) 找不到对应的支付客户端]", channel.getId()); log.error("[refund][渠道编号({}) 找不到对应的支付客户端]", channel.getId());
throw exception(CHANNEL_NOT_FOUND); throw exception(CHANNEL_NOT_FOUND);

View File

@ -52,6 +52,13 @@ public interface PayTransferService {
*/ */
int syncTransfer(); int syncTransfer();
/**
* 单个同步渠道转账单状态
*
* @param id 转账单编号
*/
void syncTransfer(Long id);
/** /**
* 渠道的转账通知 * 渠道的转账通知
* *

View File

@ -68,7 +68,7 @@ public class PayTransferServiceImpl implements PayTransferService {
PayAppDO payApp = appService.validPayApp(reqDTO.getAppKey()); PayAppDO payApp = appService.validPayApp(reqDTO.getAppKey());
// 1.2 校验支付渠道是否有效 // 1.2 校验支付渠道是否有效
PayChannelDO channel = channelService.validPayChannel(payApp.getId(), reqDTO.getChannelCode()); PayChannelDO channel = channelService.validPayChannel(payApp.getId(), reqDTO.getChannelCode());
PayClient client = channelService.getPayClient(channel.getId()); PayClient<?> client = channelService.getPayClient(channel.getId());
if (client == null) { if (client == null) {
log.error("[createTransfer][渠道编号({}) 找不到对应的支付客户端]", channel.getId()); log.error("[createTransfer][渠道编号({}) 找不到对应的支付客户端]", channel.getId());
throw exception(CHANNEL_NOT_FOUND); throw exception(CHANNEL_NOT_FOUND);
@ -273,10 +273,19 @@ public class PayTransferServiceImpl implements PayTransferService {
return count; return count;
} }
@Override
public void syncTransfer(Long id) {
PayTransferDO transfer = transferMapper.selectById(id);
if (transfer == null) {
throw exception(PAY_TRANSFER_NOT_FOUND);
}
syncTransfer(transfer);
}
private boolean syncTransfer(PayTransferDO transfer) { private boolean syncTransfer(PayTransferDO transfer) {
try { try {
// 1. 查询转账订单信息 // 1. 查询转账订单信息
PayClient payClient = channelService.getPayClient(transfer.getChannelId()); PayClient<?> payClient = channelService.getPayClient(transfer.getChannelId());
if (payClient == null) { if (payClient == null) {
log.error("[syncTransfer][渠道编号({}) 找不到对应的支付客户端]", transfer.getChannelId()); log.error("[syncTransfer][渠道编号({}) 找不到对应的支付客户端]", transfer.getChannelId());
return false; return false;

View File

@ -311,7 +311,7 @@ public class PayChannelServiceTest extends BaseDbUnitTest {
.thenReturn(mockClient); .thenReturn(mockClient);
// 调用 // 调用
PayClient client = channelService.getPayClient(id); PayClient<?> client = channelService.getPayClient(id);
// 断言 // 断言
assertSame(client, mockClient); assertSame(client, mockClient);
} }

View File

@ -350,7 +350,7 @@ public class PayOrderServiceTest extends BaseDbAndRedisUnitTest {
when(channelService.validPayChannel(eq(1L), eq(PayChannelEnum.ALIPAY_APP.getCode()))) when(channelService.validPayChannel(eq(1L), eq(PayChannelEnum.ALIPAY_APP.getCode())))
.thenReturn(channel); .thenReturn(channel);
// mock 方法client // mock 方法client
PayClient client = mock(PayClient.class); PayClient<?> client = mock(PayClient.class);
when(channelService.getPayClient(eq(10L))).thenReturn(client); when(channelService.getPayClient(eq(10L))).thenReturn(client);
// mock 方法 // mock 方法
PayOrderRespDTO unifiedOrderResp = randomPojo(PayOrderRespDTO.class, o -> PayOrderRespDTO unifiedOrderResp = randomPojo(PayOrderRespDTO.class, o ->
@ -404,7 +404,7 @@ public class PayOrderServiceTest extends BaseDbAndRedisUnitTest {
when(channelService.validPayChannel(eq(1L), eq(PayChannelEnum.ALIPAY_APP.getCode()))) when(channelService.validPayChannel(eq(1L), eq(PayChannelEnum.ALIPAY_APP.getCode())))
.thenReturn(channel); .thenReturn(channel);
// mock 方法client // mock 方法client
PayClient client = mock(PayClient.class); PayClient<?> client = mock(PayClient.class);
when(channelService.getPayClient(eq(10L))).thenReturn(client); when(channelService.getPayClient(eq(10L))).thenReturn(client);
// mock 方法支付渠道的调用 // mock 方法支付渠道的调用
PayOrderRespDTO unifiedOrderResp = randomPojo(PayOrderRespDTO.class, o -> o.setChannelErrorCode(null).setChannelErrorMsg(null) PayOrderRespDTO unifiedOrderResp = randomPojo(PayOrderRespDTO.class, o -> o.setChannelErrorCode(null).setChannelErrorMsg(null)
@ -462,7 +462,7 @@ public class PayOrderServiceTest extends BaseDbAndRedisUnitTest {
o -> o.setOrderId(id).setStatus(PayOrderStatusEnum.WAITING.getStatus())); o -> o.setOrderId(id).setStatus(PayOrderStatusEnum.WAITING.getStatus()));
orderExtensionMapper.insert(orderExtension); orderExtensionMapper.insert(orderExtension);
// mock 方法PayClient 已支付 // mock 方法PayClient 已支付
PayClient client = mock(PayClient.class); PayClient<?> client = mock(PayClient.class);
when(channelService.getPayClient(eq(orderExtension.getChannelId()))).thenReturn(client); when(channelService.getPayClient(eq(orderExtension.getChannelId()))).thenReturn(client);
when(client.getOrder(eq(orderExtension.getNo()))).thenReturn(randomPojo(PayOrderRespDTO.class, when(client.getOrder(eq(orderExtension.getNo()))).thenReturn(randomPojo(PayOrderRespDTO.class,
o -> o.setStatus(PayOrderStatusEnum.SUCCESS.getStatus()))); o -> o.setStatus(PayOrderStatusEnum.SUCCESS.getStatus())));
@ -481,7 +481,7 @@ public class PayOrderServiceTest extends BaseDbAndRedisUnitTest {
o -> o.setOrderId(id).setStatus(PayOrderStatusEnum.WAITING.getStatus())); o -> o.setOrderId(id).setStatus(PayOrderStatusEnum.WAITING.getStatus()));
orderExtensionMapper.insert(orderExtension); orderExtensionMapper.insert(orderExtension);
// mock 方法PayClient 已支付 // mock 方法PayClient 已支付
PayClient client = mock(PayClient.class); PayClient<?> client = mock(PayClient.class);
when(channelService.getPayClient(eq(orderExtension.getChannelId()))).thenReturn(client); when(channelService.getPayClient(eq(orderExtension.getChannelId()))).thenReturn(client);
when(client.getOrder(eq(orderExtension.getNo()))).thenReturn(randomPojo(PayOrderRespDTO.class, when(client.getOrder(eq(orderExtension.getNo()))).thenReturn(randomPojo(PayOrderRespDTO.class,
o -> o.setStatus(PayOrderStatusEnum.WAITING.getStatus()))); o -> o.setStatus(PayOrderStatusEnum.WAITING.getStatus())));
@ -873,7 +873,7 @@ public class PayOrderServiceTest extends BaseDbAndRedisUnitTest {
.setCreateTime(LocalDateTime.now())); .setCreateTime(LocalDateTime.now()));
orderExtensionMapper.insert(orderExtension); orderExtensionMapper.insert(orderExtension);
// mock 方法PayClient // mock 方法PayClient
PayClient client = mock(PayClient.class); PayClient<?> client = mock(PayClient.class);
when(channelService.getPayClient(eq(10L))).thenReturn(client); when(channelService.getPayClient(eq(10L))).thenReturn(client);
// mock 方法PayClient 异常 // mock 方法PayClient 异常
when(client.getOrder(any())).thenThrow(new RuntimeException()); when(client.getOrder(any())).thenThrow(new RuntimeException());
@ -900,7 +900,7 @@ public class PayOrderServiceTest extends BaseDbAndRedisUnitTest {
.setCreateTime(LocalDateTime.now())); .setCreateTime(LocalDateTime.now()));
orderExtensionMapper.insert(orderExtension); orderExtensionMapper.insert(orderExtension);
// mock 方法PayClient // mock 方法PayClient
PayClient client = mock(PayClient.class); PayClient<?> client = mock(PayClient.class);
when(channelService.getPayClient(eq(10L))).thenReturn(client); when(channelService.getPayClient(eq(10L))).thenReturn(client);
// mock 方法PayClient 成功返回 // mock 方法PayClient 成功返回
PayOrderRespDTO respDTO = randomPojo(PayOrderRespDTO.class, PayOrderRespDTO respDTO = randomPojo(PayOrderRespDTO.class,
@ -934,7 +934,7 @@ public class PayOrderServiceTest extends BaseDbAndRedisUnitTest {
.setCreateTime(LocalDateTime.now())); .setCreateTime(LocalDateTime.now()));
orderExtensionMapper.insert(orderExtension); orderExtensionMapper.insert(orderExtension);
// mock 方法PayClient // mock 方法PayClient
PayClient client = mock(PayClient.class); PayClient<?> client = mock(PayClient.class);
when(channelService.getPayClient(eq(10L))).thenReturn(client); when(channelService.getPayClient(eq(10L))).thenReturn(client);
// mock 方法PayClient 成功返回 // mock 方法PayClient 成功返回
PayOrderRespDTO respDTO = randomPojo(PayOrderRespDTO.class, PayOrderRespDTO respDTO = randomPojo(PayOrderRespDTO.class,
@ -965,7 +965,7 @@ public class PayOrderServiceTest extends BaseDbAndRedisUnitTest {
.setOrderId(order.getId())); .setOrderId(order.getId()));
orderExtensionMapper.insert(orderExtension); orderExtensionMapper.insert(orderExtension);
// mock 方法PayClient // mock 方法PayClient
PayClient client = mock(PayClient.class); PayClient<?> client = mock(PayClient.class);
when(channelService.getPayClient(eq(10L))).thenReturn(client); when(channelService.getPayClient(eq(10L))).thenReturn(client);
// 调用 // 调用
@ -1012,7 +1012,7 @@ public class PayOrderServiceTest extends BaseDbAndRedisUnitTest {
.setChannelId(10L)); .setChannelId(10L));
orderExtensionMapper.insert(orderExtension); orderExtensionMapper.insert(orderExtension);
// mock 方法PayClient // mock 方法PayClient
PayClient client = mock(PayClient.class); PayClient<?> client = mock(PayClient.class);
when(channelService.getPayClient(eq(10L))).thenReturn(client); when(channelService.getPayClient(eq(10L))).thenReturn(client);
// mock 方法PayClient 退款返回 // mock 方法PayClient 退款返回
PayOrderRespDTO respDTO = randomPojo(PayOrderRespDTO.class, PayOrderRespDTO respDTO = randomPojo(PayOrderRespDTO.class,
@ -1046,7 +1046,7 @@ public class PayOrderServiceTest extends BaseDbAndRedisUnitTest {
.setChannelId(10L)); .setChannelId(10L));
orderExtensionMapper.insert(orderExtension); orderExtensionMapper.insert(orderExtension);
// mock 方法PayClient // mock 方法PayClient
PayClient client = mock(PayClient.class); PayClient<?> client = mock(PayClient.class);
when(channelService.getPayClient(eq(10L))).thenReturn(client); when(channelService.getPayClient(eq(10L))).thenReturn(client);
// mock 方法PayClient 成功返回 // mock 方法PayClient 成功返回
PayOrderRespDTO respDTO = randomPojo(PayOrderRespDTO.class, PayOrderRespDTO respDTO = randomPojo(PayOrderRespDTO.class,
@ -1080,7 +1080,7 @@ public class PayOrderServiceTest extends BaseDbAndRedisUnitTest {
.setChannelId(10L)); .setChannelId(10L));
orderExtensionMapper.insert(orderExtension); orderExtensionMapper.insert(orderExtension);
// mock 方法PayClient // mock 方法PayClient
PayClient client = mock(PayClient.class); PayClient<?> client = mock(PayClient.class);
when(channelService.getPayClient(eq(10L))).thenReturn(client); when(channelService.getPayClient(eq(10L))).thenReturn(client);
// mock 方法PayClient 关闭返回 // mock 方法PayClient 关闭返回
PayOrderRespDTO respDTO = randomPojo(PayOrderRespDTO.class, PayOrderRespDTO respDTO = randomPojo(PayOrderRespDTO.class,

View File

@ -331,7 +331,7 @@ public class PayRefundServiceTest extends BaseDbAndRedisUnitTest {
.setCode(PayChannelEnum.ALIPAY_APP.getCode())); .setCode(PayChannelEnum.ALIPAY_APP.getCode()));
when(channelService.validPayChannel(eq(1L))).thenReturn(channel); when(channelService.validPayChannel(eq(1L))).thenReturn(channel);
// mock 方法client // mock 方法client
PayClient client = mock(PayClient.class); PayClient<?> client = mock(PayClient.class);
when(channelService.getPayClient(eq(10L))).thenReturn(client); when(channelService.getPayClient(eq(10L))).thenReturn(client);
// mock 数据refund 已存在 // mock 数据refund 已存在
PayRefundDO refund = randomPojo(PayRefundDO.class, o -> PayRefundDO refund = randomPojo(PayRefundDO.class, o ->
@ -363,7 +363,7 @@ public class PayRefundServiceTest extends BaseDbAndRedisUnitTest {
.setCode(PayChannelEnum.ALIPAY_APP.getCode())); .setCode(PayChannelEnum.ALIPAY_APP.getCode()));
when(channelService.validPayChannel(eq(10L))).thenReturn(channel); when(channelService.validPayChannel(eq(10L))).thenReturn(channel);
// mock 方法client // mock 方法client
PayClient client = mock(PayClient.class); PayClient<?> client = mock(PayClient.class);
when(channelService.getPayClient(eq(10L))).thenReturn(client); when(channelService.getPayClient(eq(10L))).thenReturn(client);
// mock 方法client 调用发生异常 // mock 方法client 调用发生异常
when(client.unifiedRefund(any(PayRefundUnifiedReqDTO.class))).thenThrow(new RuntimeException()); when(client.unifiedRefund(any(PayRefundUnifiedReqDTO.class))).thenThrow(new RuntimeException());
@ -407,7 +407,7 @@ public class PayRefundServiceTest extends BaseDbAndRedisUnitTest {
.setCode(PayChannelEnum.ALIPAY_APP.getCode())); .setCode(PayChannelEnum.ALIPAY_APP.getCode()));
when(channelService.validPayChannel(eq(10L))).thenReturn(channel); when(channelService.validPayChannel(eq(10L))).thenReturn(channel);
// mock 方法client // mock 方法client
PayClient client = mock(PayClient.class); PayClient<?> client = mock(PayClient.class);
when(channelService.getPayClient(eq(10L))).thenReturn(client); when(channelService.getPayClient(eq(10L))).thenReturn(client);
// mock 方法client 成功 // mock 方法client 成功
PayRefundRespDTO refundRespDTO = randomPojo(PayRefundRespDTO.class); PayRefundRespDTO refundRespDTO = randomPojo(PayRefundRespDTO.class);
@ -664,7 +664,7 @@ public class PayRefundServiceTest extends BaseDbAndRedisUnitTest {
.setOrderNo("P110").setNo("R220")); .setOrderNo("P110").setNo("R220"));
refundMapper.insert(refund); refundMapper.insert(refund);
// mock 方法client // mock 方法client
PayClient client = mock(PayClient.class); PayClient<?> client = mock(PayClient.class);
when(channelService.getPayClient(eq(10L))).thenReturn(client); when(channelService.getPayClient(eq(10L))).thenReturn(client);
// mock 方法client 返回指定状态 // mock 方法client 返回指定状态
PayRefundRespDTO respDTO = randomPojo(PayRefundRespDTO.class, o -> o.setStatus(status)); PayRefundRespDTO respDTO = randomPojo(PayRefundRespDTO.class, o -> o.setStatus(status));
@ -686,7 +686,7 @@ public class PayRefundServiceTest extends BaseDbAndRedisUnitTest {
.setOrderNo("P110").setNo("R220")); .setOrderNo("P110").setNo("R220"));
refundMapper.insert(refund); refundMapper.insert(refund);
// mock 方法client // mock 方法client
PayClient client = mock(PayClient.class); PayClient<?> client = mock(PayClient.class);
when(channelService.getPayClient(eq(10L))).thenReturn(client); when(channelService.getPayClient(eq(10L))).thenReturn(client);
// mock 方法client 抛出异常 // mock 方法client 抛出异常
when(client.getRefund(eq("P110"), eq("R220"))).thenThrow(new RuntimeException()); when(client.getRefund(eq("P110"), eq("R220"))).thenThrow(new RuntimeException());

View File

@ -42,7 +42,7 @@ public class PayClientFactoryImplIntegrationTest {
// 创建客户端 // 创建客户端
Long channelId = RandomUtil.randomLong(); Long channelId = RandomUtil.randomLong();
payClientFactory.createOrUpdatePayClient(channelId, PayChannelEnum.WX_PUB.getCode(), config); payClientFactory.createOrUpdatePayClient(channelId, PayChannelEnum.WX_PUB.getCode(), config);
PayClient client = payClientFactory.getPayClient(channelId); PayClient<?> client = payClientFactory.getPayClient(channelId);
// 发起支付 // 发起支付
PayOrderUnifiedReqDTO reqDTO = buildPayOrderUnifiedReqDTO(); PayOrderUnifiedReqDTO reqDTO = buildPayOrderUnifiedReqDTO();
// CommonResult<?> result = client.unifiedOrder(reqDTO); // CommonResult<?> result = client.unifiedOrder(reqDTO);
@ -65,7 +65,7 @@ public class PayClientFactoryImplIntegrationTest {
// 创建客户端 // 创建客户端
Long channelId = RandomUtil.randomLong(); Long channelId = RandomUtil.randomLong();
payClientFactory.createOrUpdatePayClient(channelId, PayChannelEnum.WX_PUB.getCode(), config); payClientFactory.createOrUpdatePayClient(channelId, PayChannelEnum.WX_PUB.getCode(), config);
PayClient client = payClientFactory.getPayClient(channelId); PayClient<?> client = payClientFactory.getPayClient(channelId);
// 发起支付 // 发起支付
PayOrderUnifiedReqDTO reqDTO = buildPayOrderUnifiedReqDTO(); PayOrderUnifiedReqDTO reqDTO = buildPayOrderUnifiedReqDTO();
// CommonResult<?> result = client.unifiedOrder(reqDTO); // CommonResult<?> result = client.unifiedOrder(reqDTO);
@ -88,7 +88,7 @@ public class PayClientFactoryImplIntegrationTest {
// 创建客户端 // 创建客户端
Long channelId = RandomUtil.randomLong(); Long channelId = RandomUtil.randomLong();
payClientFactory.createOrUpdatePayClient(channelId, PayChannelEnum.ALIPAY_QR.getCode(), config); payClientFactory.createOrUpdatePayClient(channelId, PayChannelEnum.ALIPAY_QR.getCode(), config);
PayClient client = payClientFactory.getPayClient(channelId); PayClient<?> client = payClientFactory.getPayClient(channelId);
// 发起支付 // 发起支付
PayOrderUnifiedReqDTO reqDTO = buildPayOrderUnifiedReqDTO(); PayOrderUnifiedReqDTO reqDTO = buildPayOrderUnifiedReqDTO();
reqDTO.setNotifyUrl("http://yunai.natapp1.cc/admin-api/pay/notify/callback/18"); // TODO @tina: 这里改成你的 natapp 回调地址 reqDTO.setNotifyUrl("http://yunai.natapp1.cc/admin-api/pay/notify/callback/18"); // TODO @tina: 这里改成你的 natapp 回调地址
@ -112,7 +112,7 @@ public class PayClientFactoryImplIntegrationTest {
// 创建客户端 // 创建客户端
Long channelId = RandomUtil.randomLong(); Long channelId = RandomUtil.randomLong();
payClientFactory.createOrUpdatePayClient(channelId, PayChannelEnum.ALIPAY_WAP.getCode(), config); payClientFactory.createOrUpdatePayClient(channelId, PayChannelEnum.ALIPAY_WAP.getCode(), config);
PayClient client = payClientFactory.getPayClient(channelId); PayClient<?> client = payClientFactory.getPayClient(channelId);
// 发起支付 // 发起支付
PayOrderUnifiedReqDTO reqDTO = buildPayOrderUnifiedReqDTO(); PayOrderUnifiedReqDTO reqDTO = buildPayOrderUnifiedReqDTO();
// CommonResult<?> result = client.unifiedOrder(reqDTO); // CommonResult<?> result = client.unifiedOrder(reqDTO);