8 Commits

Author SHA1 Message Date
felord.cn
54a0822c73 ci: github action support 2021-03-23 00:37:08 +08:00
felord.cn
8d130e5df1 fix: remove unused files 2021-03-23 00:25:44 +08:00
felord.cn
e0eacd523e feat: upgrade to 1.0.9 2021-03-23 00:23:08 +08:00
felord.cn
d1068c1fb6 fix: 支付分支付成功回调反序列化异常
Closes #21
2021-03-23 00:23:08 +08:00
felord.cn
82bcc11dad fix: 修复枚举空指针问题
Closes #22
2021-03-23 00:23:08 +08:00
felord.cn
911f986d80 refactor: WechatPartnerPayApi 加入Spring IOC 2021-03-23 00:23:08 +08:00
felord.cn
b913698884 Create main.yml
ci: github action
2021-03-23 00:15:40 +08:00
felord.cn
34e5443e88 ci: github action support 2021-03-23 00:12:53 +08:00
12 changed files with 66 additions and 11 deletions

33
.github/workflows/main.yml vendored Normal file
View File

@@ -0,0 +1,33 @@
name: Maven Central Repo Deployment
# 当 release 的时候触发
on:
release:
types: [released]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Maven Central Repo
uses: actions/setup-java@v1
with:
java-version: 1.8
server-id: sonatype-nexus-staging
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- id: install-secret-key
name: Install GPG Secret Key
run: |
cat <(echo -e "${{ secrets.GPG_PUB }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
- id: publish-to-central
name: Publish to Maven Central Repo
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USER }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
run: |
mvn \
--no-transfer-progress \
--batch-mode \
-Dgpg.passphrase=${{ secrets.GPG_PASSWORD }} \
clean deploy

View File

@@ -11,7 +11,7 @@
<dependency>
<groupId>cn.felord</groupId>
<artifactId>payment-spring-boot-starter</artifactId>
<version>1.0.8.RELEASE</version>
<version>1.0.9.RELEASE</version>
</dependency>
```

View File

@@ -35,7 +35,7 @@
<dependency>
<groupId>cn.felord</groupId>
<artifactId>payment-spring-boot-starter</artifactId>
<version>1.0.8.RELEASE</version>
<version>1.0.9.RELEASE</version>
</dependency>
```
## 采用技术

View File

@@ -4,7 +4,7 @@
<dependency>
<groupId>cn.felord</groupId>
<artifactId>payment-spring-boot-starter</artifactId>
<version>1.0.8.RELEASE</version>
<version>1.0.9.RELEASE</version>
</dependency>
```
> 基于 **Spring Boot 2.x**

View File

@@ -5,11 +5,11 @@
<parent>
<groupId>cn.felord</groupId>
<artifactId>payment-spring-boot</artifactId>
<version>1.0.8.RELEASE</version>
<version>1.0.9.RELEASE</version>
</parent>
<artifactId>payment-spring-boot-autoconfigure</artifactId>
<version>1.0.8.RELEASE</version>
<version>1.0.9.RELEASE</version>
<packaging>jar</packaging>
<modelVersion>4.0.0</modelVersion>

View File

@@ -65,6 +65,18 @@ public class WechatApiProvider {
return new WechatDirectPayApi(wechatPayClient, tenantId);
}
/**
* 普通支付-服务商模式.
*
* @param tenantId the tenant id
* @return the wechat pay api
* @since 1.0.9.RELEASE
*/
public WechatPartnerPayApi partnerPayApi(String tenantId) {
return new WechatPartnerPayApi(wechatPayClient, tenantId);
}
/**
* 合单支付.
*

View File

@@ -30,6 +30,7 @@ import org.springframework.util.StringUtils;
import org.springframework.web.util.UriComponentsBuilder;
import java.net.URI;
import java.util.Optional;
/**
* 微信支付商家券.
@@ -146,7 +147,10 @@ public class WechatMarketingBusiFavorApi extends AbstractApi {
queryParams.add("appid", appid);
}
queryParams.add("stock_id", userBusiFavorQueryParams.getStockId());
queryParams.add("coupon_state", userBusiFavorQueryParams.getCouponState().name());
Optional.ofNullable(userBusiFavorQueryParams.getCouponState())
.ifPresent(state-> queryParams.add("coupon_state", state.name()));
queryParams.add("creator_merchant", userBusiFavorQueryParams.getCreatorMerchant());
queryParams.add("belong_merchant", userBusiFavorQueryParams.getBelongMerchant());
queryParams.add("sender_merchant", userBusiFavorQueryParams.getSenderMerchant());

View File

@@ -31,6 +31,7 @@ import cn.felord.payment.wechat.v3.model.payscore.PayScoreUserPaidConsumeData;
import cn.felord.payment.wechat.v3.model.payscore.PayScoreUserPermissionConsumeData;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.module.SimpleModule;
@@ -73,6 +74,7 @@ public class WechatPayCallback {
static {
MAPPER.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE);
MAPPER.setSerializationInclusion(JsonInclude.Include.NON_NULL);
MAPPER.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false);
SimpleModule module = new JavaTimeModule();
MAPPER.registerModule(module);
}

View File

@@ -49,7 +49,7 @@ public class BusiFavorReceiveConsumeData {
/**
* 发放时间 rfc 3339 yyyy-MM-ddTHH:mm:ss+TIMEZONE
*/
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ssXXX", timezone = "GMT+8")
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "GMT+8")
private OffsetDateTime sendTime;
/**
* 微信用户在appid下的唯一标识。

View File

@@ -98,6 +98,10 @@ public class PayScoreUserPaidConsumeData {
* The Time range.
*/
private TimeRange timeRange;
/**
* stateDescription
*/
private String stateDescription;
/**
* The Total amount.
*/

View File

@@ -5,11 +5,11 @@
<parent>
<groupId>cn.felord</groupId>
<artifactId>payment-spring-boot</artifactId>
<version>1.0.8.RELEASE</version>
<version>1.0.9.RELEASE</version>
</parent>
<artifactId>payment-spring-boot-starter</artifactId>
<version>1.0.8.RELEASE</version>
<version>1.0.9.RELEASE</version>
<packaging>jar</packaging>
<modelVersion>4.0.0</modelVersion>

View File

@@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<groupId>cn.felord</groupId>
<artifactId>payment-spring-boot</artifactId>
<version>1.0.8.RELEASE</version>
<version>1.0.9.RELEASE</version>
<packaging>pom</packaging>
<modelVersion>4.0.0</modelVersion>
@@ -30,7 +30,7 @@
</developers>
<scm>
<tag>payment-spring-boot-1.0.8.RELEASE</tag>
<tag>payment-spring-boot-1.0.9.RELEASE</tag>
<url>https://github.com/NotFound403/payment-spring-boot</url>
<connection>scm:git:https://github.com/NotFound403/payment-spring-boot.git</connection>
<developerConnection>scm:git:https://github.com/NotFound403/payment-spring-boot.git</developerConnection>