mirror of
https://github.com/dromara/payment-spring-boot.git
synced 2026-03-14 05:43:46 +08:00
Merge remote-tracking branch 'origin/release' into release
This commit is contained in:
42
.github/workflows/main.yml
vendored
42
.github/workflows/main.yml
vendored
@@ -1,35 +1,31 @@
|
|||||||
name: Maven Central Repo Deployment
|
name: Maven Central Repo Deployment
|
||||||
# 当 release 的时候触发
|
# 当 release 的时候触发
|
||||||
|
#on:
|
||||||
|
# release:
|
||||||
|
# types: [released]
|
||||||
on:
|
on:
|
||||||
release:
|
push:
|
||||||
types: [released]
|
branches: [ release ]
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
- name: Set up Maven Central Repo
|
- name: Set up Maven Central Repo
|
||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
java-version: 1.8
|
java-version: 1.8
|
||||||
server-id: sonatype-nexus-staging
|
server-id: sonatype-nexus-staging
|
||||||
server-username: MAVEN_USERNAME
|
server-username: ${{ secrets.OSSRH_USER }}
|
||||||
server-password: MAVEN_PASSWORD
|
server-password: ${{ secrets.OSSRH_PASSWORD }}
|
||||||
gpg-passphrase: MAVEN_GPG_PASSPHRASE
|
gpg-passphrase: ${{ secrets.GPG_PASSWORD }}
|
||||||
- id: install-secret-key
|
- name: Publish to Maven Central Repo
|
||||||
name: Install GPG Secret Key
|
uses: samuelmeuli/action-maven-publish@v1
|
||||||
run: |
|
with:
|
||||||
cat <(echo -e "${{ secrets.GPG_PUB }}") | gpg --batch --import
|
gpg_private_key: ${{ secrets.GPG_SECRET }}
|
||||||
gpg --list-secret-keys --keyid-format LONG
|
gpg_passphrase: ${{ secrets.GPG_PASSWORD }}
|
||||||
- id: publish-to-central
|
nexus_username: ${{ secrets.OSSRH_USER }}
|
||||||
name: Publish to Maven Central Repo
|
nexus_password: ${{ secrets.OSSRH_PASSWORD }}
|
||||||
env:
|
server-id: sonatype-nexus-staging
|
||||||
MAVEN_USERNAME: ${{ secrets.OSSRH_USER }}
|
|
||||||
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
|
|
||||||
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSWORD }}
|
|
||||||
run: |
|
|
||||||
mvn \
|
|
||||||
--no-transfer-progress \
|
|
||||||
--batch-mode \
|
|
||||||
-Dgpg.passphrase=${{ secrets.GPG_PASSWORD }} \
|
|
||||||
clean deploy
|
|
||||||
|
|||||||
@@ -29,64 +29,42 @@ public enum CouponBgColor {
|
|||||||
/**
|
/**
|
||||||
* Color 010 coupon bg color.
|
* Color 010 coupon bg color.
|
||||||
*/
|
*/
|
||||||
COLOR010("#63B359"),
|
Color010,
|
||||||
/**
|
/**
|
||||||
* Color 020 coupon bg color.
|
* Color 020 coupon bg color.
|
||||||
*/
|
*/
|
||||||
COLOR020("#2C9F67"),
|
Color020,
|
||||||
/**
|
/**
|
||||||
* Color 030 coupon bg color.
|
* Color 030 coupon bg color.
|
||||||
*/
|
*/
|
||||||
COLOR030("#509FC9"),
|
Color030,
|
||||||
/**
|
/**
|
||||||
* Color 040 coupon bg color.
|
* Color 040 coupon bg color.
|
||||||
*/
|
*/
|
||||||
COLOR040("#5885CF"),
|
Color040,
|
||||||
/**
|
/**
|
||||||
* Color 050 coupon bg color.
|
* Color 050 coupon bg color.
|
||||||
*/
|
*/
|
||||||
COLOR050("#9062C0"),
|
Color050,
|
||||||
/**
|
/**
|
||||||
* Color 060 coupon bg color.
|
* Color 060 coupon bg color.
|
||||||
*/
|
*/
|
||||||
COLOR060("#D09A45"),
|
Color060,
|
||||||
/**
|
/**
|
||||||
* Color 070 coupon bg color.
|
* Color 070 coupon bg color.
|
||||||
*/
|
*/
|
||||||
COLOR070("#E4B138"),
|
Color070,
|
||||||
/**
|
/**
|
||||||
* Color 080 coupon bg color.
|
* Color 080 coupon bg color.
|
||||||
*/
|
*/
|
||||||
COLOR080("#EE903C"),
|
Color080,
|
||||||
/**
|
/**
|
||||||
* Color 090 coupon bg color.
|
* Color 090 coupon bg color.
|
||||||
*/
|
*/
|
||||||
COLOR090("#DD6549"),
|
Color090,
|
||||||
/**
|
/**
|
||||||
* Color 100 coupon bg color.
|
* Color 100 coupon bg color.
|
||||||
*/
|
*/
|
||||||
COLOR100("#CC463D");
|
Color100
|
||||||
|
|
||||||
/**
|
|
||||||
* The Color.
|
|
||||||
*/
|
|
||||||
private final String color;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Instantiates a new Coupon bg color.
|
|
||||||
*
|
|
||||||
* @param color the color
|
|
||||||
*/
|
|
||||||
CouponBgColor(String color) {
|
|
||||||
this.color = color;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Color string.
|
|
||||||
*
|
|
||||||
* @return the string
|
|
||||||
*/
|
|
||||||
public String color() {
|
|
||||||
return this.color;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,9 +24,9 @@ import cn.felord.payment.wechat.v3.model.FundFlowBillParams;
|
|||||||
import cn.felord.payment.wechat.v3.model.TradeBillParams;
|
import cn.felord.payment.wechat.v3.model.TradeBillParams;
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
|
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
|
||||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
|
||||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||||
import org.springframework.core.io.Resource;
|
import org.springframework.core.io.Resource;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
@@ -88,10 +88,12 @@ public abstract class AbstractApi {
|
|||||||
* @param mapper the mapper
|
* @param mapper the mapper
|
||||||
*/
|
*/
|
||||||
private void applyObjectMapper(ObjectMapper mapper) {
|
private void applyObjectMapper(ObjectMapper mapper) {
|
||||||
mapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE);
|
mapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE)
|
||||||
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false)
|
||||||
SimpleModule module = new JavaTimeModule();
|
// empty string error
|
||||||
mapper.registerModule(module);
|
.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, true)
|
||||||
|
.setSerializationInclusion(JsonInclude.Include.NON_NULL)
|
||||||
|
.registerModule(new JavaTimeModule());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -185,10 +187,11 @@ public abstract class AbstractApi {
|
|||||||
return RequestEntity.get(uri).header("Pay-TenantId", tenantId)
|
return RequestEntity.get(uri).header("Pay-TenantId", tenantId)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建Get请求对象.
|
* 构建Get请求对象.
|
||||||
*
|
*
|
||||||
* @param uri the uri
|
* @param uri the uri
|
||||||
* @param httpHeaders the http headers
|
* @param httpHeaders the http headers
|
||||||
* @return the request entity
|
* @return the request entity
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ import com.fasterxml.jackson.core.JsonProcessingException;
|
|||||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
|
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
|
||||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
|
||||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -72,11 +71,11 @@ public class WechatPayCallback {
|
|||||||
private final String tenantId;
|
private final String tenantId;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
MAPPER.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE);
|
MAPPER.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE)
|
||||||
MAPPER.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
.setSerializationInclusion(JsonInclude.Include.NON_NULL)
|
||||||
MAPPER.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false);
|
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false)
|
||||||
SimpleModule module = new JavaTimeModule();
|
.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT,true)
|
||||||
MAPPER.registerModule(module);
|
.registerModule(new JavaTimeModule());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
44
pom.xml
44
pom.xml
@@ -36,6 +36,29 @@
|
|||||||
<developerConnection>scm:git:https://github.com/NotFound403/payment-spring-boot.git</developerConnection>
|
<developerConnection>scm:git:https://github.com/NotFound403/payment-spring-boot.git</developerConnection>
|
||||||
</scm>
|
</scm>
|
||||||
|
|
||||||
|
<profiles>
|
||||||
|
<!-- Deployment profile (required so these plugins are only used when deploying) -->
|
||||||
|
<profile>
|
||||||
|
<id>deploy</id>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-source-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
<!-- GPG plugin -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-gpg-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
<module>payment-spring-boot-autoconfigure</module>
|
<module>payment-spring-boot-autoconfigure</module>
|
||||||
@@ -173,10 +196,18 @@
|
|||||||
<version>1.6</version>
|
<version>1.6</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
|
<id>sign-artifacts</id>
|
||||||
<phase>verify</phase>
|
<phase>verify</phase>
|
||||||
<goals>
|
<goals>
|
||||||
<goal>sign</goal>
|
<goal>sign</goal>
|
||||||
</goals>
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<!-- Prevent `gpg` from using pinentry programs -->
|
||||||
|
<gpgArguments>
|
||||||
|
<arg>--pinentry-mode</arg>
|
||||||
|
<arg>loopback</arg>
|
||||||
|
</gpgArguments>
|
||||||
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
@@ -188,23 +219,12 @@
|
|||||||
<configuration>
|
<configuration>
|
||||||
<serverId>sonatype-nexus-staging</serverId>
|
<serverId>sonatype-nexus-staging</serverId>
|
||||||
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
|
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
|
||||||
|
<autoReleaseAfterClose>false</autoReleaseAfterClose>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</pluginManagement>
|
</pluginManagement>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-source-plugin</artifactId>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-gpg-plugin</artifactId>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.sonatype.plugins</groupId>
|
<groupId>org.sonatype.plugins</groupId>
|
||||||
<artifactId>nexus-staging-maven-plugin</artifactId>
|
<artifactId>nexus-staging-maven-plugin</artifactId>
|
||||||
|
|||||||
Reference in New Issue
Block a user