Skip to content

Commit c34ac4d

Browse files
authored
🆕 #4044 【微信支付】新增商家转账用户授权免确认相关接口
1 parent 8c29b1a commit c34ac4d

4 files changed

Lines changed: 458 additions & 1 deletion

File tree

weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsRequest.java

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,24 @@ public class TransferBillsRequest implements Serializable {
8787
@SerializedName("transfer_scene_report_infos")
8888
private List<TransferSceneReportInfo> transferSceneReportInfos;
8989

90+
/**
91+
* 自动收款授权信息
92+
*/
93+
@SerializedName("authorization_info")
94+
private AuthorizationInfo authorizationInfo;
95+
96+
/**
97+
* 微信免确认收款授权单号
98+
*/
99+
@SerializedName("authorization_id")
100+
private String authorizationId;
101+
102+
/**
103+
* 商户侧授权单号
104+
*/
105+
@SerializedName("out_authorization_no")
106+
private String outAuthorizationNo;
107+
90108
/**
91109
* 收款授权模式
92110
* <pre>
@@ -125,4 +143,28 @@ public static class TransferSceneReportInfo {
125143
@SerializedName("info_content")
126144
private String infoContent;
127145
}
146+
147+
@Data
148+
@Builder(builderMethodName = "newBuilder")
149+
@AllArgsConstructor
150+
@NoArgsConstructor
151+
public static class AuthorizationInfo {
152+
/**
153+
* 用户展示名称
154+
*/
155+
@SerializedName("user_display_name")
156+
private String userDisplayName;
157+
158+
/**
159+
* 商户侧授权单号
160+
*/
161+
@SerializedName("out_authorization_no")
162+
private String outAuthorizationNo;
163+
164+
/**
165+
* 自动收款授权结果通知地址
166+
*/
167+
@SerializedName("authorization_notify_url")
168+
private String authorizationNotifyUrl;
169+
}
128170
}

weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/TransferServiceImpl.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,12 @@ public ReservationTransferBatchResult reservationTransferBatch(ReservationTransf
239239
String url = String.format("%s/v3/fund-app/mch-transfer/reservation/transfer-batches", this.payService.getPayBaseUrl());
240240
List<ReservationTransferBatchRequest.TransferDetail> transferDetailList = request.getTransferDetailList();
241241
if (transferDetailList != null && !transferDetailList.isEmpty()) {
242-
X509Certificate validCertificate = this.payService.getConfig().getVerifier().getValidCertificate();
242+
X509Certificate validCertificate = null;
243243
for (ReservationTransferBatchRequest.TransferDetail detail : transferDetailList) {
244244
if (detail.getUserName() != null && !detail.getUserName().isEmpty()) {
245+
if (validCertificate == null) {
246+
validCertificate = this.payService.getConfig().getVerifier().getValidCertificate();
247+
}
245248
RsaCryptoUtil.encryptFields(detail, validCertificate);
246249
}
247250
}

0 commit comments

Comments
 (0)