mirror of
https://github.com/dromara/payment-spring-boot.git
synced 2026-03-14 22:03:41 +08:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2bd091e268 | ||
|
|
1ba456f5dd |
@@ -45,7 +45,7 @@ Starter,支持微信优惠券,代金券、商家券、智慧商圈、商家
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.felord</groupId>
|
<groupId>cn.felord</groupId>
|
||||||
<artifactId>payment-spring-boot-starter</artifactId>
|
<artifactId>payment-spring-boot-starter</artifactId>
|
||||||
<version>1.0.20.RELEASE</version>
|
<version>1.0.19.RELEASE</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.felord</groupId>
|
<groupId>cn.felord</groupId>
|
||||||
<artifactId>payment-spring-boot-starter</artifactId>
|
<artifactId>payment-spring-boot-starter</artifactId>
|
||||||
<version>1.0.20.RELEASE</version>
|
<version>1.0.19.RELEASE</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
## 采用技术
|
## 采用技术
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.felord</groupId>
|
<groupId>cn.felord</groupId>
|
||||||
<artifactId>payment-spring-boot-starter</artifactId>
|
<artifactId>payment-spring-boot-starter</artifactId>
|
||||||
<version>1.0.20.RELEASE</version>
|
<version>1.0.19.RELEASE</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
> 基于 **Spring Boot 2.x**
|
> 基于 **Spring Boot 2.x**
|
||||||
|
|||||||
@@ -22,11 +22,11 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>cn.felord</groupId>
|
<groupId>cn.felord</groupId>
|
||||||
<artifactId>payment-spring-boot</artifactId>
|
<artifactId>payment-spring-boot</artifactId>
|
||||||
<version>1.0.20.RELEASE</version>
|
<version>1.0.19.RELEASE</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>payment-spring-boot-autoconfigure</artifactId>
|
<artifactId>payment-spring-boot-autoconfigure</artifactId>
|
||||||
<version>1.0.20.RELEASE</version>
|
<version>1.0.19.RELEASE</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
@@ -64,6 +64,42 @@
|
|||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.squareup.retrofit2</groupId>
|
||||||
|
<artifactId>retrofit</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.squareup.retrofit2</groupId>
|
||||||
|
<artifactId>adapter-rxjava3</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.squareup.retrofit2</groupId>
|
||||||
|
<artifactId>converter-jaxb</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.squareup.retrofit2</groupId>
|
||||||
|
<artifactId>converter-jackson</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
|
<artifactId>jackson-databind</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||||
|
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.squareup.okhttp3</groupId>
|
||||||
|
<artifactId>okhttp</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.squareup.okhttp3</groupId>
|
||||||
|
<artifactId>logging-interceptor</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bouncycastle</groupId>
|
<groupId>org.bouncycastle</groupId>
|
||||||
<artifactId>bcprov-jdk15to18</artifactId>
|
<artifactId>bcprov-jdk15to18</artifactId>
|
||||||
|
|||||||
@@ -1,71 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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
|
|
||||||
}
|
|
||||||
@@ -73,7 +73,7 @@ import java.util.stream.Collectors;
|
|||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
public abstract class BaseModel {
|
public abstract class BaseModel {
|
||||||
public static final String HMAC_SHA256="HMAC-SHA256";
|
public static final String HMAC_SHA256 = "HMAC-SHA256";
|
||||||
private static final XmlMapper XML_MAPPER = new XmlMapper();
|
private static final XmlMapper XML_MAPPER = new XmlMapper();
|
||||||
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
|
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
|
||||||
|
|
||||||
@@ -84,8 +84,7 @@ public abstract class BaseModel {
|
|||||||
.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE);
|
.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE);
|
||||||
OBJECT_MAPPER
|
OBJECT_MAPPER
|
||||||
// .configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, true)
|
// .configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, true)
|
||||||
.setSerializationInclusion(JsonInclude.Include.NON_NULL)
|
.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
||||||
.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -165,7 +164,7 @@ public abstract class BaseModel {
|
|||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
private String hmacSha256(String src) {
|
private String hmacSha256(String src) {
|
||||||
String algorithm = "HmacSHA256";
|
String algorithm = "HmacSHA256";
|
||||||
Mac sha256HMAC = Mac.getInstance(algorithm,"BC");
|
Mac sha256HMAC = Mac.getInstance(algorithm, "BC");
|
||||||
SecretKeySpec secretKeySpec = new SecretKeySpec(appSecret.getBytes(), algorithm);
|
SecretKeySpec secretKeySpec = new SecretKeySpec(appSecret.getBytes(), algorithm);
|
||||||
sha256HMAC.init(secretKeySpec);
|
sha256HMAC.init(secretKeySpec);
|
||||||
byte[] bytes = sha256HMAC.doFinal(src.getBytes(StandardCharsets.UTF_8));
|
byte[] bytes = sha256HMAC.doFinal(src.getBytes(StandardCharsets.UTF_8));
|
||||||
|
|||||||
@@ -31,9 +31,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|||||||
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
|
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
|
||||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
|
|
||||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
|
||||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer;
|
|
||||||
import org.springframework.core.io.Resource;
|
import org.springframework.core.io.Resource;
|
||||||
import org.springframework.http.ContentDisposition;
|
import org.springframework.http.ContentDisposition;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
@@ -47,8 +44,6 @@ import org.springframework.web.util.UriComponentsBuilder;
|
|||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.LocalTime;
|
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@@ -97,16 +92,12 @@ public abstract class AbstractApi {
|
|||||||
* @param mapper the mapper
|
* @param mapper the mapper
|
||||||
*/
|
*/
|
||||||
private void applyObjectMapper(ObjectMapper mapper) {
|
private void applyObjectMapper(ObjectMapper mapper) {
|
||||||
JavaTimeModule javaTimeModule = new JavaTimeModule();
|
|
||||||
javaTimeModule.addSerializer(LocalDate.class, new LocalDateSerializer(DateTimeFormatter.ISO_LOCAL_DATE));
|
|
||||||
javaTimeModule.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ISO_LOCAL_DATE_TIME));
|
|
||||||
javaTimeModule.addSerializer(LocalTime.class, new LocalTimeSerializer(DateTimeFormatter.ISO_LOCAL_TIME));
|
|
||||||
mapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE)
|
mapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE)
|
||||||
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
|
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
|
||||||
// empty string error
|
// empty string error
|
||||||
.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, true)
|
.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, true)
|
||||||
.setSerializationInclusion(JsonInclude.Include.NON_NULL)
|
.setSerializationInclusion(JsonInclude.Include.NON_NULL)
|
||||||
.registerModule(javaTimeModule);
|
.registerModule(new JavaTimeModule());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -190,8 +190,8 @@ public class SignatureProvider {
|
|||||||
signer.initVerify(certificate.getX509Certificate());
|
signer.initVerify(certificate.getX509Certificate());
|
||||||
signer.update(signatureStr.getBytes(StandardCharsets.UTF_8));
|
signer.update(signatureStr.getBytes(StandardCharsets.UTF_8));
|
||||||
return signer.verify(Base64Utils.decodeFromString(params.getWechatpaySignature()));
|
return signer.verify(Base64Utils.decodeFromString(params.getWechatpaySignature()));
|
||||||
} catch (Exception e) {
|
}catch (Exception e){
|
||||||
throw new PayException("An exception occurred during the response verification, the cause: " + e.getMessage());
|
throw new PayException("An exception occurred during the response verification, the cause: "+e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -230,9 +230,12 @@ public class SignatureProvider {
|
|||||||
throw new PayException("cant obtain the response body");
|
throw new PayException("cant obtain the response body");
|
||||||
}
|
}
|
||||||
ArrayNode certificates = bodyObjectNode.withArray("data");
|
ArrayNode certificates = bodyObjectNode.withArray("data");
|
||||||
if (certificates.isArray() && !certificates.isEmpty()) {
|
if (certificates.isArray() && certificates.size() > 0) {
|
||||||
CERTIFICATE_SET.removeIf(x509WechatCertificateInfo ->
|
CERTIFICATE_SET.forEach(x509WechatCertificateInfo -> {
|
||||||
Objects.equals(tenantId, x509WechatCertificateInfo.getTenantId()));
|
if (Objects.equals(tenantId, x509WechatCertificateInfo.getTenantId())) {
|
||||||
|
CERTIFICATE_SET.remove(x509WechatCertificateInfo);
|
||||||
|
}
|
||||||
|
});
|
||||||
final CertificateFactory certificateFactory = CertificateFactory.getInstance("X509", BC_PROVIDER);
|
final CertificateFactory certificateFactory = CertificateFactory.getInstance("X509", BC_PROVIDER);
|
||||||
certificates.forEach(objectNode -> {
|
certificates.forEach(objectNode -> {
|
||||||
JsonNode encryptCertificate = objectNode.get("encrypt_certificate");
|
JsonNode encryptCertificate = objectNode.get("encrypt_certificate");
|
||||||
|
|||||||
@@ -158,9 +158,7 @@ public class WechatMarketingFavorApi extends AbstractApi {
|
|||||||
WechatPayProperties.V3 v3 = this.wechatMetaBean().getV3();
|
WechatPayProperties.V3 v3 = this.wechatMetaBean().getV3();
|
||||||
|
|
||||||
params.setAppid(v3.getAppId());
|
params.setAppid(v3.getAppId());
|
||||||
if (StringUtils.hasText(params.getStockCreatorMchid())){
|
|
||||||
params.setStockCreatorMchid(v3.getMchId());
|
params.setStockCreatorMchid(v3.getMchId());
|
||||||
}
|
|
||||||
URI uri = UriComponentsBuilder.fromHttpUrl(type.uri(WeChatServer.CHINA))
|
URI uri = UriComponentsBuilder.fromHttpUrl(type.uri(WeChatServer.CHINA))
|
||||||
.build()
|
.build()
|
||||||
.expand(params.getOpenid())
|
.expand(params.getOpenid())
|
||||||
|
|||||||
@@ -76,7 +76,6 @@ public class WechatPayScoreParkingApi extends AbstractApi {
|
|||||||
|
|
||||||
URI uri = UriComponentsBuilder.fromHttpUrl(wechatPayV3Type.uri(WeChatServer.CHINA))
|
URI uri = UriComponentsBuilder.fromHttpUrl(wechatPayV3Type.uri(WeChatServer.CHINA))
|
||||||
.queryParams(queryParams)
|
.queryParams(queryParams)
|
||||||
.encode()
|
|
||||||
.build()
|
.build()
|
||||||
.toUri();
|
.toUri();
|
||||||
return Get(uri);
|
return Get(uri);
|
||||||
|
|||||||
@@ -0,0 +1,122 @@
|
|||||||
|
/*
|
||||||
|
* 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.v3.client;
|
||||||
|
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
|
||||||
|
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||||
|
import okhttp3.ConnectionPool;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import okhttp3.logging.HttpLoggingInterceptor;
|
||||||
|
import retrofit2.Retrofit;
|
||||||
|
import retrofit2.adapter.rxjava3.RxJava3CallAdapterFactory;
|
||||||
|
import retrofit2.converter.jackson.JacksonConverterFactory;
|
||||||
|
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The type Retrofit factory.
|
||||||
|
*
|
||||||
|
* @author dax
|
||||||
|
* @since 2023 /5/21
|
||||||
|
*/
|
||||||
|
public final class RetrofitFactory {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The constant JACKSON_CONVERTER_FACTORY.
|
||||||
|
*/
|
||||||
|
public static final JacksonConverterFactory JACKSON_CONVERTER_FACTORY = JacksonConverterFactoryBuilder.build();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create retrofit.
|
||||||
|
*
|
||||||
|
* @param baseUrl the base url
|
||||||
|
* @return the retrofit
|
||||||
|
*/
|
||||||
|
public static Retrofit create(String baseUrl) {
|
||||||
|
return create(baseUrl, new ConnectionPool());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create retrofit.
|
||||||
|
*
|
||||||
|
* @param baseUrl the base url
|
||||||
|
* @param connectionPool the connection pool
|
||||||
|
* @return the retrofit
|
||||||
|
*/
|
||||||
|
public static Retrofit create(String baseUrl, ConnectionPool connectionPool) {
|
||||||
|
return create(baseUrl, connectionPool, HttpLoggingInterceptor.Level.NONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create retrofit.
|
||||||
|
*
|
||||||
|
* @param baseUrl the base url
|
||||||
|
* @param connectionPool the connection pool
|
||||||
|
* @param level the level
|
||||||
|
* @return the retrofit
|
||||||
|
*/
|
||||||
|
public static Retrofit create(String baseUrl, ConnectionPool connectionPool, HttpLoggingInterceptor.Level level) {
|
||||||
|
return new Retrofit.Builder()
|
||||||
|
.baseUrl(baseUrl)
|
||||||
|
.client(okHttpClient(connectionPool, level))
|
||||||
|
.addCallAdapterFactory(RxJava3CallAdapterFactory.create())
|
||||||
|
.addConverterFactory(JACKSON_CONVERTER_FACTORY)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static OkHttpClient okHttpClient(ConnectionPool connectionPool, HttpLoggingInterceptor.Level level) {
|
||||||
|
HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor();
|
||||||
|
httpLoggingInterceptor.level(level);
|
||||||
|
return new OkHttpClient.Builder()
|
||||||
|
.connectionPool(connectionPool)
|
||||||
|
.addInterceptor(httpLoggingInterceptor)
|
||||||
|
.retryOnConnectionFailure(true)
|
||||||
|
.connectTimeout(30, TimeUnit.SECONDS)
|
||||||
|
.readTimeout(30, TimeUnit.SECONDS)
|
||||||
|
.writeTimeout(30, TimeUnit.SECONDS)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The type Jackson converter factory builder.
|
||||||
|
*/
|
||||||
|
static final class JacksonConverterFactoryBuilder {
|
||||||
|
private JacksonConverterFactoryBuilder() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build jackson converter factory.
|
||||||
|
*
|
||||||
|
* @return the jackson converter factory
|
||||||
|
*/
|
||||||
|
public static JacksonConverterFactory build() {
|
||||||
|
ObjectMapper objectMapper = new ObjectMapper().setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE)
|
||||||
|
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
|
||||||
|
// empty string error
|
||||||
|
.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, true)
|
||||||
|
.setSerializationInclusion(JsonInclude.Include.NON_NULL)
|
||||||
|
.registerModule(new JavaTimeModule());
|
||||||
|
return JacksonConverterFactory.create(objectMapper);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -178,7 +178,6 @@ public class ApplymentApi extends AbstractApi {
|
|||||||
EcommerceContactInfo contactInfo = applymentParams.getContactInfo();
|
EcommerceContactInfo contactInfo = applymentParams.getContactInfo();
|
||||||
contactInfo.setContactName(signatureProvider.encryptRequestMessage(contactInfo.getContactName(), x509Certificate));
|
contactInfo.setContactName(signatureProvider.encryptRequestMessage(contactInfo.getContactName(), x509Certificate));
|
||||||
contactInfo.setContactIdCardNumber(signatureProvider.encryptRequestMessage(contactInfo.getContactIdCardNumber(), x509Certificate));
|
contactInfo.setContactIdCardNumber(signatureProvider.encryptRequestMessage(contactInfo.getContactIdCardNumber(), x509Certificate));
|
||||||
contactInfo.setMobilePhone(signatureProvider.encryptRequestMessage(contactInfo.getMobilePhone(), x509Certificate));
|
|
||||||
String contactEmail = contactInfo.getContactEmail();
|
String contactEmail = contactInfo.getContactEmail();
|
||||||
if (contactEmail != null) {
|
if (contactEmail != null) {
|
||||||
contactInfo.setContactEmail(signatureProvider.encryptRequestMessage(contactEmail, x509Certificate));
|
contactInfo.setContactEmail(signatureProvider.encryptRequestMessage(contactEmail, x509Certificate));
|
||||||
|
|||||||
@@ -61,11 +61,6 @@ public class CreateBatchTransferParams {
|
|||||||
* 指定该笔转账使用的转账场景ID
|
* 指定该笔转账使用的转账场景ID
|
||||||
*/
|
*/
|
||||||
private String transferSceneId;
|
private String transferSceneId;
|
||||||
/**
|
|
||||||
* 回调通知
|
|
||||||
* @since 1.0.20
|
|
||||||
*/
|
|
||||||
private String notifyUrl;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 转账明细.
|
* 转账明细.
|
||||||
|
|||||||
@@ -20,6 +20,9 @@ import cn.felord.payment.wechat.enumeration.ContactType;
|
|||||||
import cn.felord.payment.wechat.enumeration.IdDocType;
|
import cn.felord.payment.wechat.enumeration.IdDocType;
|
||||||
import cn.felord.payment.wechat.v3.model.specmch.FinanceInstitutionInfo;
|
import cn.felord.payment.wechat.v3.model.specmch.FinanceInstitutionInfo;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 二级商户进件申请API请求参数
|
* 二级商户进件申请API请求参数
|
||||||
*
|
*
|
||||||
@@ -41,6 +44,7 @@ public class EcommerceApplymentParams{
|
|||||||
private Boolean owner;
|
private Boolean owner;
|
||||||
private UboInfo uboInfo;
|
private UboInfo uboInfo;
|
||||||
private Boolean needAccountInfo;
|
private Boolean needAccountInfo;
|
||||||
|
private List<UboInfoListItem> uboInfoList;
|
||||||
private EcommerceAccountInfo accountInfo;
|
private EcommerceAccountInfo accountInfo;
|
||||||
private EcommerceContactInfo contactInfo;
|
private EcommerceContactInfo contactInfo;
|
||||||
private SalesSceneInfo salesSceneInfo;
|
private SalesSceneInfo salesSceneInfo;
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
package cn.felord.payment.wechat.v3.model.ecommerce;
|
package cn.felord.payment.wechat.v3.model.ecommerce;
|
||||||
|
|
||||||
import cn.felord.payment.wechat.enumeration.BusinessCertType;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -26,7 +25,6 @@ import lombok.Data;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class EcommerceBusinessLicenseInfo {
|
public class EcommerceBusinessLicenseInfo {
|
||||||
private BusinessCertType certType;
|
|
||||||
private String businessLicenseCopy;
|
private String businessLicenseCopy;
|
||||||
private String businessLicenseNumber;
|
private String businessLicenseNumber;
|
||||||
private String merchantName;
|
private String merchantName;
|
||||||
|
|||||||
@@ -17,20 +17,13 @@
|
|||||||
|
|
||||||
package cn.felord.payment.wechat.v3.model.ecommerce;
|
package cn.felord.payment.wechat.v3.model.ecommerce;
|
||||||
|
|
||||||
import cn.felord.payment.wechat.enumeration.IdDocType;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class EcommerceContactInfo {
|
public class EcommerceContactInfo {
|
||||||
private String contactType;
|
private String contactType;
|
||||||
private String contactName;
|
private String contactName;
|
||||||
private IdDocType contactIdDocType;
|
|
||||||
private String contactIdCardNumber;
|
private String contactIdCardNumber;
|
||||||
private String contactIdDocCopy;
|
|
||||||
private String contactIdDocCopyBack;
|
|
||||||
private String contactIdDocPeriodEnd;
|
|
||||||
private String businessAuthorizationLetter;
|
|
||||||
private String contactIdDocPeriodBegin;
|
|
||||||
private String mobilePhone;
|
private String mobilePhone;
|
||||||
private String contactEmail;
|
private String contactEmail;
|
||||||
}
|
}
|
||||||
@@ -31,5 +31,5 @@ public class UboInfoListItem {
|
|||||||
private String uboIdDocNumber;
|
private String uboIdDocNumber;
|
||||||
private String uboIdDocAddress;
|
private String uboIdDocAddress;
|
||||||
private LocalDate uboIdDocPeriodBegin;
|
private LocalDate uboIdDocPeriodBegin;
|
||||||
private String uboIdDocPeriodEnd;
|
private LocalDate uboIdDocPeriodEnd;
|
||||||
}
|
}
|
||||||
@@ -22,11 +22,11 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>cn.felord</groupId>
|
<groupId>cn.felord</groupId>
|
||||||
<artifactId>payment-spring-boot</artifactId>
|
<artifactId>payment-spring-boot</artifactId>
|
||||||
<version>1.0.20.RELEASE</version>
|
<version>1.0.19.RELEASE</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>payment-spring-boot-starter</artifactId>
|
<artifactId>payment-spring-boot-starter</artifactId>
|
||||||
<version>1.0.20.RELEASE</version>
|
<version>1.0.19.RELEASE</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
82
pom.xml
82
pom.xml
@@ -21,7 +21,7 @@
|
|||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<groupId>cn.felord</groupId>
|
<groupId>cn.felord</groupId>
|
||||||
<artifactId>payment-spring-boot</artifactId>
|
<artifactId>payment-spring-boot</artifactId>
|
||||||
<version>1.0.20.RELEASE</version>
|
<version>1.0.19.RELEASE</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
@@ -90,7 +90,12 @@
|
|||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
<spring-boot.version>2.7.7</spring-boot.version>
|
<spring-boot.version>2.7.7</spring-boot.version>
|
||||||
<alipay-sdk.version>4.31.7.ALL</alipay-sdk.version>
|
<alipay-sdk.version>4.31.7.ALL</alipay-sdk.version>
|
||||||
<bcprov.version>1.74</bcprov.version>
|
<bcprov.version>1.69</bcprov.version>
|
||||||
|
<retrofit.version>2.9.0</retrofit.version>
|
||||||
|
<okhttp3.version>4.10.0</okhttp3.version>
|
||||||
|
<lombok.version>1.18.26</lombok.version>
|
||||||
|
<jackson.version>2.13.5</jackson.version>
|
||||||
|
<slf4j.version>2.0.7</slf4j.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
@@ -116,7 +121,6 @@
|
|||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alipay.sdk</groupId>
|
<groupId>com.alipay.sdk</groupId>
|
||||||
<artifactId>alipay-sdk-java</artifactId>
|
<artifactId>alipay-sdk-java</artifactId>
|
||||||
@@ -132,6 +136,78 @@
|
|||||||
<artifactId>payment-spring-boot-autoconfigure</artifactId>
|
<artifactId>payment-spring-boot-autoconfigure</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.squareup.retrofit2</groupId>
|
||||||
|
<artifactId>retrofit</artifactId>
|
||||||
|
<version>${retrofit.version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>com.squareup.okhttp3</groupId>
|
||||||
|
<artifactId>okhttp</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.squareup.retrofit2</groupId>
|
||||||
|
<artifactId>adapter-rxjava3</artifactId>
|
||||||
|
<version>${retrofit.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.squareup.retrofit2</groupId>
|
||||||
|
<artifactId>converter-jaxb</artifactId>
|
||||||
|
<version>${retrofit.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.squareup.retrofit2</groupId>
|
||||||
|
<artifactId>converter-jackson</artifactId>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
|
<artifactId>jackson-databind</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
<version>${retrofit.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.squareup.okhttp3</groupId>
|
||||||
|
<artifactId>okhttp</artifactId>
|
||||||
|
<version>${okhttp3.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.squareup.okhttp3</groupId>
|
||||||
|
<artifactId>logging-interceptor</artifactId>
|
||||||
|
<version>${okhttp3.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
|
<artifactId>jackson-databind</artifactId>
|
||||||
|
<version>${jackson.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||||
|
<artifactId>jackson-datatype-jdk8</artifactId>
|
||||||
|
<version>${jackson.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||||
|
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||||
|
<version>${jackson.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.module</groupId>
|
||||||
|
<artifactId>jackson-module-parameter-names</artifactId>
|
||||||
|
<version>${jackson.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
<version>${slf4j.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<version>${lombok.version}</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user