解决冲突

This commit is contained in:
xiafang
2023-01-03 16:06:06 +08:00
parent 9d2f8a7d72
commit de3cf3d2ae
2 changed files with 23 additions and 24 deletions

View File

@@ -1,6 +1,6 @@
[![Maven Central Repo Deployment](https://github.com/NotFound403/payment-spring-boot/actions/workflows/main.yml/badge.svg)](https://github.com/NotFound403/payment-spring-boot/actions/workflows/main.yml) [![Maven Central Repo Deployment](https://github.com/NotFound403/payment-spring-boot/actions/workflows/main.yml/badge.svg)](https://github.com/NotFound403/payment-spring-boot/actions/workflows/main.yml)
# 最好用的微信支付V3 Spring Boot 组件 # 最好用的微信支付V3 Spring Boot 组件
为了满足业务中出现app支付、公众号支付、小程序支付等多appid并存的场景对原有的进行了增强开发出了多租户版本。 为了满足业务中出现app支付、公众号支付、小程序支付等多appid并存的场景对原有的进行了增强开发出了多租户版本。
@@ -24,6 +24,7 @@
- [payment-spring-boot GitHub文档](https://notfound403.github.io/payment-spring-boot) - [payment-spring-boot GitHub文档](https://notfound403.github.io/payment-spring-boot)
- [payment-spring-boot Gitee文档](https://felord.gitee.io/payment-spring-boot) - [payment-spring-boot Gitee文档](https://felord.gitee.io/payment-spring-boot)
## 目前已经实现所有服务商和直连商户接口 ## 目前已经实现所有服务商和直连商户接口
- 实现微信支付多商户 - 实现微信支付多商户
@@ -56,11 +57,11 @@
- `WechatPayTransfersApi` 微信支付V2企业付款到零钱目前不包括到银行卡 - `WechatPayTransfersApi` 微信支付V2企业付款到零钱目前不包括到银行卡
- `WechatDirectPayApi` 微信支付直连模式V3普通支付 - `WechatDirectPayApi` 微信支付直连模式V3普通支付
- `WechatPayScoreParkingApi` 微信支付分V3停车服务 - `WechatPayScoreParkingApi` 微信支付分V3停车服务
- `WechatBatchTransferApi` 微信支付V3批量转账到零钱 - `WechatBatchTransferApi` 微信支付V3批量转账到零钱
- `WechatPartnerSpecialMchApi` 微信支付V3服务商商户进件 - `WechatPartnerSpecialMchApi` 微信支付V3服务商商户进件
- `WechatMediaApi` 微信支付V3媒体上传 - `WechatMediaApi` 微信支付V3媒体上传
- `WechatEcommerceApi` 电商收付通 - `WechatEcommerceApi` 电商收付通
- `WechatSmartGuideApi` 服务商或者直连商户-经营能力-支付即服务 - `WechatSmartGuideApi` 服务商或者直连商户-经营能力-支付即服务
- `WechatGoldPlanApi` 服务商-经营能力-点金计划 - `WechatGoldPlanApi` 服务商-经营能力-点金计划
> 随着版本迭代功能会增加。 > 随着版本迭代功能会增加。
@@ -71,7 +72,7 @@
## 仓库地址 ## 仓库地址
- [GitHub](https://github.com/NotFound403/payment-spring-boot) - [GitHub](https://github.com/NotFound403/payment-spring-boot)
- [Gitee](https://gitee.com/felord/payment-spring-boot) - [Gitee](https://gitee.com/felord/payment-spring-boot)
## QQ交流群 ## QQ交流群
为了交流解惑新建QQ群可通过扫码进入。 为了交流解惑新建QQ群可通过扫码进入。

View File

@@ -82,7 +82,7 @@ public class WechatBatchTransferApi extends AbstractApi {
List<CreateBatchTransferParams.TransferDetailListItem> encrypted = transferDetailList.stream() List<CreateBatchTransferParams.TransferDetailListItem> encrypted = transferDetailList.stream()
.peek(transferDetailListItem -> { .peek(transferDetailListItem -> {
String userName = transferDetailListItem.getUserName(); String userName = transferDetailListItem.getUserName();
if (StringUtils.hasText(userName)){ if (StringUtils.hasText(userName)) {
String encryptedUserName = signatureProvider.encryptRequestMessage(userName, x509Certificate); String encryptedUserName = signatureProvider.encryptRequestMessage(userName, x509Certificate);
transferDetailListItem.setUserName(encryptedUserName); transferDetailListItem.setUserName(encryptedUserName);
} }
@@ -112,7 +112,20 @@ public class WechatBatchTransferApi extends AbstractApi {
public WechatResponseEntity<ObjectNode> queryBatchByBatchId(QueryBatchTransferParams queryBatchTransferParams) { public WechatResponseEntity<ObjectNode> queryBatchByBatchId(QueryBatchTransferParams queryBatchTransferParams) {
WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>(); WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>();
this.client().withType(WechatPayV3Type.BATCH_TRANSFER_BATCH_ID, queryBatchTransferParams) this.client().withType(WechatPayV3Type.BATCH_TRANSFER_BATCH_ID, queryBatchTransferParams)
.function(this::apply) .function((type, params) -> {
MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<>();
queryParams.add("need_query_detail", params.getNeedQueryDetail().toString());
queryParams.add("offset", params.getOffset().toString());
queryParams.add("limit", params.getLimit().toString());
queryParams.add("detail_status", params.getDetailStatus().name());
URI uri = UriComponentsBuilder.fromHttpUrl(type.uri(WeChatServer.CHINA))
.queryParams(queryParams)
.build()
.expand(params.getCode())
.toUri();
return Get(uri);
})
.consumer(wechatResponseEntity::convert) .consumer(wechatResponseEntity::convert)
.request(); .request();
return wechatResponseEntity; return wechatResponseEntity;
@@ -391,19 +404,4 @@ public class WechatBatchTransferApi extends AbstractApi {
.request(); .request();
return wechatResponseEntity; return wechatResponseEntity;
} }
private RequestEntity<?> apply(WechatPayV3Type type, QueryBatchTransferParams params) {
MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<>();
queryParams.add("need_query_detail", params.getNeedQueryDetail().toString());
queryParams.add("offset", params.getOffset().toString());
queryParams.add("limit", params.getLimit().toString());
queryParams.add("detail_status", params.getDetailStatus().name());
URI uri = UriComponentsBuilder.fromHttpUrl(type.uri(WeChatServer.CHINA))
.queryParams(queryParams)
.build()
.expand(params.getCode())
.toUri();
return Get(uri);
}
} }