mirror of
https://github.com/dromara/payment-spring-boot.git
synced 2026-03-13 21:33:41 +08:00
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* Website:
|
||||
* https://felord.cn
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.felord.payment.wechat.enumeration;
|
||||
|
||||
/**
|
||||
* The enum Business cert type.
|
||||
*
|
||||
* @author dax
|
||||
* @since 2023 /7/1 8:34
|
||||
*/
|
||||
public enum BusinessCertType {
|
||||
/**
|
||||
* 事业单位法人证书
|
||||
*/
|
||||
CERTIFICATE_TYPE_2388,
|
||||
|
||||
/**
|
||||
* 统一社会信用代码证书
|
||||
*/
|
||||
CERTIFICATE_TYPE_2389,
|
||||
|
||||
/**
|
||||
* 社会团体法人登记证书
|
||||
*/
|
||||
CERTIFICATE_TYPE_2394,
|
||||
/**
|
||||
* 民办非企业单位登记证书
|
||||
*/
|
||||
CERTIFICATE_TYPE_2395,
|
||||
|
||||
/**
|
||||
* 基金会法人登记证书
|
||||
*/
|
||||
CERTIFICATE_TYPE_2396,
|
||||
/**
|
||||
* 宗教活动场所登记证
|
||||
*/
|
||||
CERTIFICATE_TYPE_2399,
|
||||
|
||||
/**
|
||||
* 政府部门下发的其他有效证明文件
|
||||
*/
|
||||
CERTIFICATE_TYPE_2400,
|
||||
/**
|
||||
* 执业许可证/执业证
|
||||
*/
|
||||
CERTIFICATE_TYPE_2520,
|
||||
/**
|
||||
* 基层群众性自治组织特别法人统一社会信用代码证
|
||||
*/
|
||||
CERTIFICATE_TYPE_2521,
|
||||
/**
|
||||
* 农村集体经济组织登记证
|
||||
*/
|
||||
CERTIFICATE_TYPE_2522
|
||||
}
|
||||
@@ -19,26 +19,18 @@ package cn.felord.payment.wechat.v3.ecommerce;
|
||||
|
||||
import cn.felord.payment.wechat.enumeration.WeChatServer;
|
||||
import cn.felord.payment.wechat.enumeration.WechatPayV3Type;
|
||||
import cn.felord.payment.wechat.v3.AbstractApi;
|
||||
import cn.felord.payment.wechat.v3.SignatureProvider;
|
||||
import cn.felord.payment.wechat.v3.WechatPartnerSpecialMchApi;
|
||||
import cn.felord.payment.wechat.v3.WechatPayClient;
|
||||
import cn.felord.payment.wechat.v3.WechatResponseEntity;
|
||||
import cn.felord.payment.wechat.v3.X509WechatCertificateInfo;
|
||||
import cn.felord.payment.wechat.v3.model.ecommerce.EcommerceAccountInfo;
|
||||
import cn.felord.payment.wechat.v3.model.ecommerce.EcommerceApplymentParams;
|
||||
import cn.felord.payment.wechat.v3.model.ecommerce.EcommerceContactInfo;
|
||||
import cn.felord.payment.wechat.v3.model.ecommerce.EcommerceIdCardInfo;
|
||||
import cn.felord.payment.wechat.v3.model.ecommerce.EcommerceIdDocInfo;
|
||||
import cn.felord.payment.wechat.v3.model.ecommerce.UboInfo;
|
||||
import cn.felord.payment.wechat.v3.*;
|
||||
import cn.felord.payment.wechat.v3.model.ecommerce.*;
|
||||
import cn.felord.payment.wechat.v3.model.specmch.SubMchModifyParams;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.util.UriComponentsBuilder;
|
||||
|
||||
import java.net.URI;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 电商收付通-商户进件
|
||||
@@ -157,18 +149,13 @@ public class ApplymentApi extends AbstractApi {
|
||||
idDocInfo.setIdDocAddress(signatureProvider.encryptRequestMessage(idDocAddress, x509Certificate));
|
||||
}
|
||||
}
|
||||
UboInfo uboInfo = applymentParams.getUboInfo();
|
||||
if (uboInfo != null) {
|
||||
UboInfo.IdCardInfo cardInfo = uboInfo.getIdCardInfo();
|
||||
if (cardInfo != null) {
|
||||
cardInfo.setIdCardName(signatureProvider.encryptRequestMessage(cardInfo.getIdCardName(), x509Certificate));
|
||||
cardInfo.setIdCardNumber(signatureProvider.encryptRequestMessage(cardInfo.getIdCardNumber(), x509Certificate));
|
||||
}
|
||||
UboInfo.IdDocInfo docInfo = uboInfo.getIdDocInfo();
|
||||
if (docInfo != null) {
|
||||
docInfo.setIdDocName(signatureProvider.encryptRequestMessage(docInfo.getIdDocName(), x509Certificate));
|
||||
docInfo.setIdDocNumber(signatureProvider.encryptRequestMessage(docInfo.getIdDocNumber(), x509Certificate));
|
||||
}
|
||||
List<UboInfoListItem> uboInfoList = applymentParams.getUboInfoList();
|
||||
if (!CollectionUtils.isEmpty(uboInfoList)) {
|
||||
uboInfoList.forEach(uboInfoListItem -> {
|
||||
uboInfoListItem.setUboIdDocName(signatureProvider.encryptRequestMessage(uboInfoListItem.getUboIdDocName(), x509Certificate));
|
||||
uboInfoListItem.setUboIdDocNumber(signatureProvider.encryptRequestMessage(uboInfoListItem.getUboIdDocNumber(), x509Certificate));
|
||||
uboInfoListItem.setUboIdDocAddress(signatureProvider.encryptRequestMessage(uboInfoListItem.getUboIdDocAddress(), x509Certificate));
|
||||
});
|
||||
}
|
||||
EcommerceAccountInfo accountInfo = applymentParams.getAccountInfo();
|
||||
if (accountInfo != null) {
|
||||
@@ -178,6 +165,7 @@ public class ApplymentApi extends AbstractApi {
|
||||
EcommerceContactInfo contactInfo = applymentParams.getContactInfo();
|
||||
contactInfo.setContactName(signatureProvider.encryptRequestMessage(contactInfo.getContactName(), x509Certificate));
|
||||
contactInfo.setContactIdCardNumber(signatureProvider.encryptRequestMessage(contactInfo.getContactIdCardNumber(), x509Certificate));
|
||||
contactInfo.setMobilePhone(signatureProvider.encryptRequestMessage(contactInfo.getMobilePhone(), x509Certificate));
|
||||
String contactEmail = contactInfo.getContactEmail();
|
||||
if (contactEmail != null) {
|
||||
contactInfo.setContactEmail(signatureProvider.encryptRequestMessage(contactEmail, x509Certificate));
|
||||
|
||||
@@ -42,8 +42,6 @@ public class EcommerceApplymentParams{
|
||||
private EcommerceIdCardInfo idCardInfo;
|
||||
private EcommerceIdDocInfo idDocInfo;
|
||||
private Boolean owner;
|
||||
private UboInfo uboInfo;
|
||||
private Boolean needAccountInfo;
|
||||
private List<UboInfoListItem> uboInfoList;
|
||||
private EcommerceAccountInfo accountInfo;
|
||||
private EcommerceContactInfo contactInfo;
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
package cn.felord.payment.wechat.v3.model.ecommerce;
|
||||
|
||||
import cn.felord.payment.wechat.enumeration.BusinessCertType;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@@ -25,6 +26,7 @@ import lombok.Data;
|
||||
*/
|
||||
@Data
|
||||
public class EcommerceBusinessLicenseInfo {
|
||||
private BusinessCertType certType;
|
||||
private String businessLicenseCopy;
|
||||
private String businessLicenseNumber;
|
||||
private String merchantName;
|
||||
|
||||
@@ -19,11 +19,18 @@ package cn.felord.payment.wechat.v3.model.ecommerce;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Data
|
||||
public class EcommerceContactInfo {
|
||||
private String contactType;
|
||||
private String contactName;
|
||||
private String contactIdCardNumber;
|
||||
private String contactIdDocCopy;
|
||||
private String contactIdDocCopyBack;
|
||||
private LocalDate contactIdDocPeriodBegin;
|
||||
private String contactIdDocPeriodEnd;
|
||||
private String businessAuthorizationLetter;
|
||||
private String mobilePhone;
|
||||
private String contactEmail;
|
||||
}
|
||||
@@ -31,5 +31,5 @@ public class UboInfoListItem {
|
||||
private String uboIdDocNumber;
|
||||
private String uboIdDocAddress;
|
||||
private LocalDate uboIdDocPeriodBegin;
|
||||
private LocalDate uboIdDocPeriodEnd;
|
||||
private String uboIdDocPeriodEnd;
|
||||
}
|
||||
Reference in New Issue
Block a user